diff options
-rw-r--r-- | mesonbuild/mparser.py | 7 | ||||
-rw-r--r-- | test cases/failing/57 or on new line/meson.build (renamed from test cases/failing/55 or on new line/meson.build) | 0 | ||||
-rw-r--r-- | test cases/failing/57 or on new line/meson_options.txt (renamed from test cases/failing/55 or on new line/meson_options.txt) | 0 |
3 files changed, 7 insertions, 0 deletions
diff --git a/mesonbuild/mparser.py b/mesonbuild/mparser.py index 75985c3..8400a1a 100644 --- a/mesonbuild/mparser.py +++ b/mesonbuild/mparser.py @@ -475,12 +475,18 @@ class Parser: def e2(self): left = self.e3() while self.accept('or'): + if isinstance(left, EmptyNode): + raise ParseException('Invalid or clause.', + self.getline(), left.lineno, left.colno) left = OrNode(left, self.e3()) return left def e3(self): left = self.e4() while self.accept('and'): + if isinstance(left, EmptyNode): + raise ParseException('Invalid and clause.', + self.getline(), left.lineno, left.colno) left = AndNode(left, self.e4()) return left @@ -633,6 +639,7 @@ class Parser: def ifblock(self): condition = self.statement() clause = IfClauseNode(condition.lineno, condition.colno) + self.expect('eol') block = self.codeblock() clause.ifs.append(IfNode(clause.lineno, clause.colno, condition, block)) self.elseifblock(clause) diff --git a/test cases/failing/55 or on new line/meson.build b/test cases/failing/57 or on new line/meson.build index 12f2705..12f2705 100644 --- a/test cases/failing/55 or on new line/meson.build +++ b/test cases/failing/57 or on new line/meson.build diff --git a/test cases/failing/55 or on new line/meson_options.txt b/test cases/failing/57 or on new line/meson_options.txt index 3302cf4..3302cf4 100644 --- a/test cases/failing/55 or on new line/meson_options.txt +++ b/test cases/failing/57 or on new line/meson_options.txt |