Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [BUG] Anonymous functions cause funcfiletrace to produce function-relative line numbers



On Fri, 15 Dec 2017 12:45:47 -0600
dana <dana@xxxxxxx> wrote:
> On 15 Dec 2017, at 04:21, Peter Stephenson <p.stephenson@xxxxxxxxxxx> wrote:
> >See if this helps...
> 
> Thanks. After applying the new patch, the line numbers all look good with the
> test case i provided, whether it's executed from a file or from stdin. I also
> tried it with the functions in separate files, and they look correct there
> too... unless you use ksh-style definitions.

I think this fits in with what I realised, which is that line numbers
for functions are wrong if they're in a nested scope.  The anonymous
functions that brought this up are naturally defined that way because
they're executed in other functions and hence defined there, whereas
typically functions are deifned in a top level scope --- except for
ksh-style, where they're defined as functions inside the autoload scope
and then executed.

What I haven't worked out is how to fix this.  I'm confused about how
the definition and execution hierarchies fit together.

If I don't get further I may commit the current change as a general
improvement on previous behaviour.

pws



Messages sorted by: Reverse Date, Date, Thread, Author