summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--parser.y16
1 files changed, 16 insertions, 0 deletions
diff --git a/parser.y b/parser.y
index 5cc2640f..2b9732c0 100644
--- a/parser.y
+++ b/parser.y
@@ -319,9 +319,20 @@ FuncDef:
$7);
jv_free($2);
jv_free($4);
+} |
+
+"def" IDENT '(' IDENT ';' IDENT ')' ':' Exp ';' {
+ $$ = gen_function(jv_string_value($2),
+ BLOCK(gen_op_block_unbound(CLOSURE_PARAM, jv_string_value($4)),
+ gen_op_block_unbound(CLOSURE_PARAM, jv_string_value($6))),
+ $9);
+ jv_free($2);
+ jv_free($4);
+ jv_free($6);
}
+
String:
QQSTRING_START { $<literal>$ = jv_string("text"); } QQString QQSTRING_END {
$$ = $3;
@@ -414,6 +425,11 @@ IDENT '(' Exp ')' {
$$ = gen_location(@1, $$);
jv_free($1);
} |
+IDENT '(' Exp ';' Exp ')' {
+ $$ = gen_call(jv_string_value($1), BLOCK(gen_lambda($3), gen_lambda($5)));
+ $$ = gen_location(@1, $$);
+ jv_free($1);
+} |
'(' error ')' { $$ = gen_noop(); } |
'[' error ']' { $$ = gen_noop(); } |
Term '[' error ']' { $$ = $1; } |