diff options
Diffstat (limited to 'src/GF/Shell/PShell.hs')
| -rw-r--r-- | src/GF/Shell/PShell.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/GF/Shell/PShell.hs b/src/GF/Shell/PShell.hs index d58b18c16..230a6e62a 100644 --- a/src/GF/Shell/PShell.hs +++ b/src/GF/Shell/PShell.hs @@ -9,7 +9,9 @@ import Option import PGrammar (pzIdent, pTrm) --- (string2formsAndTerm) import API import Arch(fetchCommand) + import Char (isDigit) +import IO -- parsing GF shell commands. AR 11/11/2001 @@ -20,6 +22,11 @@ getCommandLines = do s <- fetchCommand "> " return (s,pCommandLines s) +getCommandLinesBatch :: IO (String,[CommandLine]) +getCommandLinesBatch = do + s <- catch getLine (\e -> if IO.isEOFError e then return "q" else ioError e) + return $ (s,pCommandLines s) + pCommandLines :: String -> [CommandLine] pCommandLines = map pCommandLine . concatMap (chunks ";;" . words) . lines @@ -80,6 +87,7 @@ pCommand ws = case ws of "ma" : s -> aString CMorphoAnalyse s "tt" : s -> aString CTestTokenizer s "cc" : s -> aUnit $ CComputeConcrete $ unwords s + "so" : s -> aUnit $ CShowOpers $ unwords s "tq" : i:o:[] -> aUnit (CTranslationQuiz (language i) (language o)) "tl":i:o:n:[] -> aUnit (CTranslationList (language i) (language o) (readIntArg n)) |
