From adf96f4b69439b09ef5c1dfcba7884a8e606bc5b Mon Sep 17 00:00:00 2001 From: TENMAJKL Date: Wed, 6 Sep 2023 20:41:44 +0200 Subject: [PATCH] fixes infix parsing --- src/Parser.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Parser.php b/src/Parser.php index f2407a4..4f2bc02 100644 --- a/src/Parser.php +++ b/src/Parser.php @@ -32,7 +32,9 @@ public function parse(TokenKind $end = null): Group $node->right = $this->parseFragment(); $stack->push($node); $this->stream->next(); - continue; + if ($this->stream->curent()?->kind === $end) { + break; + } } $stack->push($this->parseFragment()); $this->stream->next();