Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
spurious 'case' parse error
- X-seq: zsh-workers 41741
- From: Martijn Dekker <martijn@xxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: spurious 'case' parse error
- Date: Fri, 22 Sep 2017 15:11:26 +0100
- 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
The following causes a spurious parse error in zsh:
case x in
(x)echo ok ;;
esac
Output:
test.zsh:2: parse error near `ok'
The cause is the lack of space after the ')'; that space should be
optional, but is mandatory in zsh.
Interestingly, this works:
case x in
x)echo ok ;;
esac
Confirmed in zsh 5.0.7 through current git. (I didn't test earlier
versions.)
- Martijn
Messages sorted by:
Reverse Date,
Date,
Thread,
Author