diff options
author | Camil Staps | 2015-07-03 17:24:29 +0200 |
---|---|---|
committer | Camil Staps | 2015-07-03 17:24:29 +0200 |
commit | 6ff517a8e4227d9489c7b771984dda7508a8158b (patch) | |
tree | 8011bcdc4645f9fcf4132c08ab51ceeb637c6729 /LogicParser.icl | |
parent | Parser; cleanup (diff) |
Improved parser
Diffstat (limited to 'LogicParser.icl')
-rw-r--r-- | LogicParser.icl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/LogicParser.icl b/LogicParser.icl index b25b0e5..320e2cc 100644 --- a/LogicParser.icl +++ b/LogicParser.icl @@ -26,9 +26,12 @@ module LogicParser import StdEnv, StdMaybe, ArgEnv, Logic Start -| argc <> 1 = abort ("Usage: " +++ argv.[0] +++ " -b -nt <string>\n") -| otherwise = toString (truthtable (parse argv.[1])) +| argc < 1 = abort ("Usage: " +++ argv.[0] +++ " -b -nt <string>\n") +| extended = toString (truthtable (parse argv.[2])) +| otherwise = toString (simple_truthtable_n [parse argv.[n] \\ n <- [1..argc]]) +//| otherwise = toString ((if extended truthtable simple_truthtable) (parse argv.[1])) where argc = size argv - 1 argv = getCommandLine + extended = argv.[1] == "-e" |