@@ -2072,7 +2072,7 @@ eval0(
20722072 * expr2 ? expr1 : expr1
20732073 *
20742074 * "arg" must point to the first non-white of the expression.
2075- * "arg" is advanced to the next non-white after the recognized expression.
2075+ * "arg" is advanced to just after the recognized expression.
20762076 *
20772077 * Note: "rettv.v_lock" is not set.
20782078 *
@@ -2111,7 +2111,15 @@ eval1(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
21112111 if (getnext )
21122112 * arg = eval_next_line (evalarg_used );
21132113 else
2114+ {
2115+ if (evaluate && in_vim9script () && !VIM_ISWHITE (p [-1 ]))
2116+ {
2117+ error_white_both (p , 1 );
2118+ clear_tv (rettv );
2119+ return FAIL ;
2120+ }
21142121 * arg = p ;
2122+ }
21152123
21162124 result = FALSE;
21172125 if (evaluate )
@@ -2128,6 +2136,12 @@ eval1(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
21282136 /*
21292137 * Get the second variable. Recursive!
21302138 */
2139+ if (evaluate && in_vim9script () && !IS_WHITE_OR_NUL ((* arg )[1 ]))
2140+ {
2141+ error_white_both (p , 1 );
2142+ clear_tv (rettv );
2143+ return FAIL ;
2144+ }
21312145 * arg = skipwhite_and_linebreak (* arg + 1 , evalarg_used );
21322146 evalarg_used -> eval_flags = result ? orig_flags
21332147 : orig_flags & ~EVAL_EVALUATE ;
@@ -2148,11 +2162,25 @@ eval1(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
21482162 if (getnext )
21492163 * arg = eval_next_line (evalarg_used );
21502164 else
2165+ {
2166+ if (evaluate && in_vim9script () && !VIM_ISWHITE (p [-1 ]))
2167+ {
2168+ error_white_both (p , 1 );
2169+ clear_tv (rettv );
2170+ return FAIL ;
2171+ }
21512172 * arg = p ;
2173+ }
21522174
21532175 /*
21542176 * Get the third variable. Recursive!
21552177 */
2178+ if (evaluate && in_vim9script () && !IS_WHITE_OR_NUL ((* arg )[1 ]))
2179+ {
2180+ error_white_both (p , 1 );
2181+ clear_tv (rettv );
2182+ return FAIL ;
2183+ }
21562184 * arg = skipwhite_and_linebreak (* arg + 1 , evalarg_used );
21572185 evalarg_used -> eval_flags = !result ? orig_flags
21582186 : orig_flags & ~EVAL_EVALUATE ;
@@ -2179,7 +2207,7 @@ eval1(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
21792207 * expr2 || expr2 || expr2 logical OR
21802208 *
21812209 * "arg" must point to the first non-white of the expression.
2182- * "arg" is advanced to the next non-white after the recognized expression.
2210+ * "arg" is advanced to just after the recognized expression.
21832211 *
21842212 * Return OK or FAIL.
21852213 */
@@ -2310,7 +2338,7 @@ eval2(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
23102338 * expr3 && expr3 && expr3 logical AND
23112339 *
23122340 * "arg" must point to the first non-white of the expression.
2313- * "arg" is advanced to the next non-white after the recognized expression.
2341+ * "arg" is advanced to just after the recognized expression.
23142342 *
23152343 * Return OK or FAIL.
23162344 */
0 commit comments