Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH 2/2] clear the heredoc list in case par_event() fails
- X-seq: zsh-workers 43853
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH 2/2] clear the heredoc list in case par_event() fails
- Date: Thu, 29 Nov 2018 17:34:04 +0000
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20181129173407euoutp02fe488cc3f47db288a36ad73dbbe0a211~rqMG4hOWo2580225802euoutp02X
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1543512847; bh=zIa8quden3Fq++zXzTuq96BIFwpEd/ya4AMUWcl+aN0=; h=Subject:From:To:Date:In-Reply-To:References:From; b=bvGVwUZdlu6+uYMEseTOJMwaNaykUmvVQO55gj+OMJZ95dWUmk54tuiiwA2Uvn9Ly QorumD7J83+O+hvHuJjSwhDUEag5WJd4MwWcUQ78lTIfT0WD5qmFIUh8/3+WUmyZAr hv0mN5oi777j2IlZJdPzMn64LyJFd8xUGhWcUeEg=
- In-reply-to: <2172016.U8TV6t29ou@kdudka-nb>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <1429277155-24607-1-git-send-email-kdudka@redhat.com> <1429277155-24607-2-git-send-email-kdudka@redhat.com> <20150417201753.41812294@ntlworld.com> <CGME20181129163223epcas2p409f7d3c4b9417e2a3a9956abfd64ea3b@epcas2p4.samsung.com> <2172016.U8TV6t29ou@kdudka-nb>
On Thu, 2018-11-29 at 17:24 +0100, Kamil Dudka wrote:
> Since the above patch was applied, zsh exits successfully (despite it reports
> parse error) on the attached example:
>
> % zsh parse-error.sh; echo $?
> parse-error.sh:4: parse error
> 0
>
>...
>
> cat <<EOF
> $(print <<XXX
> EOF
I don't think the problem is with the changed code, which is signalling the
error as it should. I think it's up above.
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...
pws
diff --git a/Src/lex.c b/Src/lex.c
index fa29da3..f43bcc7 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -1613,6 +1613,7 @@ parsestr(char **s)
zerr("parse error near `%c'", err);
else
zerr("parse error");
+ tok = LEXERR;
}
}
return err;
Messages sorted by:
Reverse Date,
Date,
Thread,
Author