summaryrefslogtreecommitdiff
path: root/grammar.bnf
diff options
context:
space:
mode:
Diffstat (limited to 'grammar.bnf')
-rw-r--r--grammar.bnf5
1 files changed, 4 insertions, 1 deletions
diff --git a/grammar.bnf b/grammar.bnf
index 0ac58f9..a9e21cb 100644
--- a/grammar.bnf
+++ b/grammar.bnf
@@ -1,7 +1,7 @@
1// Comments are introduced by # and terminated by newline 1// Comments are introduced by # and terminated by newline
2 2
3program ::= (statement ';'?)*; 3program ::= (statement ';'?)*;
4statement ::= definition | expression; 4statement ::= definition;
5definition ::= 'def' def-spec '=' expression 5definition ::= 'def' def-spec '=' expression
6 | 'def' '_' '=' expression; 6 | 'def' '_' '=' expression;
7def-spec ::= IDENTIFIER arg-spec*; 7def-spec ::= IDENTIFIER arg-spec*;
@@ -31,3 +31,6 @@ let-in-expression ::= 'let' def-spec '=' expression ('and' def-spec '=' expressi
31fn-expression ::= 'fn' arg-spec+ '->' expression 31fn-expression ::= 'fn' arg-spec+ '->' expression
32 | 'fn' arg-spec+ do-expression; 32 | 'fn' arg-spec+ do-expression;
33do-expression ::= 'do' expression (';' expression)* 'end'; 33do-expression ::= 'do' expression (';' expression)* 'end';
34
35repl-program ::= (repl-statement ';'?)* '\n'; // currently, hard-limited by the newline :sweat_smile:
36repl-statement ::= statement | expression; \ No newline at end of file