From: Peter Stephenson <p.stephenson@samsung.com>
To: zsh-workers@zsh.org
Subject: Re: [BUG] Anonymous functions cause funcfiletrace to produce function-relative line numbers
Date: Mon, 18 Dec 2017 09:01:55 +0000 [thread overview]
Message-ID: <20171218090155.58c65907@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <FDA58405-4654-4DFC-951F-7E467CF836B2@dana.is>
On Fri, 15 Dec 2017 12:45:47 -0600
dana <dana@dana.is> wrote:
> On 15 Dec 2017, at 04:21, Peter Stephenson <p.stephenson@samsung.com> 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
next prev parent reply other threads:[~2017-12-18 9:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20171210232854epcas2p2f9d4f0ac2ad31feb5a54d61da49e7140@epcas2p2.samsung.com>
2017-12-10 23:28 ` dana
2017-12-11 9:41 ` Peter Stephenson
2017-12-11 10:12 ` Peter Stephenson
2017-12-11 21:57 ` dana
2017-12-15 10:21 ` Peter Stephenson
2017-12-15 18:45 ` dana
2017-12-16 21:10 ` Bart Schaefer
2017-12-16 22:33 ` dana
2017-12-18 9:01 ` Peter Stephenson [this message]
2017-12-20 17:39 ` Peter Stephenson
2017-12-20 22:26 ` dana
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171218090155.58c65907@pwslap01u.europe.root.pri \
--to=p.stephenson@samsung.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).