From 6a66fc5d71747c1009590e68887a9bbd6f44e598 Mon Sep 17 00:00:00 2001 From: aarne Date: Fri, 10 Jun 2005 20:04:00 +0000 Subject: gfe as preprocessing to compiler --- src/GF/Shell.hs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/GF/Shell.hs') 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 -- cgit v1.2.3