0
0
mirror of https://github.com/vim/vim.git synced 2025-09-04 21:33:48 -04:00

patch 9.0.1133: error message names do not match the items

Problem:    Error message names do not match the items.
Solution:   Add "_str" when the text contains "%s".
This commit is contained in:
Bram Moolenaar 2023-01-02 18:10:04 +00:00
parent dc4daa3a39
commit a9fa8c58fb
16 changed files with 62 additions and 59 deletions

View File

@ -982,7 +982,7 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
if (*skipwhite(*arg) == ':') if (*skipwhite(*arg) == ':')
semsg(_(e_no_white_space_allowed_before_str_str), ":", *arg); semsg(_(e_no_white_space_allowed_before_str_str), ":", *arg);
else else
semsg(_(e_missing_colon_in_dictionary), *arg); semsg(_(e_missing_colon_in_dictionary_str), *arg);
clear_tv(&tvkey); clear_tv(&tvkey);
goto failret; goto failret;
} }
@ -1020,7 +1020,7 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
item = dict_find(d, key, -1); item = dict_find(d, key, -1);
if (item != NULL) if (item != NULL)
{ {
semsg(_(e_duplicate_key_in_dictionary), key); semsg(_(e_duplicate_key_in_dictionary_str), key);
clear_tv(&tvkey); clear_tv(&tvkey);
clear_tv(&tv); clear_tv(&tv);
goto failret; goto failret;
@ -1060,7 +1060,7 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
if (**arg == ',') if (**arg == ',')
semsg(_(e_no_white_space_allowed_before_str_str), ",", *arg); semsg(_(e_no_white_space_allowed_before_str_str), ",", *arg);
else else
semsg(_(e_missing_comma_in_dictionary), *arg); semsg(_(e_missing_comma_in_dictionary_str), *arg);
goto failret; goto failret;
} }
} }
@ -1068,7 +1068,7 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
if (**arg != '}') if (**arg != '}')
{ {
if (evalarg != NULL) if (evalarg != NULL)
semsg(_(e_missing_dict_end), *arg); semsg(_(e_missing_dict_end_str), *arg);
failret: failret:
if (d != NULL) if (d != NULL)
dict_free(d); dict_free(d);
@ -1456,7 +1456,7 @@ dict_remove(typval_T *argvars, typval_T *rettv, char_u *arg_errmsg)
di = dict_find(d, key, -1); di = dict_find(d, key, -1);
if (di == NULL) if (di == NULL)
{ {
semsg(_(e_key_not_present_in_dictionary), key); semsg(_(e_key_not_present_in_dictionary_str), key);
return; return;
} }

View File

@ -968,9 +968,9 @@ EXTERN char e_couldnt_find_pattern[]
#ifdef FEAT_SYN_HL #ifdef FEAT_SYN_HL
EXTERN char e_illegal_argument_str_2[] EXTERN char e_illegal_argument_str_2[]
INIT(= N_("E390: Illegal argument: %s")); INIT(= N_("E390: Illegal argument: %s"));
EXTERN char e_no_such_syntax_cluster_1[] EXTERN char e_no_such_syntax_cluster_str_1[]
INIT(= N_("E391: No such syntax cluster: %s")); INIT(= N_("E391: No such syntax cluster: %s"));
EXTERN char e_no_such_syntax_cluster_2[] EXTERN char e_no_such_syntax_cluster_str_2[]
INIT(= N_("E392: No such syntax cluster: %s")); INIT(= N_("E392: No such syntax cluster: %s"));
EXTERN char e_groupthere_not_accepted_here[] EXTERN char e_groupthere_not_accepted_here[]
INIT(= N_("E393: group[t]here not accepted here")); INIT(= N_("E393: group[t]here not accepted here"));
@ -1028,7 +1028,7 @@ EXTERN char e_fg_color_unknown[]
INIT(= N_("E419: FG color unknown")); INIT(= N_("E419: FG color unknown"));
EXTERN char e_bg_color_unknown[] EXTERN char e_bg_color_unknown[]
INIT(= N_("E420: BG color unknown")); INIT(= N_("E420: BG color unknown"));
EXTERN char e_color_name_or_number_not_recognized[] EXTERN char e_color_name_or_number_not_recognized_str[]
INIT(= N_("E421: Color name or number not recognized: %s")); INIT(= N_("E421: Color name or number not recognized: %s"));
EXTERN char e_terminal_code_too_long_str[] EXTERN char e_terminal_code_too_long_str[]
INIT(= N_("E422: Terminal code too long: %s")); INIT(= N_("E422: Terminal code too long: %s"));
@ -1796,7 +1796,7 @@ EXTERN char e_list_required[]
INIT(= N_("E714: List required")); INIT(= N_("E714: List required"));
EXTERN char e_dictionary_required[] EXTERN char e_dictionary_required[]
INIT(= N_("E715: Dictionary required")); INIT(= N_("E715: Dictionary required"));
EXTERN char e_key_not_present_in_dictionary[] EXTERN char e_key_not_present_in_dictionary_str[]
INIT(= N_("E716: Key not present in Dictionary: \"%s\"")); INIT(= N_("E716: Key not present in Dictionary: \"%s\""));
EXTERN char e_dictionary_entry_already_exists[] EXTERN char e_dictionary_entry_already_exists[]
INIT(= N_("E717: Dictionary entry already exists")); INIT(= N_("E717: Dictionary entry already exists"));
@ -1804,13 +1804,13 @@ EXTERN char e_funcref_required[]
INIT(= N_("E718: Funcref required")); INIT(= N_("E718: Funcref required"));
EXTERN char e_cannot_slice_dictionary[] EXTERN char e_cannot_slice_dictionary[]
INIT(= N_("E719: Cannot slice a Dictionary")); INIT(= N_("E719: Cannot slice a Dictionary"));
EXTERN char e_missing_colon_in_dictionary[] EXTERN char e_missing_colon_in_dictionary_str[]
INIT(= N_("E720: Missing colon in Dictionary: %s")); INIT(= N_("E720: Missing colon in Dictionary: %s"));
EXTERN char e_duplicate_key_in_dictionary[] EXTERN char e_duplicate_key_in_dictionary_str[]
INIT(= N_("E721: Duplicate key in Dictionary: \"%s\"")); INIT(= N_("E721: Duplicate key in Dictionary: \"%s\""));
EXTERN char e_missing_comma_in_dictionary[] EXTERN char e_missing_comma_in_dictionary_str[]
INIT(= N_("E722: Missing comma in Dictionary: %s")); INIT(= N_("E722: Missing comma in Dictionary: %s"));
EXTERN char e_missing_dict_end[] EXTERN char e_missing_dict_end_str[]
INIT(= N_("E723: Missing end of Dictionary '}': %s")); INIT(= N_("E723: Missing end of Dictionary '}': %s"));
EXTERN char e_variable_nested_too_deep_for_displaying[] EXTERN char e_variable_nested_too_deep_for_displaying[]
INIT(= N_("E724: Variable nested too deep for displaying")); INIT(= N_("E724: Variable nested too deep for displaying"));
@ -2111,7 +2111,7 @@ EXTERN char e_undo_number_nr_not_found[]
EXTERN char e_bf_key_init_called_with_empty_password[] EXTERN char e_bf_key_init_called_with_empty_password[]
INIT(= N_("E831: bf_key_init() called with empty password")); INIT(= N_("E831: bf_key_init() called with empty password"));
# ifdef FEAT_PERSISTENT_UNDO # ifdef FEAT_PERSISTENT_UNDO
EXTERN char e_non_encrypted_file_has_encrypted_undo_file[] EXTERN char e_non_encrypted_file_has_encrypted_undo_file_str[]
INIT(= N_("E832: Non-encrypted file has encrypted undo file: %s")); INIT(= N_("E832: Non-encrypted file has encrypted undo file: %s"));
# endif # endif
#else #else
@ -2397,7 +2397,7 @@ EXTERN char e_cannot_use_redir_inside_execute[]
EXTERN char e_buffer_cannot_be_registered[] EXTERN char e_buffer_cannot_be_registered[]
INIT(= N_("E931: Buffer cannot be registered")); INIT(= N_("E931: Buffer cannot be registered"));
#ifdef FEAT_EVAL #ifdef FEAT_EVAL
EXTERN char e_closure_function_should_not_be_at_top_level[] EXTERN char e_closure_function_should_not_be_at_top_level_str[]
INIT(= N_("E932: Closure function should not be at top level: %s")); INIT(= N_("E932: Closure function should not be at top level: %s"));
EXTERN char e_function_was_deleted_str[] EXTERN char e_function_was_deleted_str[]
INIT(= N_("E933: Function was deleted: %s")); INIT(= N_("E933: Function was deleted: %s"));
@ -2513,7 +2513,7 @@ EXTERN char e_property_type_str_already_defined[]
INIT(= N_("E969: Property type %s already defined")); INIT(= N_("E969: Property type %s already defined"));
EXTERN char e_unknown_highlight_group_name_str[] EXTERN char e_unknown_highlight_group_name_str[]
INIT(= N_("E970: Unknown highlight group name: '%s'")); INIT(= N_("E970: Unknown highlight group name: '%s'"));
EXTERN char e_type_not_exist[] EXTERN char e_property_type_str_does_not_exist[]
INIT(= N_("E971: Property type %s does not exist")); INIT(= N_("E971: Property type %s does not exist"));
#endif #endif
#ifdef FEAT_EVAL #ifdef FEAT_EVAL
@ -2634,17 +2634,17 @@ EXTERN char e_invalid_key_str[]
INIT(= N_("E1014: Invalid key: %s")); INIT(= N_("E1014: Invalid key: %s"));
EXTERN char e_name_expected_str[] EXTERN char e_name_expected_str[]
INIT(= N_("E1015: Name expected: %s")); INIT(= N_("E1015: Name expected: %s"));
EXTERN char e_cannot_declare_a_scope_variable[] EXTERN char e_cannot_declare_a_scope_variable_str[]
INIT(= N_("E1016: Cannot declare a %s variable: %s")); INIT(= N_("E1016: Cannot declare a %s variable: %s"));
EXTERN char e_cannot_declare_an_environment_variable[] EXTERN char e_cannot_declare_an_environment_variable_str[]
INIT(= N_("E1016: Cannot declare an environment variable: %s")); INIT(= N_("E1016: Cannot declare an environment variable: %s"));
EXTERN char e_variable_already_declared[] EXTERN char e_variable_already_declared_str[]
INIT(= N_("E1017: Variable already declared: %s")); INIT(= N_("E1017: Variable already declared: %s"));
EXTERN char e_cannot_assign_to_constant[] EXTERN char e_cannot_assign_to_constant_str[]
INIT(= N_("E1018: Cannot assign to a constant: %s")); INIT(= N_("E1018: Cannot assign to a constant: %s"));
EXTERN char e_can_only_concatenate_to_string[] EXTERN char e_can_only_concatenate_to_string[]
INIT(= N_("E1019: Can only concatenate to string")); INIT(= N_("E1019: Can only concatenate to string"));
EXTERN char e_cannot_use_operator_on_new_variable[] EXTERN char e_cannot_use_operator_on_new_variable_str[]
INIT(= N_("E1020: Cannot use an operator on a new variable: %s")); INIT(= N_("E1020: Cannot use an operator on a new variable: %s"));
EXTERN char e_const_requires_a_value[] EXTERN char e_const_requires_a_value[]
INIT(= N_("E1021: Const requires a value")); INIT(= N_("E1021: Const requires a value"));
@ -2674,7 +2674,7 @@ EXTERN char e_missing_catch_or_finally[]
INIT(= N_("E1032: Missing :catch or :finally")); INIT(= N_("E1032: Missing :catch or :finally"));
EXTERN char e_catch_unreachable_after_catch_all[] EXTERN char e_catch_unreachable_after_catch_all[]
INIT(= N_("E1033: Catch unreachable after catch-all")); INIT(= N_("E1033: Catch unreachable after catch-all"));
EXTERN char e_cannot_use_reserved_name[] EXTERN char e_cannot_use_reserved_name_str[]
INIT(= N_("E1034: Cannot use reserved name %s")); INIT(= N_("E1034: Cannot use reserved name %s"));
EXTERN char e_percent_requires_number_arguments[] EXTERN char e_percent_requires_number_arguments[]
// xgettext:no-c-format // xgettext:no-c-format
@ -2713,7 +2713,7 @@ EXTERN char e_colon_required_before_range_str[]
#ifdef FEAT_EVAL #ifdef FEAT_EVAL
EXTERN char e_wrong_argument_type_for_plus[] EXTERN char e_wrong_argument_type_for_plus[]
INIT(= N_("E1051: Wrong argument type for +")); INIT(= N_("E1051: Wrong argument type for +"));
EXTERN char e_cannot_declare_an_option[] EXTERN char e_cannot_declare_an_option_str[]
INIT(= N_("E1052: Cannot declare an option: %s")); INIT(= N_("E1052: Cannot declare an option: %s"));
EXTERN char e_could_not_import_str[] EXTERN char e_could_not_import_str[]
INIT(= N_("E1053: Could not import \"%s\"")); INIT(= N_("E1053: Could not import \"%s\""));
@ -2791,7 +2791,7 @@ EXTERN char e_script_cannot_import_itself[]
INIT(= N_("E1088: Script cannot import itself")); INIT(= N_("E1088: Script cannot import itself"));
EXTERN char e_unknown_variable_str[] EXTERN char e_unknown_variable_str[]
INIT(= N_("E1089: Unknown variable: %s")); INIT(= N_("E1089: Unknown variable: %s"));
EXTERN char e_cannot_assign_to_argument[] EXTERN char e_cannot_assign_to_argument_str[]
INIT(= N_("E1090: Cannot assign to argument %s")); INIT(= N_("E1090: Cannot assign to argument %s"));
EXTERN char e_function_is_not_compiled_str[] EXTERN char e_function_is_not_compiled_str[]
INIT(= N_("E1091: Function is not compiled: %s")); INIT(= N_("E1091: Function is not compiled: %s"));

View File

@ -1183,7 +1183,7 @@ get_lval(
if (vim9script && (flags & GLV_NO_DECL) == 0) if (vim9script && (flags & GLV_NO_DECL) == 0)
{ {
if (!quiet) if (!quiet)
semsg(_(e_variable_already_declared), lp->ll_name); semsg(_(e_variable_already_declared_str), lp->ll_name);
return NULL; return NULL;
} }
@ -1413,7 +1413,7 @@ get_lval(
if (*p == '[' || *p == '.' || unlet) if (*p == '[' || *p == '.' || unlet)
{ {
if (!quiet) if (!quiet)
semsg(_(e_key_not_present_in_dictionary), key); semsg(_(e_key_not_present_in_dictionary_str), key);
clear_tv(&var1); clear_tv(&var1);
return NULL; return NULL;
} }
@ -1717,7 +1717,7 @@ set_var_lval(
{ {
if (op != NULL && *op != '=') if (op != NULL && *op != '=')
{ {
semsg(_(e_key_not_present_in_dictionary), lp->ll_newkey); semsg(_(e_key_not_present_in_dictionary_str), lp->ll_newkey);
return; return;
} }
if (dict_wrong_func_name(lp->ll_tv->vval.v_dict, rettv, if (dict_wrong_func_name(lp->ll_tv->vval.v_dict, rettv,
@ -4968,7 +4968,7 @@ eval_index_inner(
{ {
if (keylen > 0) if (keylen > 0)
key[keylen] = NUL; key[keylen] = NUL;
semsg(_(e_key_not_present_in_dictionary), key); semsg(_(e_key_not_present_in_dictionary_str), key);
} }
return FAIL; return FAIL;
} }

View File

@ -7200,7 +7200,7 @@ f_islocked(typval_T *argvars, typval_T *rettv)
else if (lv.ll_range) else if (lv.ll_range)
emsg(_(e_range_not_allowed)); emsg(_(e_range_not_allowed));
else if (lv.ll_newkey != NULL) else if (lv.ll_newkey != NULL)
semsg(_(e_key_not_present_in_dictionary), lv.ll_newkey); semsg(_(e_key_not_present_in_dictionary_str), lv.ll_newkey);
else if (lv.ll_list != NULL) else if (lv.ll_list != NULL)
// List item. // List item.
rettv->vval.v_number = tv_islocked(&lv.ll_li->li_tv); rettv->vval.v_number = tv_islocked(&lv.ll_li->li_tv);

View File

@ -1111,7 +1111,8 @@ ex_let(exarg_T *eap)
if (vim9script && (flags & ASSIGN_NO_DECL) == 0) if (vim9script && (flags & ASSIGN_NO_DECL) == 0)
{ {
// +=, /=, etc. require an existing variable // +=, /=, etc. require an existing variable
semsg(_(e_cannot_use_operator_on_new_variable), eap->arg); semsg(_(e_cannot_use_operator_on_new_variable_str),
eap->arg);
} }
else if (vim_strchr((char_u *)"+-*/%.", *expr) != NULL) else if (vim_strchr((char_u *)"+-*/%.", *expr) != NULL)
{ {

View File

@ -1091,7 +1091,7 @@ highlight_set_cterm_color(
break; break;
if (i < 0) if (i < 0)
{ {
semsg(_(e_color_name_or_number_not_recognized), key_start); semsg(_(e_color_name_or_number_not_recognized_str), key_start);
return FALSE; return FALSE;
} }

View File

@ -3670,7 +3670,7 @@ syn_cmd_clear(exarg_T *eap, int syncing)
id = syn_scl_namen2id(arg + 1, (int)(arg_end - arg - 1)); id = syn_scl_namen2id(arg + 1, (int)(arg_end - arg - 1));
if (id == 0) if (id == 0)
{ {
semsg(_(e_no_such_syntax_cluster_1), arg); semsg(_(e_no_such_syntax_cluster_str_1), arg);
break; break;
} }
else else
@ -3880,7 +3880,7 @@ syn_cmd_list(
{ {
id = syn_scl_namen2id(arg + 1, (int)(arg_end - arg - 1)); id = syn_scl_namen2id(arg + 1, (int)(arg_end - arg - 1));
if (id == 0) if (id == 0)
semsg(_(e_no_such_syntax_cluster_2), arg); semsg(_(e_no_such_syntax_cluster_str_2), arg);
else else
syn_list_cluster(id - SYNID_CLUSTER); syn_list_cluster(id - SYNID_CLUSTER);
} }

View File

@ -98,7 +98,7 @@ lookup_prop_type(char_u *name, buf_T *buf)
if (type == NULL) if (type == NULL)
type = find_prop_type(name, NULL); type = find_prop_type(name, NULL);
if (type == NULL) if (type == NULL)
semsg(_(e_type_not_exist), name); semsg(_(e_property_type_str_does_not_exist), name);
return type; return type;
} }
@ -1825,7 +1825,7 @@ prop_type_set(typval_T *argvars, int add)
{ {
if (prop == NULL) if (prop == NULL)
{ {
semsg(_(e_type_not_exist), name); semsg(_(e_property_type_str_does_not_exist), name);
return; return;
} }
} }

View File

@ -1923,7 +1923,8 @@ u_read_undo(char_u *name, char_u *hash, char_u *orig_name UNUSED)
#ifdef FEAT_CRYPT #ifdef FEAT_CRYPT
if (*curbuf->b_p_key == NUL) if (*curbuf->b_p_key == NUL)
{ {
semsg(_(e_non_encrypted_file_has_encrypted_undo_file), file_name); semsg(_(e_non_encrypted_file_has_encrypted_undo_file_str),
file_name);
goto error; goto error;
} }
bi.bi_state = crypt_create_from_file(fp, curbuf->b_p_key); bi.bi_state = crypt_create_from_file(fp, curbuf->b_p_key);

View File

@ -4599,7 +4599,8 @@ define_function(
if (!aborting()) if (!aborting())
{ {
if (!eap->skip && fudi.fd_newkey != NULL) if (!eap->skip && fudi.fd_newkey != NULL)
semsg(_(e_key_not_present_in_dictionary), fudi.fd_newkey); semsg(_(e_key_not_present_in_dictionary_str),
fudi.fd_newkey);
vim_free(fudi.fd_newkey); vim_free(fudi.fd_newkey);
return NULL; return NULL;
} }
@ -4847,7 +4848,7 @@ define_function(
p += 7; p += 7;
if (current_funccal == NULL) if (current_funccal == NULL)
{ {
emsg_funcname(e_closure_function_should_not_be_at_top_level, emsg_funcname(e_closure_function_should_not_be_at_top_level_str,
name == NULL ? (char_u *)"" : name); name == NULL ? (char_u *)"" : name);
goto erret; goto erret;
} }
@ -6058,7 +6059,7 @@ ex_call(exarg_T *eap)
if (fudi.fd_newkey != NULL) if (fudi.fd_newkey != NULL)
{ {
// Still need to give an error message for missing key. // Still need to give an error message for missing key.
semsg(_(e_key_not_present_in_dictionary), fudi.fd_newkey); semsg(_(e_key_not_present_in_dictionary_str), fudi.fd_newkey);
vim_free(fudi.fd_newkey); vim_free(fudi.fd_newkey);
} }
if (tofree == NULL) if (tofree == NULL)

View File

@ -695,6 +695,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1133,
/**/ /**/
1132, 1132,
/**/ /**/

View File

@ -1035,7 +1035,7 @@ compile_for(char_u *arg_start, cctx_T *cctx)
goto failed; goto failed;
if (lookup_local(arg, varlen, NULL, cctx) == OK) if (lookup_local(arg, varlen, NULL, cctx) == OK)
{ {
semsg(_(e_variable_already_declared), arg); semsg(_(e_variable_already_declared_str), arg);
goto failed; goto failed;
} }

View File

@ -1314,15 +1314,15 @@ vim9_declare_error(char_u *name)
case 'w': scope = _("window"); break; case 'w': scope = _("window"); break;
case 't': scope = _("tab"); break; case 't': scope = _("tab"); break;
case 'v': scope = "v:"; break; case 'v': scope = "v:"; break;
case '$': semsg(_(e_cannot_declare_an_environment_variable), name); case '$': semsg(_(e_cannot_declare_an_environment_variable_str), name);
return; return;
case '&': semsg(_(e_cannot_declare_an_option), name); case '&': semsg(_(e_cannot_declare_an_option_str), name);
return; return;
case '@': semsg(_(e_cannot_declare_a_register_str), name); case '@': semsg(_(e_cannot_declare_a_register_str), name);
return; return;
default: return; default: return;
} }
semsg(_(e_cannot_declare_a_scope_variable), scope, name); semsg(_(e_cannot_declare_a_scope_variable_str), scope, name);
} }
/* /*
@ -1578,7 +1578,7 @@ compile_lhs(
{ {
if (is_decl) if (is_decl)
{ {
semsg(_(e_variable_already_declared), lhs->lhs_name); semsg(_(e_variable_already_declared_str), lhs->lhs_name);
return FAIL; return FAIL;
} }
} }
@ -1748,7 +1748,7 @@ compile_lhs(
if (oplen > 1 && !heredoc) if (oplen > 1 && !heredoc)
{ {
// +=, /=, etc. require an existing variable // +=, /=, etc. require an existing variable
semsg(_(e_cannot_use_operator_on_new_variable), lhs->lhs_name); semsg(_(e_cannot_use_operator_on_new_variable_str), lhs->lhs_name);
return FAIL; return FAIL;
} }
if (!is_decl || (lhs->lhs_has_index && !has_cmd if (!is_decl || (lhs->lhs_has_index && !has_cmd
@ -1851,14 +1851,14 @@ compile_assign_lhs(
if (!lhs->lhs_has_index && lhs->lhs_lvar == &lhs->lhs_arg_lvar) if (!lhs->lhs_has_index && lhs->lhs_lvar == &lhs->lhs_arg_lvar)
{ {
semsg(_(e_cannot_assign_to_argument), lhs->lhs_name); semsg(_(e_cannot_assign_to_argument_str), lhs->lhs_name);
return FAIL; return FAIL;
} }
if (!is_decl && lhs->lhs_lvar != NULL if (!is_decl && lhs->lhs_lvar != NULL
&& lhs->lhs_lvar->lv_const != ASSIGN_VAR && lhs->lhs_lvar->lv_const != ASSIGN_VAR
&& !lhs->lhs_has_index) && !lhs->lhs_has_index)
{ {
semsg(_(e_cannot_assign_to_constant), lhs->lhs_name); semsg(_(e_cannot_assign_to_constant_str), lhs->lhs_name);
return FAIL; return FAIL;
} }
return OK; return OK;

View File

@ -229,12 +229,11 @@ exe_newdict(int count, ectx_T *ectx)
// have already checked key type is VAR_STRING // have already checked key type is VAR_STRING
tv = STACK_TV_BOT(2 * (idx - count)); tv = STACK_TV_BOT(2 * (idx - count));
// check key is unique // check key is unique
key = tv->vval.v_string == NULL key = tv->vval.v_string == NULL ? (char_u *)"" : tv->vval.v_string;
? (char_u *)"" : tv->vval.v_string;
item = dict_find(dict, key, -1); item = dict_find(dict, key, -1);
if (item != NULL) if (item != NULL)
{ {
semsg(_(e_duplicate_key_in_dictionary), key); semsg(_(e_duplicate_key_in_dictionary_str), key);
dict_unref(dict); dict_unref(dict);
return MAYBE; return MAYBE;
} }
@ -2386,8 +2385,7 @@ execute_unletindex(isn_T *iptr, ectx_T *ectx)
if (di == NULL) if (di == NULL)
{ {
// NULL dict is equivalent to empty dict // NULL dict is equivalent to empty dict
semsg(_(e_key_not_present_in_dictionary), semsg(_(e_key_not_present_in_dictionary_str), key);
key);
status = FAIL; status = FAIL;
} }
else if (var_check_fixed(di->di_flags, else if (var_check_fixed(di->di_flags,
@ -5103,7 +5101,7 @@ exec_instructions(ectx_T *ectx)
if ((di = dict_find(dict, key, -1)) == NULL) if ((di = dict_find(dict, key, -1)) == NULL)
{ {
SOURCING_LNUM = iptr->isn_lnum; SOURCING_LNUM = iptr->isn_lnum;
semsg(_(e_key_not_present_in_dictionary), key); semsg(_(e_key_not_present_in_dictionary_str), key);
// If :silent! is used we will continue, make sure the // If :silent! is used we will continue, make sure the
// stack contents makes sense and the dict stack is // stack contents makes sense and the dict stack is
@ -5146,7 +5144,7 @@ exec_instructions(ectx_T *ectx)
== NULL) == NULL)
{ {
SOURCING_LNUM = iptr->isn_lnum; SOURCING_LNUM = iptr->isn_lnum;
semsg(_(e_key_not_present_in_dictionary), semsg(_(e_key_not_present_in_dictionary_str),
iptr->isn_arg.string); iptr->isn_arg.string);
goto on_error; goto on_error;
} }

View File

@ -1317,7 +1317,7 @@ compile_dict(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
item = dict_find(d, key, -1); item = dict_find(d, key, -1);
if (item != NULL) if (item != NULL)
{ {
semsg(_(e_duplicate_key_in_dictionary), key); semsg(_(e_duplicate_key_in_dictionary_str), key);
goto failret; goto failret;
} }
item = dictitem_alloc(key); item = dictitem_alloc(key);
@ -1335,7 +1335,7 @@ compile_dict(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
if (*skipwhite(*arg) == ':') if (*skipwhite(*arg) == ':')
semsg(_(e_no_white_space_allowed_before_str_str), ":", *arg); semsg(_(e_no_white_space_allowed_before_str_str), ":", *arg);
else else
semsg(_(e_missing_colon_in_dictionary), *arg); semsg(_(e_missing_colon_in_dictionary_str), *arg);
return FAIL; return FAIL;
} }
whitep = *arg + 1; whitep = *arg + 1;
@ -1367,7 +1367,7 @@ compile_dict(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
break; break;
if (**arg != ',') if (**arg != ',')
{ {
semsg(_(e_missing_comma_in_dictionary), *arg); semsg(_(e_missing_comma_in_dictionary_str), *arg);
goto failret; goto failret;
} }
if (IS_WHITE_OR_NUL(*whitep)) if (IS_WHITE_OR_NUL(*whitep))
@ -1398,7 +1398,7 @@ compile_dict(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
failret: failret:
if (*arg == NULL) if (*arg == NULL)
{ {
semsg(_(e_missing_dict_end), _("[end of lines]")); semsg(_(e_missing_dict_end_str), _("[end of lines]"));
*arg = (char_u *)""; *arg = (char_u *)"";
} }
dict_unref(d); dict_unref(d);

View File

@ -1138,7 +1138,7 @@ check_reserved_name(char_u *name, cctx_T *cctx)
&& cctx->ctx_ufunc != NULL && cctx->ctx_ufunc != NULL
&& (cctx->ctx_ufunc->uf_flags & FC_OBJECT))) && (cctx->ctx_ufunc->uf_flags & FC_OBJECT)))
{ {
semsg(_(e_cannot_use_reserved_name), name); semsg(_(e_cannot_use_reserved_name_str), name);
return FAIL; return FAIL;
} }
return OK; return OK;