mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Fix crash in parser
The Until parse node would return True if it reached EOF, which was not correct and could cause other parse nodes to run past the end of the token list and crash.
This commit is contained in:
parent
417f163a5a
commit
e76bff9291
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue