zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: [BUG] In reference to patch 39815, about (z) flag and $( parse error
Date: Thu, 12 Oct 2017 08:26:35 -0700	[thread overview]
Message-ID: <CAH+w=7YkdCEZg79001PmZ-oWv18WgzfkD=o15h4Gwz3qhSiJ9g@mail.gmail.com> (raw)
In-Reply-To: <etPan.59df8223.5720d9a5.98a8@zdharma.org>

On Thu, Oct 12, 2017 at 7:54 AM, Sebastian Gniazdowski
<psprint@zdharma.org> wrote:
> On 11 października 2017 at 19:02:31, Bart Schaefer (schaefer@brasslantern.com) wrote:
>> Hmm, so the problem appears to be that when parsing a comment, we
>> actually need the NEWLIN token to mark the end of the comment.
>> When parsing code, we need NEWLIN to be ignored as whitespace and
>> not tokenized.
>
> Have you any possible places for the fix?

It'd most likely need to be in bufferwords(), which somehow needs to
know that the STRING token returned from the lexer is [or not] a
comment and that therefore it should [or not] ignore the subsequent
NEWLIN.  However, that cascades all the way down into gettok() which
is where the "#" character is recognized and everything from there up
to but not including the newline is consumed.

> I've ran bisect, and the "<= 5.0.6 doesn't have Z+cn+ problem" holds up to this patch:
>
> commit c0d01a6fe0c67911650730cf13a2b9a0db16e59b
> Date:   Tue Jan 6 17:05:17 2015 +0000
>
>     Fix command substitutions to parse contents as they are read in.

(PWS, it would be helpful if you could include workers article numbers
in your commit logs.)

That commit is this:

        * 34160: Src/init.c, Src/input.c, Src/lex.c, Src/parse.c,
        Src/zsh.h, Test/D08cmdsubst.ztst: fix the problem that command
        and similar substitutions weren't properly parsed so could end
        prematurely.  Use improved resolution in context save and restore
        to allow parsing the substitution while tracking the string.

So it's not that 5.0.6 was correct, it's that we've swapped one
problem [that affects more than just (Z:n:)] for another.


  reply	other threads:[~2017-10-12 15:26 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-10 15:03 Sebastian Gniazdowski
2017-10-10 16:19 ` Sebastian Gniazdowski
2017-10-11  3:49   ` Bart Schaefer
2017-10-11  6:41     ` Peter Stephenson
     [not found]   ` <etPan.59dd94f1.69ba7f51.98a8@AirmailxGenerated.am>
2017-10-11  8:31     ` Sebastian Gniazdowski
2017-10-11 14:09       ` Sebastian Gniazdowski
2017-10-11 15:07         ` Sebastian Gniazdowski
2017-10-11 17:02       ` Bart Schaefer
2017-10-12 14:54         ` Sebastian Gniazdowski
2017-10-12 15:26           ` Bart Schaefer [this message]
2017-10-12 15:50             ` Peter Stephenson
2017-10-13  7:56               ` Bart Schaefer
2017-10-13  9:36                 ` Peter Stephenson
2017-10-13 20:55                   ` Bart Schaefer
2017-10-14 14:44                     ` Sebastian Gniazdowski
2017-10-15  1:53                       ` Bart Schaefer
2017-10-15 14:31                         ` Sebastian Gniazdowski
2017-10-15 18:09                           ` Bart Schaefer
2017-10-15 18:44                             ` Daniel Shahaf
2017-10-15 19:59                               ` Bart Schaefer
2017-10-17  6:34                             ` Sebastian Gniazdowski
2017-10-13  7:53             ` Sebastian Gniazdowski
2017-10-13  8:04               ` Bart Schaefer

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='CAH+w=7YkdCEZg79001PmZ-oWv18WgzfkD=o15h4Gwz3qhSiJ9g@mail.gmail.com' \
    --to=schaefer@brasslantern.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).