diff --git a/program.py b/program.py index dcf45df..21423c7 100644 --- a/program.py +++ b/program.py @@ -57,15 +57,15 @@ class RegexInterpreter(AbstractInterpreter): make_reg = lambda formula,pattern: 'echo "{0}" | grep -P "{1}"'.format(formula,pattern) def check_assertion(formula, pattern): cmd = make_reg(formula,pattern) - print("EXECUTING... ",cmd) + #print("EXECUTING... ",cmd) result = subprocess.run([cmd], shell=True, stdout=subprocess.PIPE) - return len(result.stdout)>0 + return not len(result.stdout)>0 cmd =make_reg(formula,'^(\((?:[^()]++|(?1))*\))$') - print("EXECUTING... ",cmd) + #print("EXECUTING... ",cmd) result = subprocess.run([cmd], shell=True, stdout=subprocess.PIPE) - return None + isValid = len(result.stdout)>0 if not isValid: return False @@ -182,7 +182,7 @@ if len(sys.argv) > 1 : i = ProperInterpreter() if '-g' in sys.argv: i = RegexInterpreter() - print(sys.argv) + #print(sys.argv) if '-f' in sys.argv: #open from file