From ace95945deccfbea0214e1387de8c2806cd9de82 Mon Sep 17 00:00:00 2001 From: Baitinq Date: Tue, 21 Jan 2025 00:18:29 +0100 Subject: Parser: Add support for parenthesis grouping --- grammar.ebnf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'grammar.ebnf') diff --git a/grammar.ebnf b/grammar.ebnf index b770797..a251f26 100644 --- a/grammar.ebnf +++ b/grammar.ebnf @@ -12,13 +12,13 @@ ReturnStatement ::= RETURN Expression FunctionArguments ::= Expression ("," Expression)* -Expression ::= EqualityExpression | AdditiveExpression | FunctionDefinition | LPAREN Expression RPAREN +Expression ::= EqualityExpression | AdditiveExpression | FunctionDefinition EqualityExpression ::= AdditiveExpression "==" AdditiveExpression AdditiveExpression ::= PrimaryExpression (("+" | "-") PrimaryExpression)* -PrimaryExpression ::= NUMBER | BOOLEAN | IDENTIFIER | FunctionCallStatement +PrimaryExpression ::= NUMBER | BOOLEAN | IDENTIFIER | FunctionCallStatement | LPAREN Expression RPAREN FunctionDefinition ::= LPAREN FunctionParamters? RPAREN ARROW LBRACE Statement* ReturnStatement SEMICOLON RBRACE -- cgit 1.4.1