Skip to content

Commit

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

0 comments on commit 14442ca

Please sign in to comment.