diff options
Diffstat (limited to 'grammar.bnf')
| -rw-r--r-- | grammar.bnf | 5 |
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 | ||
| 3 | program ::= (statement ';'?)*; | 3 | program ::= (statement ';'?)*; |
| 4 | statement ::= definition | expression; | 4 | statement ::= definition; |
| 5 | definition ::= 'def' def-spec '=' expression | 5 | definition ::= 'def' def-spec '=' expression |
| 6 | | 'def' '_' '=' expression; | 6 | | 'def' '_' '=' expression; |
| 7 | def-spec ::= IDENTIFIER arg-spec*; | 7 | def-spec ::= IDENTIFIER arg-spec*; |
| @@ -31,3 +31,6 @@ let-in-expression ::= 'let' def-spec '=' expression ('and' def-spec '=' expressi | |||
| 31 | fn-expression ::= 'fn' arg-spec+ '->' expression | 31 | fn-expression ::= 'fn' arg-spec+ '->' expression |
| 32 | | 'fn' arg-spec+ do-expression; | 32 | | 'fn' arg-spec+ do-expression; |
| 33 | do-expression ::= 'do' expression (';' expression)* 'end'; | 33 | do-expression ::= 'do' expression (';' expression)* 'end'; |
| 34 | |||
| 35 | repl-program ::= (repl-statement ';'?)* '\n'; // currently, hard-limited by the newline :sweat_smile: | ||
| 36 | repl-statement ::= statement | expression; \ No newline at end of file | ||