diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | match.c | 7 | ||||
-rw-r--r-- | parser.y | 10 |
3 files changed, 14 insertions, 12 deletions
@@ -1,3 +1,12 @@ +2012-02-25 Kaz Kylheku <kaz@kylheku.com> + + * 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 <kaz@kylheku.com> * debug.c (debug): Use new way of getting line number. @@ -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(); @@ -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"); } ; |