From 2f89962c442ba6c9d82d19e8e184a136c1f58bc9 Mon Sep 17 00:00:00 2001 From: bjorn Date: Fri, 30 May 2008 15:20:28 +0000 Subject: Refactor GFI to treat command line files and the i command uniformly. Disable CSE by default in GFI. --- src-3.0/GF/Command/Importing.hs | 1 + src-3.0/GF/Command/Interpreter.hs | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'src-3.0/GF/Command') diff --git a/src-3.0/GF/Command/Importing.hs b/src-3.0/GF/Command/Importing.hs index 48f07969d..c3ad9d746 100644 --- a/src-3.0/GF/Command/Importing.hs +++ b/src-3.0/GF/Command/Importing.hs @@ -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 diff --git a/src-3.0/GF/Command/Interpreter.hs b/src-3.0/GF/Command/Interpreter.hs index a5da51f7e..fa0de5ec8 100644 --- a/src-3.0/GF/Command/Interpreter.hs +++ b/src-3.0/GF/Command/Interpreter.hs @@ -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 () -- cgit v1.2.3