Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug in case stmt with '('

On Jul 19,  1:43am, Zoltan Hidvegi wrote:
> Subject: Re: Bug in case stmt with '('
> Bart Schaefer wrote:
> > That means it can't look only for matching parens, but also has to look
> > for matching parens followed by a closing paren or vertical bar.
> > 
> > I'm unsure of this patch, so the pre3 stuff is still there #ifdef OLD.
> > There may be a better way to deal with it.
> Actually the patch below is a simpler solution for that.

Is it?  It handles (v|w)), but it doesn't handle this case:

	case v in
	(v|w)|x)   gigo="case '(v|w)|x)'"
		echo $gigo;;
	*)      gigo="case '*)'"
		echo $gigo;;

I backed out my patch and applied yours, and I still get:

	zsh: command not found: gigo=case '(v|w)|x)'

> An other
> advantage of that is that hgetc()/hungetc() is not used which is
> scientifically better since tokens should be recognized in lex.c

Yes, I know, but there are other cases in parse.c that lookahead with

> parse.c should only use the tokens returned by lex.c.  The patch to lex.c
> removes an unnecessary special case for `<' in a case pattern.  After that
> the only effect of the incasepat variable is that it disables spell
> checking.

That's fine, but doesn't address the problem.

Messages sorted by: Reverse Date, Date, Thread, Author