diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-10-19 21:45:07 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-10-19 21:45:07 +0200 |
commit | 9a13e185e5de95b150555134b34030bd47c4e22b (patch) | |
tree | 2cac198bc07a0840ac54148a026515bc9438cc3a | |
parent | 80b0e5ea1132d1d7cf78c77bc14c686c836a0d25 (diff) | |
download | vim-git-9a13e185e5de95b150555134b34030bd47c4e22b.tar.gz |
patch 8.2.1868: Vim9: no error for missing space after comma in dictv8.2.1868
Problem: Vim9: no error for missing space after comma in dict.
Solution: Check for white space. (closes #6672)
-rw-r--r-- | src/testdir/test_vim9_expr.vim | 1 | ||||
-rw-r--r-- | src/version.c | 2 | ||||
-rw-r--r-- | src/vim9compile.c | 5 |
3 files changed, 8 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim index a4e7c510e..94d23c649 100644 --- 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 index 97a3b71db..90ab88ab6 100644 --- 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 index d9908d30b..cd5e45bc6 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -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); } |