Problem: Vim9: no error for missing white after : in dict.
Solution: Check for white space. (closes #6671) Also check that there is no
white before the :.
mixed = #{a: 234}
mixed = #{}
+ call CheckDefFailure(["let x = #{a:8}"], 'E1069:')
+ call CheckDefFailure(["let x = #{a : 8}"], 'E1068:')
+ call CheckDefFailure(["let x = #{a :8}"], 'E1068:')
+
call CheckDefFailure(["let x = #{8: 8}"], 'E1014:')
call CheckDefFailure(["let x = #{xxx}"], 'E720:')
call CheckDefFailure(["let x = #{xxx: 1", "let y = 2"], 'E722:')
enddef
def RetListAny(): list<any>
- return items({'k' : 'v'})
+ return items({'k': 'v'})
enddef
def RetListString(): list<string>
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1429,
/**/
1428,
/**/
}
}
- *arg = skipwhite(*arg);
if (**arg != ':')
{
- semsg(_(e_missing_dict_colon), *arg);
+ if (*skipwhite(*arg) == ':')
+ semsg(_(e_no_white_before), ":");
+ else
+ semsg(_(e_missing_dict_colon), *arg);
return FAIL;
}
-
whitep = *arg + 1;
+ if (!IS_WHITE_OR_NUL(*whitep))
+ {
+ semsg(_(e_white_after), ":");
+ return FAIL;
+ }
+
*arg = skipwhite(*arg + 1);
if (may_get_next_line(whitep, arg, cctx) == FAIL)
{