zsh-workers
 help / color / mirror / code / Atom feed
* Tracing bug Re: Regular expression expanding and matching
       [not found] ` <121125113025.ZM15903@torch.brasslantern.com>
@ 2012-11-25 20:48   ` Bart Schaefer
  0 siblings, 0 replies; only message in thread
From: Bart Schaefer @ 2012-11-25 20:48 UTC (permalink / raw)
  To: zsh-workers

[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].


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-11-25 20:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <50B23D2D.9060603@internecto.net>
     [not found] ` <121125113025.ZM15903@torch.brasslantern.com>
2012-11-25 20:48   ` Tracing bug Re: Regular expression expanding and matching Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).