Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions PrimaryExp.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ static AstNode parsePrimary(ExpParser parser, boolean isInsideParenthesis) throw
if (parser.isEnd()) { // Opening parenthesis can't stay at the end of the string
throw new ExpressionFormatException("Wrong opening parenthesis detected");
}
else if (parser.getLast().equals(OPCODES[1])) { // If next is ")" - exception
throw new ExpressionFormatException("Empty parentheses detected");
}
// Parse subexpression from the top operations
res = LogicalExp.parseLogical(parser, true);
if (!parser.getLast().equals(OPCODES[1])) { // If next is not ")" - exception
Expand Down