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.



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