diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2012-02-25 03:52:49 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2012-02-25 03:52:49 -0800 |
commit | 267a20b4c57f13ccbf89e54469c8dcb5ad09b631 (patch) | |
tree | 45fb5aa220f54066640c4c8345b4f70a7d303d1e /match.c | |
parent | 3fdecca05ea781c592d5acf0c3610f3a2be31706 (diff) | |
download | txr-267a20b4c57f13ccbf89e54469c8dcb5ad09b631.tar.gz txr-267a20b4c57f13ccbf89e54469c8dcb5ad09b631.tar.bz2 txr-267a20b4c57f13ccbf89e54469c8dcb5ad09b631.zip |
* parser.y (clause): "Doh" moment. We don't need the special
transformation of the load syntax because the parent location
is already associated with the syntax.
* match.c (v_load): Pull out source location info from
the form itself.
Diffstat (limited to 'match.c')
-rw-r--r-- | match.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -3366,10 +3366,11 @@ static val v_do(match_files_ctx *c) static val v_load(match_files_ctx *c) { + uses_or2; spec_bind (specline, first_spec, c->spec); val args = rest(first_spec); - val parent = first(args); - val target = txeval(specline, second(args), c->bindings); + val parent = or2(cdr(source_loc(specline)), null_string); + val target = txeval(specline, first(args), c->bindings); if (rest(specline)) sem_error(specline, lit("unexpected material after load"), nao); @@ -3385,7 +3386,7 @@ static val v_load(match_files_ctx *c) target, cat_str(nappend2(sub_list(split_str(parent, lit("/")), zero, negone), - cons(target, nil)), lit("/"))); + cons(target, nil)), lit("/"))); int gc = gc_state(0); parse_reset(path); yyparse(); |