# HG changeset patch # User Bram Moolenaar # Date 1603137603 -7200 # Node ID 5bd53bf6383660070790b4f01ef303ab41a9d906 # Parent 6e498fecf578eb778af1da5c9b5c5d38653def4b patch 8.2.1868: Vim9: no error for missing space after comma in dict Commit: https://github.com/vim/vim/commit/9a13e185e5de95b150555134b34030bd47c4e22b Author: Bram Moolenaar Date: Mon Oct 19 21:45:07 2020 +0200 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 https://github.com/vim/vim/issues/6672) diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim --- a/src/testdir/test_vim9_expr.vim +++ b/src/testdir/test_vim9_expr.vim @@ -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) diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1868, +/**/ 1867, /**/ 1866, diff --git a/src/vim9compile.c b/src/vim9compile.c --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -2996,6 +2996,11 @@ compile_dict(char_u **arg, cctx_T *cctx, return FAIL; } whitep = *arg + 1; + if (!IS_WHITE_OR_NUL(*whitep)) + { + semsg(_(e_white_space_required_after_str), ","); + return FAIL; + } *arg = skipwhite(*arg + 1); }