From 6ff517a8e4227d9489c7b771984dda7508a8158b Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Fri, 3 Jul 2015 17:24:29 +0200 Subject: Improved parser --- LogicParser.icl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'LogicParser.icl') 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 \n") -| otherwise = toString (truthtable (parse argv.[1])) +| argc < 1 = abort ("Usage: " +++ argv.[0] +++ " -b -nt \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" -- cgit v1.2.3