mirror of
https://github.com/DanilaFe/abacus
synced 2024-12-23 16:00:09 -08:00
Fix order of operations bug.
This commit is contained in:
parent
af1797f101
commit
e2f66386b2
|
@ -89,7 +89,7 @@ public class ShuntingYardParser implements Parser<Match<TokenType>>, PluginListe
|
||||||
if (!(otherMatchType == TokenType.OP || otherMatchType == TokenType.FUNCTION)) break;
|
if (!(otherMatchType == TokenType.OP || otherMatchType == TokenType.FUNCTION)) break;
|
||||||
|
|
||||||
if (otherMatchType == TokenType.OP) {
|
if (otherMatchType == TokenType.OP) {
|
||||||
int otherPrecedence = precedenceMap.get(match.getContent());
|
int otherPrecedence = precedenceMap.get(otherMatch.getContent());
|
||||||
if (otherPrecedence < precedence ||
|
if (otherPrecedence < precedence ||
|
||||||
(associativity == OperatorAssociativity.RIGHT && otherPrecedence == precedence)) {
|
(associativity == OperatorAssociativity.RIGHT && otherPrecedence == precedence)) {
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user