zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] Add tests for semicolon in the middle of a sublist not terminating it.
@ 2018-10-24 15:17 Daniel Shahaf
  0 siblings, 0 replies; only message in thread
From: Daniel Shahaf @ 2018-10-24 15:17 UTC (permalink / raw)
  To: zsh-workers

---
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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-10-24 15:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-24 15:17 [PATCH] Add tests for semicolon in the middle of a sublist not terminating it Daniel Shahaf

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).