+ g:ablob)
assert_equal(0z01ab3344, g:ablob + 0z3344)
assert_equal(0z01ab01ab, g:ablob + g:ablob)
+
+ # concatenate non-constant to constant
+ let save_path = &path
+ &path = 'b'
+ assert_equal('ab', 'a' .. &path)
+ &path = save_path
+
+ @b = 'b'
+ assert_equal('ab', 'a' .. @b)
+
+ $ENVVAR = 'env'
+ assert_equal('aenv', 'a' .. $ENVVAR)
enddef
def Test_expr5_vim9script()
/*
* Option value: &name
*/
- case '&': ret = compile_get_option(arg, cctx);
+ case '&': if (generate_ppconst(cctx, ppconst) == FAIL)
+ return FAIL;
+ ret = compile_get_option(arg, cctx);
break;
/*
* Environment variable: $VAR.
*/
- case '$': ret = compile_get_env(arg, cctx);
+ case '$': if (generate_ppconst(cctx, ppconst) == FAIL)
+ return FAIL;
+ ret = compile_get_env(arg, cctx);
break;
/*
* Register contents: @r.
*/
- case '@': ret = compile_get_register(arg, cctx);
+ case '@': if (generate_ppconst(cctx, ppconst) == FAIL)
+ return FAIL;
+ ret = compile_get_register(arg, cctx);
break;
/*
* nested expression: (expression).