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

Re: lexer issue



Peter wrote:
> Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
> > Does anyone know what may be causing this:
> > 
> >     echo $(( ((##h << 8) + ##e) << 8)+<SPACE>
> >   ??? echo $(( ((##h << 8) +
> > 
> > This is with space bound to magic-space.
>
> This will be to do with the fact that you've closed one of the
> parentheses of the arithmetic expression, but not the other, so the next
> expansion has decided it's a command substitution.  In that, the ##e is
> a comment, so gets stripped.  In fact, I'm not seeing the effect you
> are, which may be down to options, or to the fact that the way we handle
> interactive comments changed recently, or a combination.

It can be reproduced starting from zsh -f with nothing more than
  bindkey ' ' magic-space
So interactive_comments is not set.

I managed to bisect it and it was introduced with 34160 (c0d01a6).

Whether it is parsed as a command substitution or arithmetic expression,
there's nothing in there that might be interpreted as being a history
expansion so magic-space should not do anything regardless of how the
parser sees it.

Oliver



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