From d58eb020d0739203831099dd43236510fd6470ab Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sun, 31 May 2020 09:33:39 +0200 Subject: [PATCH] reset the internal state when the parser is finished --- src/Symfony/Component/ExpressionLanguage/Parser.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Symfony/Component/ExpressionLanguage/Parser.php b/src/Symfony/Component/ExpressionLanguage/Parser.php index 34658b97c0c0..fb9c321c4b9f 100644 --- a/src/Symfony/Component/ExpressionLanguage/Parser.php +++ b/src/Symfony/Component/ExpressionLanguage/Parser.php @@ -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; }