comparison src/vim9compile.c @ 23877:85cf06ddb2a8 v8.2.2480

patch 8.2.2480: Vim9: some errors for white space do not show context Commit: https://github.com/vim/vim/commit/c3fc75db023f2acd0b82b7eebffd7ed89e8001ed Author: Bram Moolenaar <Bram@vim.org> Date: Sun Feb 7 15:28:09 2021 +0100 patch 8.2.2480: Vim9: some errors for white space do not show context Problem: Vim9: some errors for white space do not show context. Solution: Include the text at the error.
author Bram Moolenaar <Bram@vim.org>
date Sun, 07 Feb 2021 15:30:03 +0100
parents cd91a892aa44
children a4df35126d9c
comparison
equal deleted inserted replaced
23876:50f3627e6740 23877:85cf06ddb2a8
2805 } 2805 }
2806 if (*p == ',') 2806 if (*p == ',')
2807 { 2807 {
2808 ++p; 2808 ++p;
2809 if (*p != NUL && !VIM_ISWHITE(*p)) 2809 if (*p != NUL && !VIM_ISWHITE(*p))
2810 semsg(_(e_white_space_required_after_str), ","); 2810 semsg(_(e_white_space_required_after_str_str), ",", p - 1);
2811 } 2811 }
2812 else 2812 else
2813 must_end = TRUE; 2813 must_end = TRUE;
2814 whitep = p; 2814 whitep = p;
2815 p = skipwhite(p); 2815 p = skipwhite(p);
3071 if (*p == ',') 3071 if (*p == ',')
3072 { 3072 {
3073 ++p; 3073 ++p;
3074 if (*p != ']' && !IS_WHITE_OR_NUL(*p)) 3074 if (*p != ']' && !IS_WHITE_OR_NUL(*p))
3075 { 3075 {
3076 semsg(_(e_white_space_required_after_str), ","); 3076 semsg(_(e_white_space_required_after_str_str), ",", p - 1);
3077 return FAIL; 3077 return FAIL;
3078 } 3078 }
3079 } 3079 }
3080 whitep = p; 3080 whitep = p;
3081 p = skipwhite(p); 3081 p = skipwhite(p);
3240 return FAIL; 3240 return FAIL;
3241 } 3241 }
3242 whitep = *arg + 1; 3242 whitep = *arg + 1;
3243 if (!IS_WHITE_OR_NUL(*whitep)) 3243 if (!IS_WHITE_OR_NUL(*whitep))
3244 { 3244 {
3245 semsg(_(e_white_space_required_after_str), ":"); 3245 semsg(_(e_white_space_required_after_str_str), ":", *arg);
3246 return FAIL; 3246 return FAIL;
3247 } 3247 }
3248 3248
3249 if (may_get_next_line(whitep, arg, cctx) == FAIL) 3249 if (may_get_next_line(whitep, arg, cctx) == FAIL)
3250 { 3250 {
3277 return FAIL; 3277 return FAIL;
3278 } 3278 }
3279 whitep = *arg + 1; 3279 whitep = *arg + 1;
3280 if (!IS_WHITE_OR_NUL(*whitep)) 3280 if (!IS_WHITE_OR_NUL(*whitep))
3281 { 3281 {
3282 semsg(_(e_white_space_required_after_str), ","); 3282 semsg(_(e_white_space_required_after_str_str), ",", *arg);
3283 return FAIL; 3283 return FAIL;
3284 } 3284 }
3285 *arg = skipwhite(*arg + 1); 3285 *arg = skipwhite(whitep);
3286 } 3286 }
3287 3287
3288 *arg = *arg + 1; 3288 *arg = *arg + 1;
3289 3289
3290 // Allow for following comment, after at least one space. 3290 // Allow for following comment, after at least one space.
5709 char_u *p; 5709 char_u *p;
5710 5710
5711 // parse optional type: "let var: type = expr" 5711 // parse optional type: "let var: type = expr"
5712 if (!VIM_ISWHITE(var_end[1])) 5712 if (!VIM_ISWHITE(var_end[1]))
5713 { 5713 {
5714 semsg(_(e_white_space_required_after_str), ":"); 5714 semsg(_(e_white_space_required_after_str_str), ":", var_end);
5715 return FAIL; 5715 return FAIL;
5716 } 5716 }
5717 p = skipwhite(var_end + 1); 5717 p = skipwhite(var_end + 1);
5718 lhs->lhs_type = parse_type(&p, cctx->ctx_type_list, TRUE); 5718 lhs->lhs_type = parse_type(&p, cctx->ctx_type_list, TRUE);
5719 if (lhs->lhs_type == NULL) 5719 if (lhs->lhs_type == NULL)