diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2012-02-24 05:21:01 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2012-02-24 05:21:01 -0800 |
commit | 09bec4f655754f06ecea62cd939339a793a60719 (patch) | |
tree | f3eb1a357e2973155cce1e1a365287f329081a04 /match.c | |
parent | 14d2705663eabf00c467c13aecd80c8835ce2a71 (diff) | |
download | txr-09bec4f655754f06ecea62cd939339a793a60719.tar.gz txr-09bec4f655754f06ecea62cd939339a793a60719.tar.bz2 txr-09bec4f655754f06ecea62cd939339a793a60719.zip |
* match.c (h_var): Eliminated uses of rl function, in favor of
rlcp. Only the parser should use rl to establish location info.
Diffstat (limited to 'match.c')
-rw-r--r-- | match.c | 16 |
1 files changed, 4 insertions, 12 deletions
@@ -473,9 +473,7 @@ static val h_var(match_line_ctx *c) and it must be transformed into (<sym-substituted> <pat> ...) */ if (pat) { - val loc = source_loc(c->specline); - c->specline = cons(cdr(pair), cons(pat, rest(c->specline))); - rl(car(c->specline), loc); + c->specline = rlcp(cons(cdr(pair), cons(pat, rest(c->specline))), c->specline); } else if (fixnump(modifier)) { val past = plus(c->pos, modifier); @@ -496,9 +494,7 @@ static val h_var(match_line_ctx *c) c->pos = past; c->specline = cdr(c->specline); } else { - val loc = source_loc(c->specline); - c->specline = cons(cdr(pair), rest(c->specline)); - rl(car(c->specline), loc); + c->specline = rlcp(cons(cdr(pair), rest(c->specline)), c->specline); } return repeat_spec_k; } else if (consp(modifier)) { /* var bound over text matched by form */ @@ -515,9 +511,7 @@ static val h_var(match_line_ctx *c) c->pos = new_pos; /* This may have another variable attached */ if (pat) { - val loc = source_loc(c->specline); - c->specline = cons(pat, rest(c->specline)); - rl(car(c->specline), loc); + c->specline = rlcp(cons(pat, rest(c->specline)), c->specline); return repeat_spec_k; } } else if (fixnump(modifier)) { /* fixed field */ @@ -596,9 +590,7 @@ static val h_var(match_line_ctx *c) LOG_MATCH("double var regex (second var)", plus(fpos, flen)); c->pos = plus(fpos, flen); if (next_pat) { - val loc = source_loc(c->specline); - c->specline = cons(next_pat, rest(c->specline)); - rl(car(c->specline), loc); + c->specline = rlcp(cons(next_pat, rest(c->specline)), c->specline); return repeat_spec_k; } } else if (!pair) { |