summaryrefslogtreecommitdiff
path: root/grammar.bnf
diff options
context:
space:
mode:
authorGravatar Uko Kokņevičs2024-08-18 23:45:38 +0800
committerGravatar Uko Kokņevičs2024-08-18 23:45:38 +0800
commitb9c7fbf5e06630076b93cace17863a6d36125e0d (patch)
treee23114ae41cab50d12a51f035f5bacdd239e19ed /grammar.bnf
parentSome more modularisation (diff)
downloadorang-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.bnf5
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
3program ::= (statement ';'?)*; 3program ::= (statement ';'?)*;
4statement ::= definition | expression; 4statement ::= definition | expression;
5definition ::= 'def' def-spec '=' expression; 5definition ::= 'def' def-spec '=' expression
6 | 'def' '_' '=' expression;
6def-spec ::= IDENTIFIER arg-spec*; 7def-spec ::= IDENTIFIER arg-spec*;
7arg-spec ::= IDENTIFIER | '(' ')'; 8arg-spec ::= IDENTIFIER | '(' ')' | '_';
8expression ::= binary-expression | unary-expression; 9expression ::= binary-expression | unary-expression;
9unary-expression ::= unop+ simple-expression; 10unary-expression ::= unop+ simple-expression;
10binary-expression ::= call-expression (binop call-expression)*; 11binary-expression ::= call-expression (binop call-expression)*;