@@ -1815,7 +1815,10 @@ compile_load(char_u **arg, char_u *end_arg, cctx_T *cctx, int error)
18151815 if (* (* arg + 1 ) == ':' )
18161816 {
18171817 // load namespaced variable
1818- name = vim_strnsave (* arg + 2 , end - (* arg + 2 ));
1818+ if (end <= * arg + 2 )
1819+ name = vim_strsave ((char_u * )"[empty]" );
1820+ else
1821+ name = vim_strnsave (* arg + 2 , end - (* arg + 2 ));
18191822 if (name == NULL )
18201823 return FAIL ;
18211824
@@ -1833,9 +1836,24 @@ compile_load(char_u **arg, char_u *end_arg, cctx_T *cctx, int error)
18331836 {
18341837 res = compile_load_scriptvar (cctx , name , NULL , NULL , error );
18351838 }
1839+ else if (* * arg == 'b' )
1840+ {
1841+ semsg ("Namespace b: not supported yet: %s" , * arg );
1842+ goto theend ;
1843+ }
1844+ else if (* * arg == 'w' )
1845+ {
1846+ semsg ("Namespace w: not supported yet: %s" , * arg );
1847+ goto theend ;
1848+ }
1849+ else if (* * arg == 't' )
1850+ {
1851+ semsg ("Namespace t: not supported yet: %s" , * arg );
1852+ goto theend ;
1853+ }
18361854 else
18371855 {
1838- semsg ("Namespace not supported yet : %s" , * arg );
1856+ semsg ("E1075: Namespace not supported: %s" , * arg );
18391857 goto theend ;
18401858 }
18411859 }
@@ -2060,6 +2078,7 @@ to_name_const_end(char_u *arg)
20602078 }
20612079 else if (p == arg && * arg == '#' && arg [1 ] == '{' )
20622080 {
2081+ // Can be "#{a: 1}->Func()".
20632082 ++ p ;
20642083 if (eval_dict (& p , & rettv , FALSE, TRUE) == FAIL )
20652084 p = arg ;
@@ -2068,6 +2087,8 @@ to_name_const_end(char_u *arg)
20682087 {
20692088 int ret = get_lambda_tv (& p , & rettv , FALSE);
20702089
2090+ // Can be "{x -> ret}()".
2091+ // Can be "{'a': 1}->Func()".
20712092 if (ret == NOTDONE )
20722093 ret = eval_dict (& p , & rettv , FALSE, FALSE);
20732094 if (ret != OK )
@@ -5123,7 +5144,8 @@ compile_def_function(ufunc_T *ufunc, int set_return_type)
51235144 }
51245145
51255146 // "{" starts a block scope
5126- if (* ea .cmd == '{' )
5147+ // "{'a': 1}->func() is something else
5148+ if (* ea .cmd == '{' && ends_excmd (* skipwhite (ea .cmd + 1 )))
51275149 {
51285150 line = compile_block (ea .cmd , & cctx );
51295151 continue ;
0 commit comments