From 62d7da3c8771ef35a44a3e1c48fbd5c4cd632f60 Mon Sep 17 00:00:00 2001 From: Marc Henry Schultz <85400359+mhsdesign@users.noreply.github.com> Date: Sun, 6 Aug 2023 12:48:56 +0200 Subject: [PATCH] TASK: Cleanup ExpressionNode.php The additions that here from https://github.com/PackageFactory/PackageFactory.ComponentEngine/pull/18 are not necessary. The condition is also handled by the "while" loop and later comes the return. I think i messed stuff up because the partial fix belongs to https://github.com/PackageFactory/PackageFactory.ComponentEngine/pull/10 either way, it works as it is, just not super clean, thats why i removed the duplicate logic. --- src/Parser/Ast/ExpressionNode.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/Parser/Ast/ExpressionNode.php b/src/Parser/Ast/ExpressionNode.php index d8437c1d..2aa16b05 100644 --- a/src/Parser/Ast/ExpressionNode.php +++ b/src/Parser/Ast/ExpressionNode.php @@ -123,14 +123,8 @@ public static function fromTokens(\Iterator &$tokens, Precedence $precedence = P } Scanner::skipSpaceAndComments($tokens); - if (Scanner::isEnd($tokens) || $precedence->mustStopAt(Scanner::type($tokens))) { - return new self( - root: $root - ); - } while (!Scanner::isEnd($tokens) && !$precedence->mustStopAt(Scanner::type($tokens))) { - Scanner::skipSpaceAndComments($tokens); switch (Scanner::type($tokens)) { case TokenType::OPERATOR_BOOLEAN_AND: case TokenType::OPERATOR_BOOLEAN_OR: