aboutsummaryrefslogtreecommitdiff
path: root/src/NXP
diff options
context:
space:
mode:
authorochi51 <ochiai07@gmail.com>2017-09-12 14:47:22 +0300
committerochi51 <ochiai07@gmail.com>2017-09-12 14:47:22 +0300
commit1086fccc92e0800c873baf69fc3256008b883691 (patch)
treee60a37d723aef381ba15a6ca754797445a40c853 /src/NXP
parent3436e0a51ff4c709226178f897e053c0fae8da4c (diff)
Bug fixes about "Undefined offset -1" if stack is empty array and token association is RIGHT_ASSOC
Diffstat (limited to 'src/NXP')
-rw-r--r--src/NXP/Classes/Lexer.php4
1 files changed, 2 insertions, 2 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);
}