From a362ee47453e48b9b90eb225b555fd5e5cc5e465 Mon Sep 17 00:00:00 2001 From: Baitinq Date: Sun, 12 Jan 2025 19:47:16 +0100 Subject: Implement "return" --- grammar.ebnf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'grammar.ebnf') diff --git a/grammar.ebnf b/grammar.ebnf index 1ac139e..5340ba4 100644 --- a/grammar.ebnf +++ b/grammar.ebnf @@ -1,9 +1,11 @@ Program ::= Statement+ -Statement ::= (VariableStatement | PrintStatement) SEMICOLON +Statement ::= (VariableStatement | PrintStatement | ReturnStatement) SEMICOLON VariableStatement ::= ("let" IDENTIFIER | IDENTIFIER) EQUALS Expression PrintStatement :== PRINT LPAREN Expression RPAREN +ReturnStatement :== RETURN Expression + Expression :== NUMBER | IDENTIFIER | Expression + Expression -- cgit 1.4.1