summary refs log tree commit diff
path: root/grammar.ebnf
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2025-01-21 00:18:29 +0100
committerBaitinq <manuelpalenzuelamerino@gmail.com>2025-01-21 00:18:29 +0100
commitace95945deccfbea0214e1387de8c2806cd9de82 (patch)
tree50f0813d95bcce41636130ab82cf3b6a501a48c7 /grammar.ebnf
parentParser: Make additive expression left associative (diff)
downloadinterpreter-ace95945deccfbea0214e1387de8c2806cd9de82.tar.gz
interpreter-ace95945deccfbea0214e1387de8c2806cd9de82.tar.bz2
interpreter-ace95945deccfbea0214e1387de8c2806cd9de82.zip
Parser: Add support for parenthesis grouping
Diffstat (limited to 'grammar.ebnf')
-rw-r--r--grammar.ebnf4
1 files changed, 2 insertions, 2 deletions
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