mirror of
https://github.com/ChronosX88/old-java-education-stuff.git
synced 2024-11-21 15:52:18 +00:00
Fix bug when minus op which goes after right parenthesis detected as part of number
This commit is contained in:
parent
29fd0e58eb
commit
c8ff935d97
@ -51,18 +51,22 @@ public class Main {
|
||||
}
|
||||
case '+': {
|
||||
token = new Token(TokenType.Operator, OperatorType.Add);
|
||||
isLastCharOperator = true;
|
||||
break;
|
||||
}
|
||||
case '-': {
|
||||
token = new Token(TokenType.Operator, OperatorType.Sub);
|
||||
isLastCharOperator = true;
|
||||
break;
|
||||
}
|
||||
case '*': {
|
||||
token = new Token(TokenType.Operator, OperatorType.Mul);
|
||||
isLastCharOperator = true;
|
||||
break;
|
||||
}
|
||||
case '/': {
|
||||
token = new Token(TokenType.Operator, OperatorType.Div);
|
||||
isLastCharOperator = true;
|
||||
break;
|
||||
}
|
||||
case ')': {
|
||||
@ -70,7 +74,6 @@ public class Main {
|
||||
break;
|
||||
}
|
||||
}
|
||||
isLastCharOperator = true;
|
||||
}
|
||||
tokens.add(token);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user