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:
@@ -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
|
||||
|
||||
@@ -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 ()
|
||||
|
||||
Reference in New Issue
Block a user