From 2c60a2d82a0d7b90924e7dbbcacf36afb8549d17 Mon Sep 17 00:00:00 2001 From: aarne Date: Thu, 23 Sep 2004 14:41:42 +0000 Subject: Ints n --- src/GF/Shell/Commands.hs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/GF/Shell/Commands.hs') diff --git a/src/GF/Shell/Commands.hs b/src/GF/Shell/Commands.hs index 4b0b3f82d..09f9b5f78 100644 --- a/src/GF/Shell/Commands.hs +++ b/src/GF/Shell/Commands.hs @@ -96,6 +96,7 @@ data Command = -- other commands using IO | CCEnvRefineWithTree String | CCEnvRefineParse String + | CCEnvSave String FilePath isQuit CQuit = True isQuit _ = False @@ -160,6 +161,12 @@ execCommand env c s = case c of CCEnvOn name -> return (languageOn (language name) env,s) CCEnvOff name -> return (languageOff (language name) env,s) + CCEnvSave lang file -> do + let str = optLinearizeTreeVal opts (stateGrammarOfLang env (language lang)) $ treeSState s + writeFile file str + let msg = ["wrote file" +++ file] + return (env,changeMsg msg s) + -- this command is improved by the use of IO CRefineRandom -> do g <- newStdGen -- cgit v1.2.3