diff options
Diffstat (limited to 'src/compile.c')
-rw-r--r-- | src/compile.c | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/src/compile.c b/src/compile.c index afd42aed..33a8e72c 100644 --- a/src/compile.c +++ b/src/compile.c @@ -823,32 +823,12 @@ static block bind_alternation_matchers(block matchers, block body) { block gen_reduce(block source, block matcher, block init, block body) { block res_var = gen_op_var_fresh(STOREV, "reduce"); - block update_var = gen_op_bound(STOREV, res_var); - block jmp = gen_op_targetlater(JUMP); - if (body.last == NULL) { - inst_set_target(jmp, jmp); - } else { - inst_set_target(jmp, body); - } block loop = BLOCK(gen_op_simple(DUPN), source, bind_alternation_matchers(matcher, BLOCK(gen_op_bound(LOADVN, res_var), - /* - * We fork to the body, jump to - * the STOREV. This means that - * if body produces no results - * (i.e., it just does empty) - * then we keep the current - * reduction state as-is. - * - * To break out of a - * reduction... use break. - */ - gen_op_target(FORK, jmp), - jmp, body, - update_var)), + gen_op_bound(STOREV, res_var))), gen_op_simple(BACKTRACK)); return BLOCK(gen_op_simple(DUP), init, |