Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Tracing bug Re: Regular expression expanding and matching
- X-seq: zsh-workers 30825
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Tracing bug Re: Regular expression expanding and matching
- Date: Sun, 25 Nov 2012 12:48:25 -0800
- In-reply-to: <121125113025.ZM15903@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <50B23D2D.9060603@internecto.net> <121125113025.ZM15903@torch.brasslantern.com>
[users > workers]
On Nov 25, 11:30am, Bart Schaefer wrote:
}
} } +./zshtest:9> [[ $somestring -pcre-match \d{4}${todaysday} ]]
} } +./zshtest:11> [[ $somestring -pcre-match \d{4}${yesterday} ]]
}
} Hmm, there's something slighly off about that XTRACE output.
The problem here is that the trace is printed by tracemodcond() in
Src/cond.c, but the parse is executed by the handler function for the
conditional. It just so happens that in the case of -pcre-match, the
handler calls back via cond_str() to parse the arguments exactly in
the way that the default infix conditionals would do, but in fact it
could choose to parse it differently.
Further, tracemodcond() is called before the parse is even attempted,
which means that unlike default conditionals, the trace output might be
printed first and then an error subsequently generated.
Under the current arrangement it is therefore impossible for xtrace to
produce accurate output for a module-defined conditional. The only
obvious way to correct this would be to pass the tracingcond flag down
to the module handler and require it to call back to tracemodcond()
after the parse [or in some other way handle the trace itself].
Messages sorted by:
Reverse Date,
Date,
Thread,
Author