summaryrefslogtreecommitdiff
path: root/src/vim9compile.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-08-12 17:35:58 +0200
committerBram Moolenaar <Bram@vim.org>2020-08-12 17:35:58 +0200
commit17a836cbee6b8d8ff555f8e307f48a779908db41 (patch)
treea2c6a927d875e586e9ee3744697e9c77ec167404 /src/vim9compile.c
parented677f5587af366f185f8922b7dde4a98c884328 (diff)
downloadvim-git-17a836cbee6b8d8ff555f8e307f48a779908db41.tar.gz
patch 8.2.1429: Vim9: no error for missing white after : in dictv8.2.1429
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 :.
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r--src/vim9compile.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/vim9compile.c b/src/vim9compile.c
index dfcff508f..502c66f37 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -2593,14 +2593,21 @@ compile_dict(char_u **arg, cctx_T *cctx, int literal)
}
}
- *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)
{