From 79ded04ec6834ad28f23f9db0f205689deda467d Mon Sep 17 00:00:00 2001 From: olim Date: Thu, 25 Apr 2024 11:45:23 +0100 Subject: be more lenient with brackets --- src/main/java/de/hysky/skyblocker/utils/Calculator.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/hysky/skyblocker/utils/Calculator.java b/src/main/java/de/hysky/skyblocker/utils/Calculator.java index fb2b8b11..c8dcb6d8 100644 --- a/src/main/java/de/hysky/skyblocker/utils/Calculator.java +++ b/src/main/java/de/hysky/skyblocker/utils/Calculator.java @@ -132,7 +132,8 @@ public class Calculator { while (!operatorStack.isEmpty()) { Token leftToken = operatorStack.pop(); if (leftToken.type == TokenType.L_PARENTHESIS) { - throw new UnsupportedOperationException("Unbalanced left parenthesis"); + //technically unbalanced left parenthesis error but just assume they are close after the equation and ignore them from here + continue; } outputQueue.add(leftToken); } -- cgit