From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17609 invoked by alias); 10 Jan 2011 17:18:14 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28615 Received: (qmail 6868 invoked from network); 10 Jan 2011 17:18:13 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_FONT_FACE_BAD,HTML_MESSAGE, RCVD_IN_DNSWL_LOW,T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.160.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=eUS8RBQ6oyUcYe1u0WlI+JV4wm8t9ioYse/NUDf7Mac=; b=u9kfm3Ey/gcBvAbCkOBczrkN3Yzcaq1aWGXsRZ6SzKjSFVRZ17yqGyPxSbadP3HgxZ HhzPd9KBt98RhRrR9tXaruwsKZKdX56+AUKfyPv6w07q5p+1dJcepiwdi9XBuNg3gMa9 RpakcVXFIy5ier2cYna18LPi/Q27EqrQipUBM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=G0JtVX6ATQ1LRH5CbiWFB0T90aAu3FJtu2MggHAGppb7d4KYwWwcTntkZWFn4ztDk7 7WO3nsXZfZRW7e4W/NMhb8aPwlU1FW8mHskmGocMh+DEIJ+77TUQrPoBkgOAUtgU4WTS 8ZN4DW4csYmhKLt7WbEnnMQKXlKA1qoO4sI4s= MIME-Version: 1.0 Date: Mon, 10 Jan 2011 12:18:09 -0500 Message-ID: Subject: zsh -n doesn't grok associate array indexes? From: Rocky Bernstein To: zsh-workers@zsh.org Content-Type: multipart/alternative; boundary=00504502c916ee14b8049981265c --00504502c916ee14b8049981265c Content-Type: text/plain; charset=ISO-8859-1 I tried zsh -n to see how good a tool it might be for lint checking. Overall it works very well. However I ran into a problem when using a string associative array index. Here's a sample run: $ cat /tmp/zsh-bug.sh > typeset -A hash > hash['display']=5 > echo ${hash['display']} > $ zsh /tmp/zsh-bug.sh > 5 > $ zsh -n /tmp/zsh-bug.sh > /tmp/zsh-bug.sh:2: bad math expression: operand expected at `'display'' > /tmp/zsh-bug.sh:3: bad math expression: operand expected at `'display'' > $ zsh --version > zsh 4.3.10 (i686-pc-linux-gnu) > $ By the way, I also tried ksh -n from version 93u- 2010-09-22. It also catches basic syntax errors such as with complex statements (if, while, case, for) but offers a number of lint- like suggestions such as to improve speed and and allow for better ksh conformance. Out of 57 or so files I tried in the zshdb distribution, there were about 5 errors which I don't think anythingn could be done about, i.e. legitimate differences between zsh and ksh. However there were many warnings for performance improvements, removing deprecated constructs and better ksh conformance. --00504502c916ee14b8049981265c--