diff options
author | Baitinq <manuelpalenzuelamerino@gmail.com> | 2025-01-12 19:47:16 +0100 |
---|---|---|
committer | Baitinq <manuelpalenzuelamerino@gmail.com> | 2025-01-12 19:47:32 +0100 |
commit | a362ee47453e48b9b90eb225b555fd5e5cc5e465 (patch) | |
tree | 0f9355bd993c6863361bb643397c49140d4428a5 /grammar.ebnf | |
parent | Evaluator: Store variables with value instead of reference (diff) | |
download | interpreter-a362ee47453e48b9b90eb225b555fd5e5cc5e465.tar.gz interpreter-a362ee47453e48b9b90eb225b555fd5e5cc5e465.tar.bz2 interpreter-a362ee47453e48b9b90eb225b555fd5e5cc5e465.zip |
Implement "return"
Diffstat (limited to 'grammar.ebnf')
-rw-r--r-- | grammar.ebnf | 4 |
1 files changed, 3 insertions, 1 deletions
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 |