Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh-3.1.4 bug, parsing case ... esac
- X-seq: zsh-workers 4375
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- To: SL Baur <steve@xxxxxxxxxx>, zsh-workers@xxxxxxxxxxxxxxx
- Subject: Re: zsh-3.1.4 bug, parsing case ... esac
- Date: Wed, 2 Sep 1998 20:52:29 -0700
- In-reply-to: <m267f6koec.fsf@xxxxxxxxxxxxxxxxx>
- References: <m267f6koec.fsf@xxxxxxxxxxxxxxxxx>
On Sep 2, 5:53pm, SL Baur wrote:
} Subject: zsh-3.1.4 bug, parsing case ... esac
}
} zsh: parse error near `echo'
} zsh: parse error in command substitution
}
} esac else echo bison ;
}
} adding a semicolon after the esac makes the messages go away, but I
} think this should work as is.
Blech. That sure doesn't parse according to the bash manual. The
stuff between "then" and "else" has to be a properly-terminated list,
which means it has to end with ; & or newline.
Anybody have access to a ksh manual?
It might be possible to special-case (ahem) this because esac is a
reserved word, but zsh's parser is doing exactly what it is documented
to do, so it can't be called a bug (except in egcs's makefile).
I'd report it to the egcs folks and see what they have to say. My guess is
this wasn't intentional on their part. It does appear that bash accepts
"esac", "done" or "fi" as termination of a "list", so it even accepts the
following gobbledygook:
if false; then if false; then if false; then; fi fi fi
if false; then case x in x);; esac else while true; do break; done fi
for y in y; do if true; then case x in x) break;; esac fi done
This only works in "list" context, e.g., if you run the above three lines
together it won't parse the "fi if". I suspect all the above is terribly
unportable and should not be used in a reasonable shell script or makefile.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Messages sorted by:
Reverse Date,
Date,
Thread,
Author