comparison src/eval.c @ 24339:236e9ebdb30e v8.2.2710

patch 8.2.2710: Vim9: not all tests cover script and :def function Commit: https://github.com/vim/vim/commit/90193e6140e5e7f1945e3e144a95697b0e16237a Author: Bram Moolenaar <Bram@vim.org> Date: Sun Apr 4 20:49:50 2021 +0200 patch 8.2.2710: Vim9: not all tests cover script and :def function Problem: Vim9: not all tests cover script and :def function. Solution: Run tests in both if possible. Fix differences.
author Bram Moolenaar <Bram@vim.org>
date Sun, 04 Apr 2021 21:00:04 +0200
parents 01b274c3f69b
children 7735cbff607d
comparison
equal deleted inserted replaced
24338:79fa98c31b45 24339:236e9ebdb30e
2328 *arg = eval_next_line(evalarg_used); 2328 *arg = eval_next_line(evalarg_used);
2329 else 2329 else
2330 { 2330 {
2331 if (evaluate && vim9script && !VIM_ISWHITE(p[-1])) 2331 if (evaluate && vim9script && !VIM_ISWHITE(p[-1]))
2332 { 2332 {
2333 error_white_both(p, 1); 2333 error_white_both(p, op_falsy ? 2 : 1);
2334 clear_tv(rettv); 2334 clear_tv(rettv);
2335 return FAIL; 2335 return FAIL;
2336 } 2336 }
2337 *arg = p; 2337 *arg = p;
2338 } 2338 }
2359 */ 2359 */
2360 if (op_falsy) 2360 if (op_falsy)
2361 ++*arg; 2361 ++*arg;
2362 if (evaluate && vim9script && !IS_WHITE_OR_NUL((*arg)[1])) 2362 if (evaluate && vim9script && !IS_WHITE_OR_NUL((*arg)[1]))
2363 { 2363 {
2364 error_white_both(p, 1); 2364 error_white_both(p, op_falsy ? 2 : 1);
2365 clear_tv(rettv); 2365 clear_tv(rettv);
2366 return FAIL; 2366 return FAIL;
2367 } 2367 }
2368 *arg = skipwhite_and_linebreak(*arg + 1, evalarg_used); 2368 *arg = skipwhite_and_linebreak(*arg + 1, evalarg_used);
2369 evalarg_used->eval_flags = (op_falsy ? !result : result) 2369 evalarg_used->eval_flags = (op_falsy ? !result : result)
2772 /* 2772 /*
2773 * Get the second variable. 2773 * Get the second variable.
2774 */ 2774 */
2775 if (evaluate && vim9script && !IS_WHITE_OR_NUL(p[len])) 2775 if (evaluate && vim9script && !IS_WHITE_OR_NUL(p[len]))
2776 { 2776 {
2777 error_white_both(p, 1); 2777 error_white_both(p, len);
2778 clear_tv(rettv); 2778 clear_tv(rettv);
2779 return FAIL; 2779 return FAIL;
2780 } 2780 }
2781 *arg = skipwhite_and_linebreak(p + len, evalarg); 2781 *arg = skipwhite_and_linebreak(p + len, evalarg);
2782 if (eval5(arg, &var2, evalarg) == FAIL) 2782 if (eval5(arg, &var2, evalarg) == FAIL)
3436 * Register contents: @r. 3436 * Register contents: @r.
3437 */ 3437 */
3438 case '@': ++*arg; 3438 case '@': ++*arg;
3439 if (evaluate) 3439 if (evaluate)
3440 { 3440 {
3441 rettv->v_type = VAR_STRING; 3441 if (in_vim9script() && IS_WHITE_OR_NUL(**arg))
3442 rettv->vval.v_string = get_reg_contents(**arg, 3442 semsg(_(e_syntax_error_at_str), *arg);
3443 GREG_EXPR_SRC); 3443 else if (in_vim9script() && !valid_yank_reg(**arg, FALSE))
3444 emsg_invreg(**arg);
3445 else
3446 {
3447 rettv->v_type = VAR_STRING;
3448 rettv->vval.v_string = get_reg_contents(**arg,
3449 GREG_EXPR_SRC);
3450 }
3444 } 3451 }
3445 if (**arg != NUL) 3452 if (**arg != NUL)
3446 ++*arg; 3453 ++*arg;
3447 break; 3454 break;
3448 3455