zsh-users
 help / color / mirror / code / Atom feed
From: Ray Andrews <rayandrews@eastlink.ca>
To: Zsh Users <zsh-users@zsh.org>
Subject: parse vs. runtime errors
Date: Fri, 20 Apr 2018 11:00:26 -0700	[thread overview]
Message-ID: <f3dc8071-cc88-ed6f-52a0-469fd7f6b32a@eastlink.ca> (raw)

How come:

[ .... ]]

is only caught as an error at runtime?  The error kills anything 
remaining on the same line, but subsequent linesexecute as normal.  I 
find most errors kill the entire parse, but there are some few that 
survive parse but throw the error at runtime.  Why is that?  It's a bit 
annoying that the runtime error can be buried in output and so not be 
noticed, and it seems like it would have to be an error at parse too.  
Either way, can I ask zsh to always make any error stop everything and 
make itself known?  I'll often do something like:

$ . func-file; func arg1 arg2

... and if 'func-file' has some bug in the contained source of 'func 
()', the older version of 'func' just runs anway and one does not see 
the error messageif the output scrolls off the screen.  True, one might 
not be so lazy and source the file, then run the command, but still it 
would be nice if there was some way of making zsh always stop whatever 
it is doing when any code error shows up.



             reply	other threads:[~2018-04-20 18:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-20 18:00 Ray Andrews [this message]
2018-04-20 19:00 ` Bart Schaefer
2018-04-21  1:48   ` Ray Andrews

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=f3dc8071-cc88-ed6f-52a0-469fd7f6b32a@eastlink.ca \
    --to=rayandrews@eastlink.ca \
    --cc=zsh-users@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).