summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2012-02-24 05:21:01 -0800
committerKaz Kylheku <kaz@kylheku.com>2012-02-24 05:21:01 -0800
commit09bec4f655754f06ecea62cd939339a793a60719 (patch)
treef3eb1a357e2973155cce1e1a365287f329081a04
parent14d2705663eabf00c467c13aecd80c8835ce2a71 (diff)
downloadtxr-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.
-rw-r--r--ChangeLog5
-rw-r--r--match.c16
2 files changed, 9 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 1404dfbd..009b8fa5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2012-02-24 Kaz Kylheku <kaz@kylheku.com>
+ * match.c (h_var): Eliminated uses of rl function, in favor of
+ rlcp. Only the parser should use rl to establish location info.
+
+2012-02-24 Kaz Kylheku <kaz@kylheku.com>
+
First cut at @(load) directive. Incomplete: debug location info
needs to record file name, not only line number; absolute paths
not handled, etc.
diff --git a/match.c b/match.c
index cf674eaf..5f6e6ecc 100644
--- a/match.c
+++ b/match.c
@@ -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) {