From 59c1dd44ed9feb4430edbb48f30842ea4b16e18c Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sat, 27 Jul 2013 17:21:59 +0300 Subject: Can do logical negation. --- mparser.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mparser.py') diff --git a/mparser.py b/mparser.py index c4f1c390f..f603f2ffe 100644 --- a/mparser.py +++ b/mparser.py @@ -71,6 +71,7 @@ precedence = ( ('nonassoc', 'EQUALS', 'NEQUALS'), ('left', 'OR'), ('left', 'AND'), +('right', 'NOT'), ('nonassoc', 'COLON'), ('left', 'DOT'), ) @@ -200,6 +201,10 @@ def p_statement_or(t): 'statement : statement OR statement' t[0] = nodes.OrStatement(t[1], t[3]) +def p_statement_not(t): + 'statement : NOT statement' + t[0] = nodes.NotStatement(t[2]) + def p_empty_else(t): 'elseblock : ' return None -- cgit v1.2.3