From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22320 invoked by alias); 18 Dec 2017 09:09:32 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 42139 Received: (qmail 1444 invoked by uid 1010); 18 Dec 2017 09:09:32 -0000 X-Qmail-Scanner-Diagnostics: from mailout1.w1.samsung.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(210.118.77.11):SA:0(-6.9/5.0):. Processed in 6.385523 secs); 18 Dec 2017 09:09:32 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,T_DKIM_INVALID, T_RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: p.stephenson@samsung.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20171218090155euoutp01488509fc53cdae77633cace25cfb8667~BWAIa8HSj3037730377euoutp01a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1513587715; bh=rDRtnfwj5WyXfZO6p+AQxaWTSPJUpYA4Qbf7ve6d6wA=; h=Date:From:To:Subject:In-reply-to:References:From; b=m0hHFRJs462Vutr/lh1/CyiWtOJJ5qJPSK+PKSJ1PMM2vyvTRNQa9tameblIf4DIG GbnT9/NakukO4eM6essF5/HYHxZmxyIja1MNPPX3S1UhtbdSK+CunUE8wr0xG6UsSF xkoC66r//1ZOhp2oQdVY+p6DYhUUXEjK4zL8ynHM= X-AuditID: cbfec7f2-f793b6d000003243-99-5a378402935d Date: Mon, 18 Dec 2017 09:01:55 +0000 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: [BUG] Anonymous functions cause funcfiletrace to produce function-relative line numbers Message-id: <20171218090155.58c65907@pwslap01u.europe.root.pri> In-reply-to: Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrPIsWRmVeSWpSXmKPExsWy7djP87pMLeZRBn0vrCwONj9kcmD0WHXw A1MAYxSXTUpqTmZZapG+XQJXxspVW1kL/nFUdD5/xNTAOJ+9i5GTQ0LARKK3dxELhC0mceHe erYuRi4OIYGljBK/OlqZIJxeJoktk+YwdzFygHXM7XaEiC9jlHi2r5EVwpnGJPFsXiMzhHOG UaLrxCYo5yyjxMZ3Z9hAlrAIqEq0L53KCmKzCRhKTN00mxHEFhEQlzi79jzYIcICaRK7H34F i/MK2EvMaDkNVs8pYC3RNPk2WJxfQF/i6t9PTBCH20vMvHIGql5Q4sfke2BzmAV0JLZte8wO YctLbF7zFuwgCYEFbBJLzrczQjS7SMz6/x8aGsISr45vgbJlJDo7DkIt6GeUeNLtC9E8g1Hi 9JkdbBAJa4m+2xcZITbwSUzaNh0aSLwSHW1CECUeEmc+r4CGsKPE+q3nGCGhMolZ4uyRb4wT GBVmITl8FpLDZyE5fAEj8ypGkdTS4tz01GJjveLE3OLSvHS95PzcTYzAZHD63/FPOxi/nrA6 xCjAwajEw1tw0SxKiDWxrLgy9xCjBAezkghvarF5lBBvSmJlVWpRfnxRaU5q8SFGaQ4WJXFe 26i2SCGB9MSS1OzU1ILUIpgsEwenVAPjpCCzHb6dn9+/36qj6sw9uWPWnzwGBu/QAz2dvCsi vYRZQ6Jjrp1s3MugHle1rHrFPPWii89dq6TbmXIOF+rOOSZ9NmNVfblByo7EzjNFB5c52605 lPsivOhzwaMrvN96JTdMiU/peT9vUcuG72mNu4IOqG2Ku3GTk8VKN+74T+sLnrt7IrWUWIoz Eg21mIuKEwF5ciWYAgMAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrHLMWRmVeSWpSXmKPExsVy+t/xy7pMLeZRBt8WSFkcbH7I5MDoserg B6YAxigum5TUnMyy1CJ9uwSujJWrtrIW/OOo6Hz+iKmBcT57FyMHh4SAicTcbscuRk4gU0zi wr31bCC2kMASRonGQ65djFxA9gwmiSX7r7JBOOcYJaZ838ME4ZxllHh98DArSAuLgKpE+9Kp YDabgKHE1E2zGUFsEQFxibNrz7OA2MICaRK7H34Fi/MK2EvMaDkNVs8pYC3RNPk2I8TqKcwS C/8UgNj8AvoSV/9+YoI4z15i5pUzUL2CEj8m3wObySygJbF5WxMrhC0vsXnNW2aIOeoSN+7u Zp/AKDwLScssJC2zkLQsYGRexSiSWlqcm55bbKhXnJhbXJqXrpecn7uJERjK24793LyD8dLG 4EOMAhyMSjy8BRfNooRYE8uKK3MPMUpwMCuJ8KYWm0cJ8aYkVlalFuXHF5XmpBYfYpTmYFES 5+3dszpSSCA9sSQ1OzW1ILUIJsvEwSnVwKiZEZPbt9P2++tEy1vGwYbxJlNeZfzJrz22VG2B 7dG50S9K5nX+vcPDJnPzWZJpiezjLUIibyZ1sXsdY97+XfF6eO+fbs1w/5Di3FtON47OO53C V2i01c1ld7595LM/W3+8eHd05nKfbqs3npvWRa+UWfDouEOkTV/VtNpXVlHnuDm2hReIxymx FGckGmoxFxUnAgCo5gEOYQIAAA== X-CMS-MailID: 20171218090154eucas1p23b44c27e3059c26d4bd2f2a433eb5cf9 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20171210232854epcas2p2f9d4f0ac2ad31feb5a54d61da49e7140 X-RootMTR: 20171210232854epcas2p2f9d4f0ac2ad31feb5a54d61da49e7140 References: <20171211094116.48e29012@pwslap01u.europe.root.pri> <20171211101238.410a91b1@pwslap01u.europe.root.pri> <26AB704C-51B8-49FE-87E2-3BCDE5F7DF42@dana.is> <20171215102118.7bdfff2e@pwslap01u.europe.root.pri> On Fri, 15 Dec 2017 12:45:47 -0600 dana wrote: > On 15 Dec 2017, at 04:21, Peter Stephenson 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