aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/mparser.py9
-rw-r--r--test cases/common/40 logic ops/meson.build6
2 files changed, 11 insertions, 4 deletions
diff --git a/mesonbuild/mparser.py b/mesonbuild/mparser.py
index 6e1e398..fe5ccc5 100644
--- a/mesonbuild/mparser.py
+++ b/mesonbuild/mparser.py
@@ -193,9 +193,10 @@ class OrNode:
self.right = right
class AndNode:
- def __init__(self, lineno, colno, left, right):
- self.lineno = lineno
- self.colno = colno
+ def __init__(self, left, right):
+ self.subdir = left.subdir
+ self.lineno = left.lineno
+ self.colno = left.colno
self.left = left
self.right = right
@@ -436,7 +437,7 @@ class Parser:
def e3(self):
left = self.e4()
while self.accept('and'):
- left = AndNode(left.lineno, left.colno, left, self.e4())
+ left = AndNode(left, self.e4())
return left
def e4(self):
diff --git a/test cases/common/40 logic ops/meson.build b/test cases/common/40 logic ops/meson.build
index e975c7e..897054e 100644
--- a/test cases/common/40 logic ops/meson.build
+++ b/test cases/common/40 logic ops/meson.build
@@ -87,3 +87,9 @@ if t and t and t and t and t and t and t and t and f
else
message('Ok.')
endif
+
+if t and t or t
+ message('Ok.')
+else
+ error('Combination of and-or failed.')
+endif