1
0
forked from GitHub/gf-core

gfe as preprocessing to compiler

This commit is contained in:
aarne
2005-06-10 20:04:00 +00:00
parent 3b4eaf5017
commit 6c5b4ea96b
10 changed files with 125 additions and 38 deletions

View File

@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
-- > CVS $Date: 2005/05/17 12:37:17 $
-- > CVS $Date: 2005/06/10 21:04:01 $
-- > CVS $Author: aarne $
-- > CVS $Revision: 1.38 $
-- > CVS $Revision: 1.39 $
--
-- GF shell command interpreter.
-----------------------------------------------------------------------------
@@ -50,6 +50,7 @@ import GF.Grammar.PrGrammar
import Control.Monad (foldM,liftM)
import System (system)
import System.Random (newStdGen) ----
import Data.List (nub)
import GF.Data.Zipper ----
import GF.Data.Operations
@@ -126,9 +127,14 @@ execLine put (c@(co, os), arg, cs) (outps,st) = do
execC :: CommandOpt -> ShellIO
execC co@(comm, opts0) sa@((st,(h,_)),a) = checkOptions st co >> case comm of
CImport file | oElem fromExamples opts -> do
es <- liftM nub $ getGFEFiles opts file
system $ "gf -examples" +++ unlines es
execC (comm, removeOption fromExamples opts) sa
CImport file -> useIOE sa $ do
st1 <- shellStateFromFiles opts st file
ioeIO $ changeState (const st1) sa --- \ ((_,h),a) -> ((st,h), a))
CEmptyState -> changeState reinitShellState sa
CChangeMain ma -> changeStateErr (changeMain ma) sa
CStripState -> changeState purgeShellState sa