summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--match.c3
-rw-r--r--tests/008/call.expected2
-rw-r--r--tests/008/call.txr13
3 files changed, 17 insertions, 1 deletions
diff --git a/match.c b/match.c
index 1010062d..9782c937 100644
--- a/match.c
+++ b/match.c
@@ -4516,7 +4516,8 @@ static val v_call(match_files_ctx *c)
if (ret == decline_k)
sem_error(nil, lit("call: function ~s not found"), funval, nao);
- return cons(ctx.bindings, if3(ctx.data, cons(ctx.data, ctx.data_lineno), t));
+ c->bindings = ctx.bindings;
+ return ret;
}
static val h_do(match_line_ctx *c)
diff --git a/tests/008/call.expected b/tests/008/call.expected
new file mode 100644
index 00000000..f644dfc5
--- /dev/null
+++ b/tests/008/call.expected
@@ -0,0 +1,2 @@
+correct
+1
diff --git a/tests/008/call.txr b/tests/008/call.txr
new file mode 100644
index 00000000..0cbb39f6
--- /dev/null
+++ b/tests/008/call.txr
@@ -0,0 +1,13 @@
+@(next :list '("1"))
+@(define match1 (A))
+@ (all)
+1
+@ (and)
+@A
+@ (end)
+@(end)
+@(call 'match1 A)
+@(output)
+correct
+@A
+@(end)