To: vim_dev@googlegroups.com Subject: Patch 8.2.2486 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2486 Problem: Vim9: some errors for white space do not show context. Solution: Include the text at the error. Files: src/errors.h, src/dict.c, src/list.c, src/userfunc.c, src/vim9compile.c, src/vim9type.c *** ../vim-8.2.2485/src/errors.h 2021-02-07 16:05:43.833488594 +0100 --- src/errors.h 2021-02-07 18:04:02.215125349 +0100 *************** *** 173,180 **** INIT(= N_("E1066: Cannot declare a register: %s")); EXTERN char e_separator_mismatch_str[] INIT(= N_("E1067: Separator mismatch: %s")); ! EXTERN char e_no_white_space_allowed_before_str[] ! INIT(= N_("E1068: No white space allowed before '%s'")); EXTERN char e_white_space_required_after_str_str[] INIT(= N_("E1069: White space required after '%s': %s")); EXTERN char e_missing_from[] --- 173,180 ---- INIT(= N_("E1066: Cannot declare a register: %s")); EXTERN char e_separator_mismatch_str[] INIT(= N_("E1067: Separator mismatch: %s")); ! EXTERN char e_no_white_space_allowed_before_str_str[] ! INIT(= N_("E1068: No white space allowed before '%s': %s")); EXTERN char e_white_space_required_after_str_str[] INIT(= N_("E1069: White space required after '%s': %s")); EXTERN char e_missing_from[] *** ../vim-8.2.2485/src/dict.c 2021-02-07 15:28:05.792508596 +0100 --- src/dict.c 2021-02-07 18:00:49.919703993 +0100 *************** *** 945,951 **** if (**arg != ':') { if (*skipwhite(*arg) == ':') ! semsg(_(e_no_white_space_allowed_before_str), ":"); else semsg(_(e_missing_dict_colon), *arg); clear_tv(&tvkey); --- 945,951 ---- if (**arg != ':') { if (*skipwhite(*arg) == ':') ! semsg(_(e_no_white_space_allowed_before_str_str), ":", *arg); else semsg(_(e_missing_dict_colon), *arg); clear_tv(&tvkey); *************** *** 1025,1031 **** if (!had_comma) { if (**arg == ',') ! semsg(_(e_no_white_space_allowed_before_str), ","); else semsg(_(e_missing_dict_comma), *arg); goto failret; --- 1025,1031 ---- if (!had_comma) { if (**arg == ',') ! semsg(_(e_no_white_space_allowed_before_str_str), ",", *arg); else semsg(_(e_missing_dict_comma), *arg); goto failret; *** ../vim-8.2.2485/src/list.c 2021-02-07 15:28:05.792508596 +0100 --- src/list.c 2021-02-07 18:01:16.027625714 +0100 *************** *** 1328,1334 **** if (do_error) { if (**arg == ',') ! semsg(_(e_no_white_space_allowed_before_str), ","); else semsg(_("E696: Missing comma in List: %s"), *arg); } --- 1328,1335 ---- if (do_error) { if (**arg == ',') ! semsg(_(e_no_white_space_allowed_before_str_str), ! ",", *arg); else semsg(_("E696: Missing comma in List: %s"), *arg); } *** ../vim-8.2.2485/src/userfunc.c 2021-02-07 15:59:44.438603736 +0100 --- src/userfunc.c 2021-02-07 18:02:09.143466132 +0100 *************** *** 878,884 **** { if (*argp != ',' && *skipwhite(argp) == ',') { ! semsg(_(e_no_white_space_allowed_before_str), ","); ret = FAIL; break; } --- 878,884 ---- { if (*argp != ',' && *skipwhite(argp) == ',') { ! semsg(_(e_no_white_space_allowed_before_str_str), ",", argp); ret = FAIL; break; } *************** *** 3214,3220 **** if ((vim9script || eap->cmdidx == CMD_def) && VIM_ISWHITE(p[-1])) { ! semsg(_(e_no_white_space_allowed_before_str), "("); goto ret_free; } --- 3214,3220 ---- if ((vim9script || eap->cmdidx == CMD_def) && VIM_ISWHITE(p[-1])) { ! semsg(_(e_no_white_space_allowed_before_str_str), "(", p - 1); goto ret_free; } *** ../vim-8.2.2485/src/vim9compile.c 2021-02-07 16:33:27.972066714 +0100 --- src/vim9compile.c 2021-02-07 18:03:23.439242377 +0100 *************** *** 2800,2806 **** if (*p != ',' && *skipwhite(p) == ',') { ! semsg(_(e_no_white_space_allowed_before_str), ","); p = skipwhite(p); } if (*p == ',') --- 2800,2806 ---- if (*p != ',' && *skipwhite(p) == ',') { ! semsg(_(e_no_white_space_allowed_before_str_str), ",", p); p = skipwhite(p); } if (*p == ',') *************** *** 3055,3061 **** } if (*p == ',') { ! semsg(_(e_no_white_space_allowed_before_str), ","); return FAIL; } if (*p == ']') --- 3055,3061 ---- } if (*p == ',') { ! semsg(_(e_no_white_space_allowed_before_str_str), ",", p); return FAIL; } if (*p == ']') *************** *** 3234,3240 **** if (**arg != ':') { if (*skipwhite(*arg) == ':') ! semsg(_(e_no_white_space_allowed_before_str), ":"); else semsg(_(e_missing_dict_colon), *arg); return FAIL; --- 3234,3240 ---- if (**arg != ':') { if (*skipwhite(*arg) == ':') ! semsg(_(e_no_white_space_allowed_before_str_str), ":", *arg); else semsg(_(e_missing_dict_colon), *arg); return FAIL; *************** *** 3273,3279 **** } if (IS_WHITE_OR_NUL(*whitep)) { ! semsg(_(e_no_white_space_allowed_before_str), ","); return FAIL; } whitep = *arg + 1; --- 3273,3279 ---- } if (IS_WHITE_OR_NUL(*whitep)) { ! semsg(_(e_no_white_space_allowed_before_str_str), ",", whitep); return FAIL; } whitep = *arg + 1; *************** *** 4270,4276 **** if (**arg != '>') { if (*skipwhite(*arg) == '>') ! semsg(_(e_no_white_space_allowed_before_str), ">"); else emsg(_(e_missing_gt)); return FAIL; --- 4270,4276 ---- if (**arg != '>') { if (*skipwhite(*arg) == '>') ! semsg(_(e_no_white_space_allowed_before_str_str), ">", *arg); else emsg(_(e_missing_gt)); return FAIL; *** ../vim-8.2.2485/src/vim9type.c 2021-02-07 15:28:05.792508596 +0100 --- src/vim9type.c 2021-02-07 18:03:50.671160199 +0100 *************** *** 638,644 **** if (give_error) { if (*skipwhite(*arg) == '<') ! semsg(_(e_no_white_space_allowed_before_str), "<"); else emsg(_(e_missing_type)); } --- 638,644 ---- if (give_error) { if (*skipwhite(*arg) == '<') ! semsg(_(e_no_white_space_allowed_before_str_str), "<", *arg); else emsg(_(e_missing_type)); } *************** *** 779,785 **** if (*p != ',' && *skipwhite(p) == ',') { if (give_error) ! semsg(_(e_no_white_space_allowed_before_str), ","); return NULL; } if (*p == ',') --- 779,786 ---- if (*p != ',' && *skipwhite(p) == ',') { if (give_error) ! semsg(_(e_no_white_space_allowed_before_str_str), ! ",", p); return NULL; } if (*p == ',') *** ../vim-8.2.2485/src/version.c 2021-02-07 17:17:54.739378027 +0100 --- src/version.c 2021-02-07 17:59:45.679896137 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2486, /**/ -- GUARD #2: It could be carried by an African swallow! GUARD #1: Oh, yeah, an African swallow maybe, but not a European swallow, that's my point. GUARD #2: Oh, yeah, I agree with that... The Quest for the Holy Grail (Monty Python) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///