From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: [PATCH] Add tests for semicolon in the middle of a sublist not terminating it.
Date: Wed, 24 Oct 2018 15:17:35 +0000 [thread overview]
Message-ID: <20181024151735.31000-1-danielsh@tarpaulin.shahaf.local2> (raw)
---
These syntaxes behave this way because \n is valid after BAR / DAMPER / etc,
and semicolon is equivalent to \n.
I'm not sure if the meaning of these should be changed so ; terminates the
sublist, or changed to be considered a syntax error, or kept this way. (I'm
going to commit this anyway so we have a baseline to work from.) Matthew
points out that if this behaviour is to be kept, the definition of "sublist" in
zshmisc(1) should be amended to clarify that «: && ; pwd» considers 'pwd' part
of the first (and only) sublist, whereas currently it implies that the
semicolon terminates the sublist even in that position.
Cheers,
Daniel
Test/A01grammar.ztst | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/Test/A01grammar.ztst b/Test/A01grammar.ztst
index 217f7bea4..339ce7494 100644
--- a/Test/A01grammar.ztst
+++ b/Test/A01grammar.ztst
@@ -873,3 +873,13 @@
0:Assignment-only current shell commands in LHS of pipelin
>1
>1
+
+ echo pipe | ; sed s/pipe/PIPE/
+ true && ; echo and true
+ false && ; echo and false
+ true || ; echo or true
+ false || ; echo or false
+0:semicolon is equivalent to newline
+>PIPE
+>and true
+>or false
reply other threads:[~2018-10-24 15:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20181024151735.31000-1-danielsh@tarpaulin.shahaf.local2 \
--to=d.s@daniel.shahaf.name \
--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).