diff options
| author | Baitinq <[email protected]> | 2025-01-12 19:47:16 +0100 |
|---|---|---|
| committer | Baitinq <[email protected]> | 2025-01-12 19:47:32 +0100 |
| commit | b08960fa4f3e3c5c45a1b92ec80a82ad02d82c8c (patch) | |
| tree | 0f9355bd993c6863361bb643397c49140d4428a5 /grammar.ebnf | |
| parent | Evaluator: Store variables with value instead of reference (diff) | |
| download | interpreter-b08960fa4f3e3c5c45a1b92ec80a82ad02d82c8c.tar.gz interpreter-b08960fa4f3e3c5c45a1b92ec80a82ad02d82c8c.tar.bz2 interpreter-b08960fa4f3e3c5c45a1b92ec80a82ad02d82c8c.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 |