Skip to content

Commit

Permalink
Resolve subtraction with NAN to NAN during operator strength reductio…
Browse files Browse the repository at this point in the history
…n (address #16)
  • Loading branch information
Muqsit committed Nov 3, 2022
1 parent 03440ab commit b9dd31e
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ private function processBinaryExpression(Parser $parser, Expression $expression,
new FunctionCallExpressionToken(Util::positionContainingExpressionTokens($right), $m_op->getSymbol(), 2, $m_op->getOperator(), $m_op->isDeterministic(), $m_op->isCommutative(), new BinaryOperatorToken($token->getPos(), $m_op->getSymbol()))
],
$this->valueEquals($right, 0) => $left,
$this->valueIsNan($left), $this->valueIsNan($right) => [new NumericLiteralExpressionToken(Util::positionContainingExpressionTokens([...$left, ...$right]), NAN)],
default => $this->processSubtraction($parser, $operator_token, $left, $right)
},
default => null
Expand Down

0 comments on commit b9dd31e

Please sign in to comment.