summary refs log tree commit diff
path: root/grammar.ebnf
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2025-01-12 19:47:16 +0100
committerBaitinq <manuelpalenzuelamerino@gmail.com>2025-01-12 19:47:32 +0100
commita362ee47453e48b9b90eb225b555fd5e5cc5e465 (patch)
tree0f9355bd993c6863361bb643397c49140d4428a5 /grammar.ebnf
parentEvaluator: Store variables with value instead of reference (diff)
downloadinterpreter-a362ee47453e48b9b90eb225b555fd5e5cc5e465.tar.gz
interpreter-a362ee47453e48b9b90eb225b555fd5e5cc5e465.tar.bz2
interpreter-a362ee47453e48b9b90eb225b555fd5e5cc5e465.zip
Implement "return"
Diffstat (limited to 'grammar.ebnf')
-rw-r--r--grammar.ebnf4
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