diff options
| author | 2024-08-18 23:45:38 +0800 | |
|---|---|---|
| committer | 2024-08-18 23:45:38 +0800 | |
| commit | b9c7fbf5e06630076b93cace17863a6d36125e0d (patch) | |
| tree | e23114ae41cab50d12a51f035f5bacdd239e19ed /grammar.bnf | |
| parent | Some more modularisation (diff) | |
| download | orang-b9c7fbf5e06630076b93cace17863a6d36125e0d.tar.gz orang-b9c7fbf5e06630076b93cace17863a6d36125e0d.tar.xz orang-b9c7fbf5e06630076b93cace17863a6d36125e0d.zip | |
Added explicit ignored/"underscore" arguments & top-level defs
Diffstat (limited to 'grammar.bnf')
| -rw-r--r-- | grammar.bnf | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/grammar.bnf b/grammar.bnf index 9ddaffc..0ac58f9 100644 --- a/grammar.bnf +++ b/grammar.bnf | |||
| @@ -2,9 +2,10 @@ | |||
| 2 | 2 | ||
| 3 | program ::= (statement ';'?)*; | 3 | program ::= (statement ';'?)*; |
| 4 | statement ::= definition | expression; | 4 | statement ::= definition | expression; |
| 5 | definition ::= 'def' def-spec '=' expression; | 5 | definition ::= 'def' def-spec '=' expression |
| 6 | | 'def' '_' '=' expression; | ||
| 6 | def-spec ::= IDENTIFIER arg-spec*; | 7 | def-spec ::= IDENTIFIER arg-spec*; |
| 7 | arg-spec ::= IDENTIFIER | '(' ')'; | 8 | arg-spec ::= IDENTIFIER | '(' ')' | '_'; |
| 8 | expression ::= binary-expression | unary-expression; | 9 | expression ::= binary-expression | unary-expression; |
| 9 | unary-expression ::= unop+ simple-expression; | 10 | unary-expression ::= unop+ simple-expression; |
| 10 | binary-expression ::= call-expression (binop call-expression)*; | 11 | binary-expression ::= call-expression (binop call-expression)*; |