aboutsummaryrefslogtreecommitdiff
path: root/mparser.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2013-07-27 17:21:59 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2013-07-27 17:21:59 +0300
commit59c1dd44ed9feb4430edbb48f30842ea4b16e18c (patch)
tree5d04cb7d3b4ca3b2bd6efd491cb20eaccd04f7f7 /mparser.py
parent782021d65ee0f928f0d0b08b51068a32171e9801 (diff)
downloadmeson-59c1dd44ed9feb4430edbb48f30842ea4b16e18c.zip
meson-59c1dd44ed9feb4430edbb48f30842ea4b16e18c.tar.gz
meson-59c1dd44ed9feb4430edbb48f30842ea4b16e18c.tar.bz2
Can do logical negation.
Diffstat (limited to 'mparser.py')
-rw-r--r--mparser.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/mparser.py b/mparser.py
index c4f1c39..f603f2f 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