summaryrefslogtreecommitdiff
path: root/src/GF/Shell.hs
diff options
context:
space:
mode:
authoraarne <unknown>2005-06-10 20:04:00 +0000
committeraarne <unknown>2005-06-10 20:04:00 +0000
commit6a66fc5d71747c1009590e68887a9bbd6f44e598 (patch)
tree13506416fc358d7e05a5c6c1d4d94db609455f50 /src/GF/Shell.hs
parent3f192bd2bb99f827abd20be36fc125c0e6553e80 (diff)
gfe as preprocessing to compiler
Diffstat (limited to 'src/GF/Shell.hs')
-rw-r--r--src/GF/Shell.hs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/GF/Shell.hs b/src/GF/Shell.hs
index dd08e98bd..058715a17 100644
--- a/src/GF/Shell.hs
+++ b/src/GF/Shell.hs
@@ -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