summaryrefslogtreecommitdiff
path: root/src/GF/Shell
diff options
context:
space:
mode:
authoraarne <unknown>2004-08-12 09:02:00 +0000
committeraarne <unknown>2004-08-12 09:02:00 +0000
commit096c861fb4cb7feba5db4752da029c639527b3b3 (patch)
tree60d27402a4b551856bfb5f0d8856db8d06c22e42 /src/GF/Shell
parent4bc5b35bcb4a834c7d22f6503bf5d64e7092cd2b (diff)
fixes for Janna
Diffstat (limited to 'src/GF/Shell')
-rw-r--r--src/GF/Shell/Commands.hs11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/GF/Shell/Commands.hs b/src/GF/Shell/Commands.hs
index 9bf1f8ff2..5a16c4b59 100644
--- a/src/GF/Shell/Commands.hs
+++ b/src/GF/Shell/Commands.hs
@@ -144,13 +144,15 @@ execCommand env c s = case c of
CCEnvOpenTerm file -> do
c <- readFileIf file
let (fs,t) = envAndTerm file c
- env' <- useIOE env $ foldM (shellStateFromFiles noOptions) env fs
+ (env',_) <- execCommand env (CCEnvGFShell fs) s
+---- env' <- useIOE env $ foldM (shellStateFromFiles noOptions) env fs
return (env', execECommand env' (CNewTree t) s)
CCEnvOpenString file -> do
c <- readFileIf file
let (fs,t) = envAndTerm file c
- env' <- useIOE env $ foldM (shellStateFromFiles noOptions) env fs
+ (env',_) <- execCommand env (CCEnvGFShell fs) s
+---- env' <- useIOE env $ foldM (shellStateFromFiles noOptions) env fs
return (env', execECommand env' (CRefineParse t) s)
CCEnvOn name -> return (languageOn (language name) env,s)
@@ -177,9 +179,10 @@ execCommand env c s = case c of
cgr = canCEnv env
opts = globalOptions env
- -- format for documents: import lines of form "-- file", then term
+ -- format for documents:
+ -- GF commands of form "-- command", then term or text
envAndTerm f s =
- (map ((initFilePath f ++) . filter (/=' ') . drop 2) fs, unlines ss) where
+ (unwords (intersperse ";;" fs), unlines ss) where
(fs,ss) = span isImport (lines s)
isImport l = take 2 l == "--"