From 44ec5d5de6a558fc20b8452a1ee743b64d56e5e5 Mon Sep 17 00:00:00 2001 From: Baitinq Date: Sun, 19 Jan 2025 16:04:08 +0100 Subject: Feature: Add basic support for equality expression --- grammar.ebnf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'grammar.ebnf') 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)* - -- cgit 1.4.1