diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-12-18 06:57:15 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-12-18 06:57:15 -0800 |
commit | 5a7197d76cde55d728dd881a37fc23703104b18e (patch) | |
tree | 4d9068206a55478e1e56d0e562948ea9f01884c5 /match.c | |
parent | 9e7cb4f19473571d76bf4b7b5ddc772ef8375a4e (diff) | |
download | txr-5a7197d76cde55d728dd881a37fc23703104b18e.tar.gz txr-5a7197d76cde55d728dd881a37fc23703104b18e.tar.bz2 txr-5a7197d76cde55d728dd881a37fc23703104b18e.zip |
debugger: stopped at line nil of nil.
Address some situations in which the debug_check call is given
a piece of spec with no source loc information attached.
* (h_var): Use rlcp when constructing new piece of spec
representing a substituted variable, or a spec confined
to just search for a piece of text with no trailing match.
(do_match_line): Pass the whole specline to debug_check,
rather than just the elem, which might just be a string
with no location info attached.
(match_files): Likewise.
Diffstat (limited to 'match.c')
-rw-r--r-- | match.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -692,11 +692,12 @@ static val h_var(match_line_ctx *c) } else { /* Re-generate a new spec in which the next variable is replaced by its value, and repeat. */ - c->specline = cons(elem, cons(cdr(pair), rest(c->specline))); + val r = rest(c->specline); + c->specline = rlcp(cons(elem, rlcp(cons(cdr(pair), r), r)), r); return repeat_spec_k; } } else if (op == text_s) { - val text_only_spec = cons(next, nil); + val text_only_spec = rlcp(cons(next, nil), next); val find = search_match(c, modifier, text_only_spec); val fpos = car(find); if (!find) { @@ -1254,7 +1255,7 @@ static val do_match_line(match_line_ctx *c) elem = first(c->specline); - debug_check(elem, c->bindings, c->dataline, c->data_lineno, + debug_check(c->specline, c->bindings, c->dataline, c->data_lineno, c->pos, c->base); switch (type(elem)) { @@ -3961,7 +3962,7 @@ repeat_spec_same_data: open_data_source(&c); - debug_check(first_spec, c.bindings, c.data, c.data_lineno, nil, nil); + debug_check(specline, c.bindings, c.data, c.data_lineno, nil, nil); if (consp(first_spec) && !rest(specline)) { val sym = first(first_spec); |