vim-patch:8.2.1111: inconsistent naming of get_list_tv() and eval_dict() (#23086)

Problem:    Inconsistent naming of get_list_tv() and eval_dict().
Solution:   Rename get_list_tv() to eval_list().  Similarly for eval_number(),
            eval_string(), eval_lit_string() and a few others.

9a78e6df17

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq
2023-04-14 19:28:39 +08:00
committed by GitHub
parent c15939c1f7
commit 90efe85a99
3 changed files with 28 additions and 26 deletions

View File

@@ -503,8 +503,7 @@ static const char *list_arg_vars(exarg_T *eap, const char *arg, int *first)
if (tofree != NULL) {
name = tofree;
}
if (get_var_tv(name, len, &tv, NULL, true, false)
== FAIL) {
if (eval_variable(name, len, &tv, NULL, true, false) == FAIL) {
error = true;
} else {
// handle d.key, l[idx], f(expr)
@@ -1076,8 +1075,8 @@ static int do_lock_var(lval_T *lp, char *name_end FUNC_ATTR_UNUSED, exarg_T *eap
/// @param dip non-NULL when typval's dict item is needed
/// @param verbose may give error message
/// @param no_autoload do not use script autoloading
int get_var_tv(const char *name, int len, typval_T *rettv, dictitem_T **dip, bool verbose,
bool no_autoload)
int eval_variable(const char *name, int len, typval_T *rettv, dictitem_T **dip, bool verbose,
bool no_autoload)
{
int ret = OK;
typval_T *tv = NULL;
@@ -1564,7 +1563,7 @@ static void get_var_from(const char *varname, typval_T *rettv, typval_T *deftv,
tv_dict_set_ret(rettv, opts);
done = true;
}
} else if (get_option_tv(&varname, rettv, true) == OK) {
} else if (eval_option(&varname, rettv, true) == OK) {
// Local option
done = true;
}
@@ -1713,7 +1712,7 @@ bool var_exists(const char *var)
if (tofree != NULL) {
name = tofree;
}
n = get_var_tv(name, len, &tv, NULL, false, true) == OK;
n = eval_variable(name, len, &tv, NULL, false, true) == OK;
if (n) {
// Handle d.key, l[idx], f(expr).
n = handle_subscript(&var, &tv, &EVALARG_EVALUATE, false) == OK;