diff options
| author | aarne <unknown> | 2005-10-06 09:02:33 +0000 |
|---|---|---|
| committer | aarne <unknown> | 2005-10-06 09:02:33 +0000 |
| commit | c2aeb9ae16c344c354194ec2efac773bbb7ce5d1 (patch) | |
| tree | dbb71f76a6130352025a799e08fedc14bd94af14 /src/GF/GFModes.hs | |
| parent | a78acc722ec26be2be20f22f74e98329d57008b1 (diff) | |
macro commands
Diffstat (limited to 'src/GF/GFModes.hs')
| -rw-r--r-- | src/GF/GFModes.hs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/GF/GFModes.hs b/src/GF/GFModes.hs index 4a29144d5..bf3e90f97 100644 --- a/src/GF/GFModes.hs +++ b/src/GF/GFModes.hs @@ -4,9 +4,9 @@ -- Stability : (stability) -- Portability : (portability) -- --- > CVS $Date: 2005/04/21 16:21:04 $ --- > CVS $Author: bringert $ --- > CVS $Revision: 1.7 $ +-- > CVS $Date: 2005/10/06 10:02:33 $ +-- > CVS $Author: aarne $ +-- > CVS $Revision: 1.8 $ -- -- (Description of the module) ----------------------------------------------------------------------------- @@ -30,7 +30,7 @@ import Data.Char (isSpace) gfInteract :: HState -> IO HState gfInteract st@(env,hist) = do -- putStrFlush "> " M.F 25/01-02 prompt moved to Arch. - (s,cs) <- getCommandLines + (s,cs) <- getCommandLines st case ifImpure cs of -- these are the three impure commands @@ -39,12 +39,12 @@ gfInteract st@(env,hist) = do return st Just (ICExecuteHistory file,_) -> do ss <- readFileIf file - let co = pCommandLines ss + let co = pCommandLines st ss st' <- execLinesH s co st gfInteract st' Just (ICEarlierCommand i,_) -> do let line = earlierCommandH st i - co = pCommandLine $ words line + co = pCommandLine st $ words line st' <- execLinesH line [co] st -- s would not work in execLinesH gfInteract st' @@ -69,7 +69,7 @@ gfInteract st@(env,hist) = do gfBatch :: HState -> IO HState gfBatch st@(sh,_) = do - (s,cs) <- getCommandLinesBatch + (s,cs) <- getCommandLinesBatch st if s == "q" then return st else do st' <- if all isSpace s then return st else do putVe "<gfcommand>" @@ -90,9 +90,10 @@ putVerb st@(sh,_) s = if (oElem beSilent (globalOptions sh)) batchCompile :: Options -> FilePath -> IO () batchCompile os file = do let file' = mkGFC file + let st = initHState emptyShellState let s = "i -o" +++ (unwords $ map ('-':) $ words $ prOpts os) +++ file - let cs = pCommandLines s - execLines True cs (initHState emptyShellState) + let cs = pCommandLines st s + execLines True cs st return () mkGFC = reverse . ("cfg" ++) . dropWhile (/='.') . reverse |
