From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id e8a3fd7c for ; Fri, 30 Nov 2018 12:53:26 +0000 (UTC) Received: (qmail 24725 invoked by alias); 30 Nov 2018 12:53:13 -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: 43857 Received: (qmail 26972 invoked by uid 1010); 30 Nov 2018 12:53:13 -0000 X-Qmail-Scanner-Diagnostics: from mx1.redhat.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.100.2/25112. spamassassin: 3.4.2. Clear:RC:0(209.132.183.28):SA:0(-6.9/5.0):. Processed in 2.188215 secs); 30 Nov 2018 12:53:13 -0000 X-Envelope-From: kdudka@redhat.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | From: Kamil Dudka To: Peter Stephenson Cc: zsh-workers@zsh.org Subject: Re: [PATCH 2/2] clear the heredoc list in case par_event() fails Date: Fri, 30 Nov 2018 13:53:47 +0100 Message-ID: <30884911.Z0NPFsIS6F@kdudka-nb> In-Reply-To: <1543512844.6025.28.camel@samsung.com> References: <1429277155-24607-1-git-send-email-kdudka@redhat.com> <2172016.U8TV6t29ou@kdudka-nb> <1543512844.6025.28.camel@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Fri, 30 Nov 2018 12:53:07 +0000 (UTC) On Thursday, November 29, 2018 6:34:04 PM CET Peter Stephenson wrote: > 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 < > $(print < > 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; Thanks for the quick fix! It seems to work perfectly. Kamil