1
0
forked from GitHub/gf-core

Refactor GFI to treat command line files and the i command uniformly. Disable CSE by default in GFI.

This commit is contained in:
bjorn
2008-05-30 15:20:28 +00:00
parent 54ebdab1f7
commit 2f89962c44
3 changed files with 33 additions and 29 deletions

View File

@@ -14,6 +14,7 @@ import System.FilePath
-- import a grammar in an environment where it extends an existing grammar
importGrammar :: PGF -> Options -> [FilePath] -> IO PGF
importGrammar pgf0 _ [] = return pgf0
importGrammar pgf0 opts files =
case takeExtensions (last files) of
s | elem s [".gf",".gfo"] -> do

View File

@@ -1,5 +1,6 @@
module GF.Command.Interpreter (
CommandEnv (..),
mkCommandEnv,
interpretCommandLine
) where
@@ -21,6 +22,9 @@ data CommandEnv = CommandEnv {
commands :: Map.Map String CommandInfo
}
mkCommandEnv :: PGF -> CommandEnv
mkCommandEnv pgf = CommandEnv pgf (allCommands pgf)
interpretCommandLine :: CommandEnv -> String -> IO ()
interpretCommandLine env line = case (pCommandLine (myLexer line)) of
Ok CEmpty -> return ()