Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Empty sublist in "if"
- X-seq: zsh-workers 40533
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Empty sublist in "if"
- Date: Sun, 12 Feb 2017 10:30:09 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=q3kLU7whRiWc03efRZvW4SP1F1s0IDAXghO2zquDOpM=; b=JwGOkk3ek5vy9xiiRBMrF0cY09mVcfB9a+T/D5cV0n9dhb7YS/ufTIhmErOSH4rmk4 JFw9fA9zKTo+juO08zh+LdNeQnKJUDAt6MbU4RkDxqPTG1Hn2+qhdEczrHMIDJqRhREr ic9TnlnoOvLVlOOJ9fCIH7dpUeLG2rpi349QL3CLt6t/hVOp/aiDSioaWeX6T3bj9ByF vcGFgDUiTXNVYbI6RfxAV2m/yEfh1oyPF48DxaGdwsTif7gJXz2fRebz4MCyCySDbdum bTlPcR6k6PcyB5r32RR6T67PHMvwLc4RvyVYt8VwLaxASJGN6WPYMbgIao8Y07eSnpAC 6mxQ==
- In-reply-to: <20170212061455.GA4267@fujitsu.shahaf.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <0befdb38-eaa5-6388-a3fe-58b1a73834b7@eastlink.ca> <170211110437.ZM467@torch.brasslantern.com> <ee3c8ad2-41e3-f3e4-9347-d6e395b85d8e__47549.2452657365$1486864527$gmane$org@eastlink.ca> <20170212061455.GA4267@fujitsu.shahaf.local2>
On Feb 12, 6:14am, Daniel Shahaf wrote:
}
} % if false; then if true; fi
} % setopt noshortloops
} % if false; then if true; fi
} zsh: parse error near `fi'
}
} I'm guessing the second 'if' is parsed using the SHORT_LOOPS syntax,
} with an empty sublist. I'm not sure whether that's a bug: is the
} sublist in the SHORT_LOOPS syntax allowed to be null?
Hrm.
if true; then fi
works, so yes, the sublist is allowed to be empty. Still, the original
example seems a pretty questionable special case, and e.g. bash does
not allow an empty sublist there.
Of course zsh also allows empty braces and empty subshell parens, so ...
Messages sorted by:
Reverse Date,
Date,
Thread,
Author