Skip to content

Commit

Permalink
Resolve addition with NAN to NAN during operator strength reduction (…
Browse files Browse the repository at this point in the history
…address #16)
  • Loading branch information
Muqsit committed Nov 3, 2022
1 parent b9dd31e commit 3c9b8a0
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ private function processBinaryExpression(Parser $parser, Expression $expression,
"+" => match(true){
$this->valueEquals($left, 0) => $right,
$this->valueEquals($right, 0) => $left,
$this->valueIsNan($left), $this->valueIsNan($right) => [new NumericLiteralExpressionToken(Util::positionContainingExpressionTokens([...$left, ...$right]), NAN)],
default => $this->processAddition($parser, $operator_token, $left, $right)
},
"-" => match(true){
Expand Down

0 comments on commit 3c9b8a0

Please sign in to comment.