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

Re: [PATCH v3] regexp-replace and ^, word boundary or look-behind operators (and more).



On Wed, May 5, 2021 at 4:45 AM Stephane Chazelas <stephane@xxxxxxxxxxxx> wrote:
>
> > What do you think about replacing the final eval with typeset -g, as
> > mentioned in workers/48760 ?
>
> [...] very legible. It has the benefit (or inconvenience
> depending on PoV) of returning an error if the lvalue is not a
> scalar. It reports an error (and exits the shell process)  upon
> incorrect lvalues (except ones such as "var=foo"). A major
> drawback though is that if chokes on lvalue='array[n=1]' or
> lvalue='assoc[keywith=characters]'

Hmm, I wonder if that should be considered a bug.  It seems the
parsing in builtin.c:getasg() is not equivalent to what's done for the
same input syntax elsewhere.




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