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

Test case for that:

  % < panic
  panic() {
    print -rC2 -- $functrace $funcfiletrace
    exit 1

  % < puts
  puts() {

  % < tracetest.zsh
  fpath=( . )
  autoload -Uz panic puts
  main() {
    () { puts }

  % ZDOTDIR=. Src/zsh tracetest.zsh
  puts:3           /Users/dana/.../zsh/puts:3
  (anon):0         tracetest.zsh:4
  main:1           tracetest.zsh:4
  tracetest.zsh:6  tracetest.zsh:6

The file line number at the top should be 5.

I tried a few 'real-world' cases and they matched the above — looks fine without
the ksh-style definition, but if it's there it uses the function-relative line
number. I'm guessing that's also related to the difference i mentioned seeing in
my last e-mail.

(I think i'll probably stop using ksh-style definitions....)


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