summary refs log tree commit diff
path: root/grammar.ebnf
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2025-01-19 16:04:08 +0100
committerBaitinq <manuelpalenzuelamerino@gmail.com>2025-01-19 16:43:59 +0100
commit44ec5d5de6a558fc20b8452a1ee743b64d56e5e5 (patch)
treee6b3f445aa8578b2bcaa5de2d2d91214755230b9 /grammar.ebnf
parentFeature: Add support for boolean values (diff)
downloadinterpreter-44ec5d5de6a558fc20b8452a1ee743b64d56e5e5.tar.gz
interpreter-44ec5d5de6a558fc20b8452a1ee743b64d56e5e5.tar.bz2
interpreter-44ec5d5de6a558fc20b8452a1ee743b64d56e5e5.zip
Feature: Add basic support for equality expression
Diffstat (limited to 'grammar.ebnf')
-rw-r--r--grammar.ebnf7
1 files changed, 4 insertions, 3 deletions
diff --git a/grammar.ebnf b/grammar.ebnf
index eee1103..aaa0e78 100644
--- a/grammar.ebnf
+++ b/grammar.ebnf
@@ -12,13 +12,14 @@ ReturnStatement ::= RETURN Expression
 
 FunctionArguments ::= Expression ("," Expression)*
 
-Expression   ::= AdditiveExpression | FunctionDefinition
+Expression   ::= EqualityExpression | AdditiveExpression | FunctionDefinition
 
-AdditiveExpression ::= PrimaryExpression (("+" | "-") AdditiveExpression)
+EqualityExpression ::= AdditiveExpression "==" AdditiveExpression
+
+AdditiveExpression ::= PrimaryExpression (("+" | "-") AdditiveExpression)?
 
 PrimaryExpression ::= NUMBER | BOOLEAN | IDENTIFIER | FunctionCallStatement
 
 FunctionDefinition ::= LPAREN FunctionParamters? RPAREN ARROW LBRACE Statement* ReturnStatement SEMICOLON RBRACE
 
 FunctionParameters ::= IDENTIFIER ("," IDENTIFIER)*
-