Skip to content

Commit

Permalink
patch 8.2.2710: Vim9: not all tests cover script and :def function
Browse files Browse the repository at this point in the history
Problem:    Vim9: not all tests cover script and :def function.
Solution:   Run tests in both if possible. Fix differences.
  • Loading branch information
brammool committed Apr 4, 2021
1 parent 26af8e5 commit 90193e6
Show file tree
Hide file tree
Showing 6 changed files with 756 additions and 737 deletions.
19 changes: 13 additions & 6 deletions src/eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -2330,7 +2330,7 @@ eval1(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
{
if (evaluate && vim9script && !VIM_ISWHITE(p[-1]))
{
error_white_both(p, 1);
error_white_both(p, op_falsy ? 2 : 1);
clear_tv(rettv);
return FAIL;
}
Expand Down Expand Up @@ -2361,7 +2361,7 @@ eval1(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
++*arg;
if (evaluate && vim9script && !IS_WHITE_OR_NUL((*arg)[1]))
{
error_white_both(p, 1);
error_white_both(p, op_falsy ? 2 : 1);
clear_tv(rettv);
return FAIL;
}
Expand Down Expand Up @@ -2774,7 +2774,7 @@ eval4(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
*/
if (evaluate && vim9script && !IS_WHITE_OR_NUL(p[len]))
{
error_white_both(p, 1);
error_white_both(p, len);
clear_tv(rettv);
return FAIL;
}
Expand Down Expand Up @@ -3438,9 +3438,16 @@ eval7(
case '@': ++*arg;
if (evaluate)
{
rettv->v_type = VAR_STRING;
rettv->vval.v_string = get_reg_contents(**arg,
GREG_EXPR_SRC);
if (in_vim9script() && IS_WHITE_OR_NUL(**arg))
semsg(_(e_syntax_error_at_str), *arg);
else if (in_vim9script() && !valid_yank_reg(**arg, FALSE))
emsg_invreg(**arg);
else
{
rettv->v_type = VAR_STRING;
rettv->vval.v_string = get_reg_contents(**arg,
GREG_EXPR_SRC);
}
}
if (**arg != NUL)
++*arg;
Expand Down

0 comments on commit 90193e6

Please sign in to comment.