From e2f66386b241a874f0612504ac42cfc5ba278f9e Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Thu, 3 Aug 2017 13:14:09 -0700 Subject: [PATCH] Fix order of operations bug. --- src/main/java/org/nwapw/abacus/parsing/ShuntingYardParser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/nwapw/abacus/parsing/ShuntingYardParser.java b/src/main/java/org/nwapw/abacus/parsing/ShuntingYardParser.java index 598c1e8..61d76e4 100644 --- a/src/main/java/org/nwapw/abacus/parsing/ShuntingYardParser.java +++ b/src/main/java/org/nwapw/abacus/parsing/ShuntingYardParser.java @@ -89,7 +89,7 @@ public class ShuntingYardParser implements Parser>, PluginListe if (!(otherMatchType == TokenType.OP || otherMatchType == TokenType.FUNCTION)) break; if (otherMatchType == TokenType.OP) { - int otherPrecedence = precedenceMap.get(match.getContent()); + int otherPrecedence = precedenceMap.get(otherMatch.getContent()); if (otherPrecedence < precedence || (associativity == OperatorAssociativity.RIGHT && otherPrecedence == precedence)) { break;