mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-22 01:22:51 -06:00
moved interruption to GFI level to capture all commands
This commit is contained in:
@@ -38,10 +38,13 @@ interpretCommandLine :: (String -> String) -> CommandEnv -> String -> IO ()
|
|||||||
interpretCommandLine enc env line =
|
interpretCommandLine enc env line =
|
||||||
case readCommandLine line of
|
case readCommandLine line of
|
||||||
Just [] -> return ()
|
Just [] -> return ()
|
||||||
|
Just pipes -> mapM_ (interpretPipe enc env) pipes
|
||||||
|
{-
|
||||||
Just pipes -> do res <- runInterruptibly (mapM_ (interpretPipe enc env) pipes)
|
Just pipes -> do res <- runInterruptibly (mapM_ (interpretPipe enc env) pipes)
|
||||||
case res of
|
case res of
|
||||||
Left ex -> putStrLnFlush $ enc (show ex)
|
Left ex -> putStrLnFlush $ enc (show ex)
|
||||||
Right x -> return x
|
Right x -> return x
|
||||||
|
-}
|
||||||
Nothing -> putStrLnFlush "command not parsed"
|
Nothing -> putStrLnFlush "command not parsed"
|
||||||
|
|
||||||
interpretPipe enc env cs = do
|
interpretPipe enc env cs = do
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ import System.Cmd
|
|||||||
import System.CPUTime
|
import System.CPUTime
|
||||||
import Control.Exception
|
import Control.Exception
|
||||||
import Data.Version
|
import Data.Version
|
||||||
|
import GF.System.Signal
|
||||||
|
|
||||||
|
|
||||||
import Paths_gf
|
import Paths_gf
|
||||||
|
|
||||||
@@ -53,7 +55,7 @@ loop opts gfenv0 = do
|
|||||||
pwords = case words s of
|
pwords = case words s of
|
||||||
w:ws -> getCommandOp w :ws
|
w:ws -> getCommandOp w :ws
|
||||||
ws -> ws
|
ws -> ws
|
||||||
case pwords of
|
r <- runInterruptibly $ case pwords of
|
||||||
-- special commands, requiring source grammar in env
|
-- special commands, requiring source grammar in env
|
||||||
"!":ws -> do
|
"!":ws -> do
|
||||||
system $ unwords ws
|
system $ unwords ws
|
||||||
@@ -106,6 +108,8 @@ loop opts gfenv0 = do
|
|||||||
_ -> do
|
_ -> do
|
||||||
interpretCommandLine enc env s
|
interpretCommandLine enc env s
|
||||||
loopNewCPU gfenv
|
loopNewCPU gfenv
|
||||||
|
gfenv' <- return $ either (const gfenv) id r
|
||||||
|
loopNewCPU gfenv'
|
||||||
|
|
||||||
importInEnv :: GFEnv -> Options -> [FilePath] -> IO GFEnv
|
importInEnv :: GFEnv -> Options -> [FilePath] -> IO GFEnv
|
||||||
importInEnv gfenv opts files
|
importInEnv gfenv opts files
|
||||||
|
|||||||
Reference in New Issue
Block a user