Skip to content

Commit 62d7da3

Browse files
authored
TASK: Cleanup ExpressionNode.php
The additions that here from #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 #10 either way, it works as it is, just not super clean, thats why i removed the duplicate logic.
1 parent 279738d commit 62d7da3

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/Parser/Ast/ExpressionNode.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,8 @@ public static function fromTokens(\Iterator &$tokens, Precedence $precedence = P
123123
}
124124

125125
Scanner::skipSpaceAndComments($tokens);
126-
if (Scanner::isEnd($tokens) || $precedence->mustStopAt(Scanner::type($tokens))) {
127-
return new self(
128-
root: $root
129-
);
130-
}
131126

132127
while (!Scanner::isEnd($tokens) && !$precedence->mustStopAt(Scanner::type($tokens))) {
133-
Scanner::skipSpaceAndComments($tokens);
134128
switch (Scanner::type($tokens)) {
135129
case TokenType::OPERATOR_BOOLEAN_AND:
136130
case TokenType::OPERATOR_BOOLEAN_OR:

0 commit comments

Comments
 (0)