diff --git a/blueprintcompiler/parse_tree.py b/blueprintcompiler/parse_tree.py index 338f24b..e56a220 100644 --- a/blueprintcompiler/parse_tree.py +++ b/blueprintcompiler/parse_tree.py @@ -371,6 +371,9 @@ class Until(ParseNode): def _parse(self, ctx): while not self.delimiter.parse(ctx).succeeded(): + if ctx.is_eof(): + return False + try: if not self.child.parse(ctx).matched(): ctx.skip_unexpected_token() @@ -378,9 +381,6 @@ class Until(ParseNode): ctx.errors.append(e) ctx.next_token() - if ctx.is_eof(): - return True - return True