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

Re: [BUG] (z)-flag interrupts if $() in input



On Oct 30, 11:04am, Bart Schaefer wrote:
}
} torch% a='x $(|||) y'
} torch% print -rl -- ${(z)a}
} x
} $(||
} torch% 

A little progress but not much.

If we look at this:

torch% echo x $(|||) y
zsh: parse error near `||'
zsh: parse error near `$(|||) y'

Note that we have one parse error inside $(...) and then another for
the whole expression.

It's the inner parse error that kills (z).  gettokstr() returns LEXERR
to bufferwords() and it stops building the array.  But ... even if I
force the token to STRING there to make the loop continue, the next
ctxlex() returns ENDINPUT with empty tokstr, so the result isn't changed.



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