Mercurial > vim
comparison src/list.c @ 21036:f58ee30d863f v8.2.1069
patch 8.2.1069: Vim9: fail to check for white space in list
Commit: https://github.com/vim/vim/commit/e6e031739c9d0c4140e371031b58a249db0eb572
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jun 27 16:36:05 2020 +0200
patch 8.2.1069: Vim9: fail to check for white space in list
Problem: Vim9: fail to check for white space in list.
Solution: Add check for white space.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 27 Jun 2020 16:45:05 +0200 |
parents | 7acceb76669f |
children | 0ca7e04d39e3 |
comparison
equal
deleted
inserted
replaced
21035:4fd89674f6f2 | 21036:f58ee30d863f |
---|---|
1166 : evalarg->eval_flags & EVAL_EVALUATE; | 1166 : evalarg->eval_flags & EVAL_EVALUATE; |
1167 int getnext; | 1167 int getnext; |
1168 list_T *l = NULL; | 1168 list_T *l = NULL; |
1169 typval_T tv; | 1169 typval_T tv; |
1170 listitem_T *item; | 1170 listitem_T *item; |
1171 int vim9script = current_sctx.sc_version == SCRIPT_VERSION_VIM9; | |
1171 int had_comma; | 1172 int had_comma; |
1172 | 1173 |
1173 if (evaluate) | 1174 if (evaluate) |
1174 { | 1175 { |
1175 l = list_alloc(); | 1176 l = list_alloc(); |
1196 } | 1197 } |
1197 else | 1198 else |
1198 clear_tv(&tv); | 1199 clear_tv(&tv); |
1199 } | 1200 } |
1200 | 1201 |
1201 // the comma must comma after the value | 1202 // the comma must come after the value |
1202 had_comma = **arg == ','; | 1203 had_comma = **arg == ','; |
1203 if (had_comma) | 1204 if (had_comma) |
1205 { | |
1206 if (vim9script && (*arg)[1] != NUL && !VIM_ISWHITE((*arg)[1])) | |
1207 { | |
1208 semsg(_(e_white_after), ","); | |
1209 goto failret; | |
1210 } | |
1204 *arg = skipwhite(*arg + 1); | 1211 *arg = skipwhite(*arg + 1); |
1212 } | |
1205 | 1213 |
1206 // the "]" can be on the next line | 1214 // the "]" can be on the next line |
1207 eval_next_non_blank(*arg, evalarg, &getnext); | 1215 eval_next_non_blank(*arg, evalarg, &getnext); |
1208 if (getnext) | 1216 if (getnext) |
1209 *arg = eval_next_line(evalarg); | 1217 *arg = eval_next_line(evalarg); |