Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] Add tests for semicolon in the middle of a sublist not terminating it.
- X-seq: zsh-workers 43726
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] Add tests for semicolon in the middle of a sublist not terminating it.
- Date: Wed, 24 Oct 2018 15:17:35 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=from:to:subject:date:message-id :mime-version:content-type:content-transfer-encoding; s=fm1; bh= eUXg+DW/rx8Oo9kO74HIt7yGdyeuI4cJNx0ZFsChF4M=; b=OM5CzfJSa2Niw16B +83e0FLZsqwU5jMwPRSt2m7KDIKnPhDYD5adBYZT75hqJhNtiaYjkoPe0DOT9Aiq gIBcffdC/w46zYJSLGfOlip4NrQT+PVshQpR/+NuvI5YXG/Mac8eA7ZGoqw+jC7j gS31me3agaYichiS3e/Ej8kfkSlJSfSe4fkbbOp2LC5Clk2qIaCOqTolp0obwE/M Wwfbuqmoxt9uo84O7KXPLGhCfaFsRhtdiLM6wa7vj5SEw/i/QJsF3QibbwF3bjle JKZnp4lNnw6wEmxkclWUpViL5kj3YaHXpsb/0wPsvwu3SkCLgFrf+7BHleqUkUbg Q4WV0A==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=eUXg+D W/rx8Oo9kO74HIt7yGdyeuI4cJNx0ZFsChF4M=; b=QlV6x1gFeWDt75jp81e1oF 6+9fI/4Xft+swFskQgkI1kfNRBcg9C8TwXQHQYfOAdntERlIHDddBmAPK/AbZPrN QlerYFwQQdk2gtBm0vm8w213u11v4eTJn+xxo/jb+A/uf8Fl17eVfs3RgHSllfG3 LQbSGxwUxOTtAz7SCAF6D+GLrkjNXPEPM5XlmNPvbJOQYJdjpYxpQkytF8lS+wA+ XZVST04QyXEIscEGLmxQnPC3P8feenasIQCV/8ZFFtjF+cQZVf2aNhfhfFkmC6N2 6ovgOrZVCI5KXv0EnMIMjAqmGqLsTiVjufL8emWF8nOh0R+b90OE0KaQl1+sZXQg ==
- 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
---
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author