summaryrefslogtreecommitdiffstats
path: root/match.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2011-11-30 16:12:46 -0800
committerKaz Kylheku <kaz@kylheku.com>2011-11-30 16:12:46 -0800
commit3d6cbdfd5e29a48da30493d98e9653d5eebbd9f5 (patch)
tree15a00ed0a7299c15910b2d0bae4d2a2deae5dd20 /match.c
parentc6d7aca5df641e419f5b74d14b463901d63fc1f2 (diff)
downloadtxr-3d6cbdfd5e29a48da30493d98e9653d5eebbd9f5.tar.gz
txr-3d6cbdfd5e29a48da30493d98e9653d5eebbd9f5.tar.bz2
txr-3d6cbdfd5e29a48da30493d98e9653d5eebbd9f5.zip
* lib.h (or2): Restore macro version of or2, because we need
the sequencing! Making it an inline function broke the tests. But we can't have multiple evaluation either, so it's going to use a temporary lexical variable. (uses_or2): Macro which declares the lexical variable needed by or2. * debug.c (debug): add uses_or2. * eval.c (eval_intrinsic, op_modplace): Likewise. * lib.c (lazy_str, lazy_str_force_upto, lazy_str_get_trailing_list): Likewise. * match.c (h_parallel, v_freeform, v_parallel, v_output): Likewise. * parser.y (unquotes_occur): Likewise. * stream.c (format): Likewise.
Diffstat (limited to 'match.c')
-rw-r--r--match.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/match.c b/match.c
index ad3d56cc..13122651 100644
--- a/match.c
+++ b/match.c
@@ -850,6 +850,7 @@ next_coll:
static val h_parallel(match_line_ctx c, match_line_ctx *cout)
{
+ uses_or2;
elem_bind(elem, directive, c.specline);
val specs = third(elem);
val plist = fourth(elem);
@@ -1806,6 +1807,7 @@ static val v_freeform(match_files_ctx *c)
debuglf(specline, lit("freeform match failure: no data"), nao);
return nil;
} else {
+ uses_or2;
val limit = or2(if2(nump(first(vals)), first(vals)),
if2(nump(second(vals)), second(vals)));
val term = or2(if2(stringp(first(vals)), first(vals)),
@@ -2035,6 +2037,7 @@ static val v_parallel(match_files_ctx *c)
if (second(first_spec) == t) {
return decline_k;
} else {
+ uses_or2;
val sym = first(first_spec);
val all_match = t;
val some_match = nil;
@@ -2641,6 +2644,7 @@ static val v_output(match_files_ctx *c)
if (rest(dest_spec))
sem_error(specline, lit("material after :nothrow in output"), nao);
} else if (!keywordp(first(dest_spec))) {
+ uses_or2;
val form = first(dest_spec);
val val = eval_form(specline, form, c->bindings);
dest = or2(cdr(val), dest);