zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: [PATCH 2/2] clear the heredoc list in case par_event() fails
Date: Fri, 30 Nov 2018 09:55:23 +0000	[thread overview]
Message-ID: <20181130095523.27cf97f4@camnpupstephen.cam.scsc.local> (raw)
In-Reply-To: <CAH+w=7aYJyZaod5HgBioF2aQ8ezjTBM+tffezs73yd_QLibxsA@mail.gmail.com>

On Thu, 29 Nov 2018 10:39:15 -0800
Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Thu, Nov 29, 2018 at 9:42 AM Peter Stephenson
> <p.stephenson@samsung.com> wrote:
> >
> > There's some slightly icky linkage between lex errors and the top level
> > requiring tok to be LEXERR.  The simple fix using the existing
> > signalling looks like the following.  I definitely don't think the tok =
> > LEXERR has a moral right to percolate through in the way it must
> > previously have been doing to avoid this, and the lexer does certainly
> > have the right to update the token when signalling a parse error, so
> > (famous last words) it's hard to see what could be wrong with this...  
> 
> Might this need to be conditional upon ... something ... so that e.g.
> ${(z)...} on a malformed here-document doesn't throw an error?  I
> don't have the code handy to poke around.

All this change is doing is setting the token to LEXERR in a case which
already loudly complains about the error and sets the error flag (this
is in a function parsestr() which calls parsetrnoerr() just above).

In most cases you'd expect the token in such a case already to be
LEXERR: Kamil's test includes an incomplete $( inside a here document so
there was some interesting nested parsing involved.

So anything reacting badly to the change in the token needs fixing.

pws

  reply	other threads:[~2018-11-30  9:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-17 13:25 [PATCH 1/2] report bad ELF interpreter if it causes exec to fail Kamil Dudka
2015-04-17 13:25 ` [PATCH 2/2] clear the heredoc list in case par_event() fails Kamil Dudka
2015-04-17 19:17   ` Peter Stephenson
2015-04-20  8:48     ` Kamil Dudka
2018-11-29 16:24     ` Kamil Dudka
2018-11-29 17:34       ` Peter Stephenson
2018-11-29 18:39         ` Bart Schaefer
2018-11-30  9:55           ` Peter Stephenson [this message]
2018-11-30 12:53         ` Kamil Dudka
2015-04-17 13:49 ` [PATCH 1/2] report bad ELF interpreter if it causes exec to fail Daniel Shahaf
2015-04-17 14:32   ` Kamil Dudka
2015-04-17 15:21 ` Oliver Kiddle
2015-04-17 15:59   ` Kamil Dudka
2015-04-17 19:59     ` Oliver Kiddle
2015-04-17 15:41 ` Philippe Troin
2015-04-17 15:51   ` 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=20181130095523.27cf97f4@camnpupstephen.cam.scsc.local \
    --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).