Mercurial > vim
comparison src/userfunc.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 | 950875545045 |
children | 9ddf1a537fc2 |
comparison
equal
deleted
inserted
replaced
23876:50f3627e6740 | 23877:85cf06ddb2a8 |
---|---|
124 if (*p == ':') | 124 if (*p == ':') |
125 { | 125 { |
126 ++p; | 126 ++p; |
127 if (!skip && !VIM_ISWHITE(*p)) | 127 if (!skip && !VIM_ISWHITE(*p)) |
128 { | 128 { |
129 semsg(_(e_white_space_required_after_str), ":"); | 129 semsg(_(e_white_space_required_after_str_str), ":", p - 1); |
130 return arg; | 130 return arg; |
131 } | 131 } |
132 type = skipwhite(p); | 132 type = skipwhite(p); |
133 p = skip_type(type, TRUE); | 133 p = skip_type(type, TRUE); |
134 if (!skip) | 134 if (!skip) |
295 // Don't give this error when skipping, it makes the "->" not | 295 // Don't give this error when skipping, it makes the "->" not |
296 // found in "{k,v -> x}" and give a confusing error. | 296 // found in "{k,v -> x}" and give a confusing error. |
297 if (!skip && in_vim9script() | 297 if (!skip && in_vim9script() |
298 && !IS_WHITE_OR_NUL(*p) && *p != endchar) | 298 && !IS_WHITE_OR_NUL(*p) && *p != endchar) |
299 { | 299 { |
300 semsg(_(e_white_space_required_after_str), ","); | 300 semsg(_(e_white_space_required_after_str_str), ",", p - 1); |
301 goto err_ret; | 301 goto err_ret; |
302 } | 302 } |
303 } | 303 } |
304 else | 304 else |
305 mustend = TRUE; | 305 mustend = TRUE; |
485 if (*s == ':') | 485 if (*s == ':') |
486 { | 486 { |
487 if (white_error != NULL && !VIM_ISWHITE(s[1])) | 487 if (white_error != NULL && !VIM_ISWHITE(s[1])) |
488 { | 488 { |
489 *white_error = TRUE; | 489 *white_error = TRUE; |
490 semsg(_(e_white_space_required_after_str), ":"); | 490 semsg(_(e_white_space_required_after_str_str), ":", s); |
491 return NULL; | 491 return NULL; |
492 } | 492 } |
493 s = skipwhite(s + 1); | 493 s = skipwhite(s + 1); |
494 *ret_type = s; | 494 *ret_type = s; |
495 s = skip_type(s, TRUE); | 495 s = skip_type(s, TRUE); |
882 argp = skipwhite(argp); | 882 argp = skipwhite(argp); |
883 if (*argp != ',') | 883 if (*argp != ',') |
884 break; | 884 break; |
885 if (vim9script && !IS_WHITE_OR_NUL(argp[1])) | 885 if (vim9script && !IS_WHITE_OR_NUL(argp[1])) |
886 { | 886 { |
887 semsg(_(e_white_space_required_after_str), ","); | 887 semsg(_(e_white_space_required_after_str_str), ",", argp); |
888 ret = FAIL; | 888 ret = FAIL; |
889 break; | 889 break; |
890 } | 890 } |
891 } | 891 } |
892 argp = skipwhite_and_linebreak(argp, evalarg); | 892 argp = skipwhite_and_linebreak(argp, evalarg); |