From 267a20b4c57f13ccbf89e54469c8dcb5ad09b631 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 25 Feb 2012 03:52:49 -0800 Subject: * 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. --- ChangeLog | 9 +++++++++ match.c | 7 ++++--- parser.y | 10 +--------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8633ed6e..d0356f49 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2012-02-25 Kaz Kylheku + + * 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. + 2012-02-24 Kaz Kylheku * debug.c (debug): Use new way of getting line number. diff --git a/match.c b/match.c index cbb74e3a..08281050 100644 --- a/match.c +++ b/match.c @@ -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(); diff --git a/parser.y b/parser.y index 49705100..98f408a5 100644 --- a/parser.y +++ b/parser.y @@ -141,15 +141,7 @@ clause : all_clause { $$ = list($1, nao); rlcp($$, $1); } rlcp($$, $1); } | try_clause { $$ = list($1, nao); rlcp($$, $1); } | output_clause { $$ = list($1, nao); rlcp($$, $1); } - | line { val elem = car($1); - - if (consp(elem) && car(elem) == load_s) - { elem = rlcp(cons(load_s, - cons(spec_file_str, - cdr(elem))), elem); - $$ = rlcp(cons(elem, cdr($1)), $1); } - else - { $$ = $1; } } + | line { $$ = $1; } | repeat_clause { $$ = nil; yyerror("repeat outside of output"); } ; -- cgit v1.2.3