summaryrefslogtreecommitdiffstats
path: root/parser.y
diff options
context:
space:
mode:
authorStephen Dolan <mu@netsoc.tcd.ie>2012-11-26 01:36:55 +0000
committerStephen Dolan <mu@netsoc.tcd.ie>2012-11-26 01:36:55 +0000
commit4747f8681b3442af8b7916ac5bdfec712662c49b (patch)
tree0d1ba536855389ac1059f1cc89e23074bd03a292 /parser.y
parent3e3fe5195947a0af711959e2dedc9c84a697c5fb (diff)
Transparent handling for CBV arguments to C functions.
C function arguments closures are inlined before the call.
Diffstat (limited to 'parser.y')
-rw-r--r--parser.y12
1 files changed, 4 insertions, 8 deletions
diff --git a/parser.y b/parser.y
index e8cbf6d8..92d6f7cd 100644
--- a/parser.y
+++ b/parser.y
@@ -152,12 +152,11 @@ static block gen_binop(block a, block b, int op) {
}
assert(funcname);
- return BLOCK(gen_subexp(a), gen_subexp(b),
- gen_op_call(CALL_1_1, gen_op_block_unbound(CLOSURE_REF, funcname)));
+ return gen_call(funcname, BLOCK(gen_lambda(a), gen_lambda(b)));
}
static block gen_format(block a) {
- return BLOCK(a, gen_op_call(CALL_1_1, gen_op_block_unbound(CLOSURE_REF, "tostring")));
+ return BLOCK(a, gen_call("tostring", gen_noop()));
}
static block gen_update(block a, block op, int optype) {
@@ -386,14 +385,11 @@ String {
jv_free($2);
} |
IDENT {
- $$ = gen_location(@$, gen_op_call(CALL_1_1, gen_op_block_unbound(CLOSURE_REF, jv_string_value($1))));
+ $$ = gen_location(@$, gen_call(jv_string_value($1), gen_noop()));
jv_free($1);
} |
IDENT '(' Exp ')' {
- $$ = gen_op_call(CALL_1_1,
- block_join(gen_op_block_unbound(CLOSURE_REF, jv_string_value($1)),
- block_bind(gen_function("@lambda", $3),
- gen_noop(), OP_IS_CALL_PSEUDO)));
+ $$ = gen_call(jv_string_value($1), gen_lambda($3));
$$ = gen_location(@1, $$);
jv_free($1);
} |