Парсинг выражений со скобками
This commit is contained in:
parent
3f5f8bca46
commit
e728a91ff5
@ -535,6 +535,11 @@ public final class Parser {
|
||||
if (match(current, TokenType.WORD)) {
|
||||
return new VariableExpression(current.getText());
|
||||
}
|
||||
if (match(current, TokenType.LPAREN)) {
|
||||
Expression expr = expression();
|
||||
match(TokenType.RPAREN);
|
||||
return expr;
|
||||
}
|
||||
throw new RuntimeException();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user