ZyX wrote:
> Consider the following script:
>
> let g=1
> let a=2
> let b=3
>
> let g
> let {0==1 ? "a" : "b"}
> let {0==1 ? "a" : "b"} g
> let g {0 ? "a" : "b"}
> let g {0==1 ? "a" : "b"}
>
> . It will output the following:
>
> fourth :let:
> g #1
> fifth :let:
> b #3
> sixths :let:
> b #3
> g #1
> seventh :let:
> g #1
> b #3
> eights :let:
> E15: Invalid expression: =1 ? "a" : "b"}
> .
>
> Reason: to determine expression start vim_strchr(argend, '=') is used. To do
> this correctly one needs to use
>
> expr = skipwhite(argend);
> if (*expr != '=' && !(vim_strchr("+-.", *expr) != NULL && expr[1] == '='))
The basic problem appears to be that skip_var_list() only skips one
argument when they are not inside []. But skipping more isn't useful,
if there is a "=" further down not insice{} that's a syntax error.
Looks like your solution is a simple way to make it work. Thanks.
Note that these curly-braces expressions are deprecated, especially
because of this kind of problem.
--
Contrary to popular belief, it's often your clothing that gets promoted, not
you.
(Scott Adams - The Dilbert principle)
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.