zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@ifh.de>
To: zsh-workers@math.gatech.edu (Zsh hackers list)
Subject: Re: Abort on parse errors
Date: Thu, 02 Jul 1998 14:14:47 +0200	[thread overview]
Message-ID: <199807021214.OAA11836@hydra.ifh.de> (raw)
In-Reply-To: ""Bart Schaefer""'s message of "Wed, 01 Jul 1998 11:32:57 MST." <980701113257.ZM13854@candle.brasslantern.com>

"Bart Schaefer" wrote:
> } Ksh will even abort initialisation scripts if they have a parse error.
> 
> Which this will, too, given `setopt errexit`, right?  I think that's fine,

The reference in the code to noerrexit is a bit confusing: it isn't
directly connected to the errexit option, it just specifies that there
shouldn't be an exit on an error whether the option's set or not.  I
used it because it seemed to give the best way of deciding when to
ignore parse errors.  (I hate being dumped out of initialisation
scripts, emacs does it to me all the time.)

> but perhaps in ksh emulation mode it should behave differently ...

True:  in that case the `!noerrexit' in init.c becomes
(!noerrexit || emulate == EMULATE_KSH)
--- it's not necessary in main.c at least in this case, in fact I'm
not sure if the noerrexit test there is useful.

*** Src/init.c.err2	Wed Jul  1 17:53:25 1998
--- Src/init.c	Thu Jul  2 14:01:21 1998
***************
*** 99,106 ****
  	if (!(list = parse_event())) {	/* if we couldn't parse a list */
  	    hend();
  	    if ((tok == ENDINPUT && !errflag) ||
! 		(tok == LEXERR && !noerrexit &&
! 		 (!isset(SHINSTDIN) || !toplevel)) || justonce)
  		break;
  	    continue;
  	}
--- 99,106 ----
  	if (!(list = parse_event())) {	/* if we couldn't parse a list */
  	    hend();
  	    if ((tok == ENDINPUT && !errflag) ||
! 		(tok == LEXERR && (!noerrexit || emulation == EMULATE_KSH)
! 		 && (!isset(SHINSTDIN) || !toplevel)) || justonce)
  		break;
  	    continue;
  	}

-- 
Peter Stephenson <pws@ifh.de>       Tel: +39 50 844536
WWW:  http://www.ifh.de/~pws/
Gruppo Teorico, Dipartimento di Fisica
Piazza Torricelli 2, 56100 Pisa, Italy



      reply	other threads:[~1998-07-02 12:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-07-01 16:18 Peter Stephenson
1998-07-01 18:32 ` Bart Schaefer
1998-07-02 12:14   ` Peter Stephenson [this message]

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=199807021214.OAA11836@hydra.ifh.de \
    --to=pws@ifh.de \
    --cc=zsh-workers@math.gatech.edu \
    /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).