execute 'echomsg' (n ? '"true"' : '"no"')
assert_match('^true$', Screenline(&lines))
+ echomsg [1, 2, 3] #{a: 1, b: 2}
+ assert_match('^\[1, 2, 3\] {''a'': 1, ''b'': 2}$', Screenline(&lines))
+
call CheckDefFailure(['execute xxx'], 'E1001:')
call CheckDefFailure(['execute "cmd"# comment'], 'E488:')
enddef
if (*p == ']')
{
++p;
- // Allow for following comment, after at least one space.
- if (VIM_ISWHITE(*p) && *skipwhite(p) == '#')
- p += STRLEN(p);
break;
}
if (compile_expr0(&p, cctx) == FAIL)
compile_mult_expr(char_u *arg, int cmdidx, cctx_T *cctx)
{
char_u *p = arg;
+ char_u *prev;
int count = 0;
for (;;)
if (compile_expr0(&p, cctx) == FAIL)
return NULL;
++count;
+ prev = p;
p = skipwhite(p);
- if (ends_excmd(*p))
+ if (ends_excmd2(prev, p))
break;
}
for (idx = 0; idx < count; ++idx)
{
tv = STACK_TV_BOT(idx - count);
- if (tv->v_type == VAR_CHANNEL || tv->v_type == VAR_JOB)
+ if (iptr->isn_type == ISN_EXECUTE)
{
- SOURCING_LNUM = iptr->isn_lnum;
- emsg(_(e_inval_string));
- break;
+ if (tv->v_type == VAR_CHANNEL
+ || tv->v_type == VAR_JOB)
+ {
+ SOURCING_LNUM = iptr->isn_lnum;
+ emsg(_(e_inval_string));
+ break;
+ }
+ else
+ p = tv_get_string_buf(tv, buf);
}
else
- p = tv_get_string_buf(tv, buf);
+ p = tv_stringify(tv, buf);
len = (int)STRLEN(p);
if (ga_grow(&ga, len + 2) == FAIL)
clear_tv(tv);
}
ectx.ec_stack.ga_len -= count;
+ if (failed)
+ goto on_error;
- if (!failed && ga.ga_data != NULL)
+ if (ga.ga_data != NULL)
{
if (iptr->isn_type == ISN_EXECUTE)
do_cmdline_cmd((char_u *)ga.ga_data);