Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: while loop grammar question






On 2024-12-08 01:35, Bart Schaefer wrote:
There's a patch in 43597 but it was not applied because all this
behavior is down to the SHORT_LOOPS option, which doesn't apply to
"if" I guess (it's not a loop, and none of the loop forms have an
"else").
Over my head, but intuitively I think of it as SHORT_GRAMMAR .  That is, that wherever a do/done construction could be used, the SHORTness would apply.  Thus it would apply to any control structure, not just loops.  I'd guess the parser would agree.

Again my snotty opinions don't matter, but it seems weird that some of this would hang on which line an opening brace is on. Mind ... there are other examples of things where line breaking is syntactic so I guess that shouldn't bother me ... as long as it's consistent.








Messages sorted by: Reverse Date, Date, Thread, Author