summaryrefslogtreecommitdiffstats
path: root/match.c
diff options
context:
space:
mode:
Diffstat (limited to 'match.c')
-rw-r--r--match.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/match.c b/match.c
index 7f046fb0..1dafcbbe 100644
--- a/match.c
+++ b/match.c
@@ -2555,7 +2555,7 @@ static val v_accept_fail(match_files_ctx *c)
return nil;
}
-static val v_next(match_files_ctx *c)
+static val v_next_impl(match_files_ctx *c)
{
spec_bind (specline, first_spec, c->spec);
@@ -2746,6 +2746,27 @@ static val v_next(match_files_ctx *c)
}
}
+static val v_next(match_files_ctx *c)
+{
+ val result = nil;
+
+ uw_simple_catch_begin;
+
+ result = v_next_impl(c);
+
+ uw_unwind {
+ uw_frame_t *ex = uw_current_exit_point();
+ if (ex && ex->uw.type == UW_BLOCK && ex->bl.protocol == accept_s) {
+ set(vecref_l(ex->bl.result, one), cons(c->data, c->data_lineno));
+ set(vecref_l(ex->bl.result, two), nil);
+ }
+ }
+
+ uw_catch_end;
+
+ return result;
+}
+
static val v_parallel(match_files_ctx *c)
{
spec_bind (specline, first_spec, c->spec);