diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2012-02-12 00:25:41 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2012-02-12 00:25:41 -0800 |
commit | 658d2d955629d7619098ac9568f329da55d8176d (patch) | |
tree | 72f2be016cb7a1668bc609223fa9362eacb974d5 /match.c | |
parent | fce7c87fa0099e5414607676fc73c9dfa9d7649c (diff) | |
download | txr-658d2d955629d7619098ac9568f329da55d8176d.tar.gz txr-658d2d955629d7619098ac9568f329da55d8176d.tar.bz2 txr-658d2d955629d7619098ac9568f329da55d8176d.zip |
Task #11486: continuation. Take into account base position
in debug reporting.
* debug.c (debug): New argument, base.
* debug.h (debug_check): New argument, base.
(debug): Declaration updated.
* eval.c (do_eval): Pass new argument of debug_check as nil.
* match.c (LOG_MISMATCH, LOG_MATCH): Take into account base
when displaying character position.
(do_match_line): Pass base position to debug_check.
(match_files): Pass nil as base to debug_check.
Diffstat (limited to 'match.c')
-rw-r--r-- | match.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -380,14 +380,14 @@ typedef val (*h_match_func)(match_line_ctx *c); #define LOG_MISMATCH(KIND) \ debuglf(elem, lit(KIND " mismatch, position ~a (~a:~a)"), \ - c->pos, c->file, c->data_lineno, nao); \ + plus(c->pos, c->base), c->file, c->data_lineno, nao); \ debuglf(elem, lit(" ~a"), c->dataline, nao); \ if (c_num(c->pos) < 77) \ debuglf(elem, lit(" ~*~a^"), c->pos, lit(""), nao) #define LOG_MATCH(KIND, EXTENT) \ debuglf(elem, lit(KIND " matched, position ~a-~a (~a:~a)"), \ - c->pos, EXTENT, c->file, c->data_lineno, nao); \ + plus(c->pos, c->base), EXTENT, c->file, c->data_lineno, nao); \ debuglf(elem, lit(" ~a"), c->dataline, nao); \ if (c_num(EXTENT) < 77) \ debuglf(elem, lit(" ~*~a~<*~a^"), c->pos, lit(""), \ @@ -1110,7 +1110,8 @@ static val do_match_line(match_line_ctx *c) elem = first(c->specline); - debug_check(elem, c->bindings, c->dataline, c->data_lineno, c->pos); + debug_check(elem, c->bindings, c->dataline, c->data_lineno, + c->pos, c->base); switch (elem ? type(elem) : 0) { case CONS: /* directive */ @@ -3437,7 +3438,8 @@ repeat_spec_same_data: { spec_bind (specline, first_spec, c.spec); - debug_check(first_spec, c.bindings, if2(consp(c.data), car(c.data)), c.data_lineno, nil); + debug_check(first_spec, c.bindings, if2(consp(c.data), car(c.data)), + c.data_lineno, nil, nil); if (consp(first_spec) && !rest(specline)) { val sym = first(first_spec); |