zsh-workers
 help / color / mirror / code / Atom feed
* zsh -n doesn't grok associate array indexes?
@ 2011-01-10 17:18 Rocky Bernstein
  2011-01-10 17:48 ` ZyX
  2011-01-10 18:20 ` Peter Stephenson
  0 siblings, 2 replies; 4+ messages in thread
From: Rocky Bernstein @ 2011-01-10 17:18 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 1112 bytes --]

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-01-10 19:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-10 17:18 zsh -n doesn't grok associate array indexes? Rocky Bernstein
2011-01-10 17:48 ` ZyX
2011-01-10 18:20 ` Peter Stephenson
2011-01-10 19:32   ` Rocky Bernstein

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).