From 388a68e1fc4dba85ecbad5f4fa0eed27c3b2891c Mon Sep 17 00:00:00 2001 From: emile Date: Thu, 30 May 2019 19:58:02 +0200 Subject: [PATCH] minor fix --- program.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/program.py b/program.py index b918dcf..a9308c2 100644 --- a/program.py +++ b/program.py @@ -52,7 +52,7 @@ class RegexInterpreter(AbstractInterpreter): def isValid(self,f)->bool: - formula = f.s.replace("!", "\\!") + formula = "({0})".format(f.s.replace("!", "\\!")) make_reg = lambda formula,pattern: 'echo "{0}" | grep -P "{1}"'.format(formula,pattern) def check_assertion(formula, pattern): @@ -192,7 +192,7 @@ if len(sys.argv) > 1 : for l in u: print(Formula(l,i).isValid()) else: - print(Formula( sys.argv[1],i).isValid()) + print(Formula( sys.argv[1] if sys.argv[1] != '-g' else sys.argv[2],i).isValid()) else: print("help?")