1
0
forked from aniani/vim

patch 8.2.1868: Vim9: no error for missing space after comma in dict

Problem:    Vim9: no error for missing space after comma in dict.
Solution:   Check for white space. (closes #6672)
This commit is contained in:
Bram Moolenaar 2020-10-19 21:45:07 +02:00
parent 80b0e5ea11
commit 9a13e185e5
3 changed files with 8 additions and 0 deletions

View File

@ -1880,6 +1880,7 @@ def Test_expr7_dict()
CheckDefFailure(["var x = #{a : 8}"], 'E1068:', 1)
CheckDefFailure(["var x = #{a :8}"], 'E1068:', 1)
CheckDefFailure(["var x = #{a: 8 , b: 9}"], 'E1068:', 1)
CheckDefFailure(["var x = #{a: 1,b: 2}"], 'E1069:', 1)
CheckDefFailure(["var x = #{8: 8}"], 'E1014:', 1)
CheckDefFailure(["var x = #{xxx}"], 'E720:', 1)

View File

@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1868,
/**/
1867,
/**/

View File

@ -2996,6 +2996,11 @@ compile_dict(char_u **arg, cctx_T *cctx, int literal, ppconst_T *ppconst)
return FAIL;
}
whitep = *arg + 1;
if (!IS_WHITE_OR_NUL(*whitep))
{
semsg(_(e_white_space_required_after_str), ",");
return FAIL;
}
*arg = skipwhite(*arg + 1);
}