Skip to content

Commit

Permalink
reset the internal state when the parser is finished
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed May 31, 2020
1 parent f8344b9 commit 6675d93
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ private function doParse(TokenStream $stream, ?array $names = []): Node\Node
throw new SyntaxError(sprintf('Unexpected token "%s" of value "%s".', $stream->current->type, $stream->current->value), $stream->current->cursor, $stream->getExpression());
}

$this->stream = null;
$this->names = null;

return $node;
}

Expand Down

0 comments on commit 6675d93

Please sign in to comment.