diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/NXP/Classes/Lexer.php | 4 | ||||
-rw-r--r-- | src/NXP/Classes/Token/TokenDegree.php | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/NXP/Classes/Lexer.php b/src/NXP/Classes/Lexer.php index b66ea87..e541732 100644 --- a/src/NXP/Classes/Lexer.php +++ b/src/NXP/Classes/Lexer.php @@ -99,13 +99,13 @@ class Lexer while ( count($stack) > 0 && ($stack[count($stack)-1] instanceof InterfaceOperator) && - ( + (( $token->getAssociation() == AbstractOperator::LEFT_ASSOC && $token->getPriority() <= $stack[count($stack)-1]->getPriority() ) || ( $token->getAssociation() == AbstractOperator::RIGHT_ASSOC && $token->getPriority() < $stack[count($stack)-1]->getPriority() - ) + )) ) { $output[] = array_pop($stack); } diff --git a/src/NXP/Classes/Token/TokenDegree.php b/src/NXP/Classes/Token/TokenDegree.php index 8488dcd..c31b66e 100644 --- a/src/NXP/Classes/Token/TokenDegree.php +++ b/src/NXP/Classes/Token/TokenDegree.php @@ -41,13 +41,13 @@ class TokenDegree extends AbstractOperator /** * @param InterfaceToken[] $stack - * @return $this + * @return TokenNumber */ public function execute(&$stack) { $op2 = array_pop($stack); $op1 = array_pop($stack); - $result = $op1->getValue() ^ $op2->getValue(); + $result = $op1->getValue() ** $op2->getValue(); return new TokenNumber($result); } |