mirror of
https://github.com/neovim/neovim.git
synced 2025-09-21 10:48:18 +00:00
eval/typval_encode: Provide proper values as dict argument
This commit is contained in:
@@ -552,6 +552,7 @@ _convert_one_value_regular_dict:
|
|||||||
.data = {
|
.data = {
|
||||||
.d = {
|
.d = {
|
||||||
.dict = tv->vval.v_dict,
|
.dict = tv->vval.v_dict,
|
||||||
|
.dictp = &tv->vval.v_dict,
|
||||||
.hi = tv->vval.v_dict->dv_hashtab.ht_array,
|
.hi = tv->vval.v_dict->dv_hashtab.ht_array,
|
||||||
.todo = tv->vval.v_dict->dv_hashtab.ht_used,
|
.todo = tv->vval.v_dict->dv_hashtab.ht_used,
|
||||||
},
|
},
|
||||||
@@ -602,12 +603,12 @@ TYPVAL_ENCODE_SCOPE int _TYPVAL_ENCODE_ENCODE(
|
|||||||
if (!cur_mpsv->data.d.todo) {
|
if (!cur_mpsv->data.d.todo) {
|
||||||
(void)_mp_pop(mpstack);
|
(void)_mp_pop(mpstack);
|
||||||
cur_mpsv->data.d.dict->dv_copyID = copyID - 1;
|
cur_mpsv->data.d.dict->dv_copyID = copyID - 1;
|
||||||
TYPVAL_ENCODE_CONV_DICT_END(cur_mpsv->tv, cur_mpsv->tv->vval.v_dict);
|
TYPVAL_ENCODE_CONV_DICT_END(cur_mpsv->tv, *cur_mpsv->data.d.dictp);
|
||||||
continue;
|
continue;
|
||||||
} else if (cur_mpsv->data.d.todo
|
} else if (cur_mpsv->data.d.todo
|
||||||
!= cur_mpsv->data.d.dict->dv_hashtab.ht_used) {
|
!= cur_mpsv->data.d.dict->dv_hashtab.ht_used) {
|
||||||
TYPVAL_ENCODE_CONV_DICT_BETWEEN_ITEMS(cur_mpsv->tv,
|
TYPVAL_ENCODE_CONV_DICT_BETWEEN_ITEMS(cur_mpsv->tv,
|
||||||
cur_mpsv->tv->vval.v_dict);
|
*cur_mpsv->data.d.dictp);
|
||||||
}
|
}
|
||||||
while (HASHITEM_EMPTY(cur_mpsv->data.d.hi)) {
|
while (HASHITEM_EMPTY(cur_mpsv->data.d.hi)) {
|
||||||
cur_mpsv->data.d.hi++;
|
cur_mpsv->data.d.hi++;
|
||||||
@@ -618,7 +619,7 @@ TYPVAL_ENCODE_SCOPE int _TYPVAL_ENCODE_ENCODE(
|
|||||||
TYPVAL_ENCODE_CONV_STR_STRING(NULL, &di->di_key[0],
|
TYPVAL_ENCODE_CONV_STR_STRING(NULL, &di->di_key[0],
|
||||||
strlen((char *)&di->di_key[0]));
|
strlen((char *)&di->di_key[0]));
|
||||||
TYPVAL_ENCODE_CONV_DICT_AFTER_KEY(cur_mpsv->tv,
|
TYPVAL_ENCODE_CONV_DICT_AFTER_KEY(cur_mpsv->tv,
|
||||||
cur_mpsv->tv->vval.v_dict);
|
*cur_mpsv->data.d.dictp);
|
||||||
tv = &di->di_tv;
|
tv = &di->di_tv;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -709,6 +710,7 @@ TYPVAL_ENCODE_SCOPE int _TYPVAL_ENCODE_ENCODE(
|
|||||||
.data = {
|
.data = {
|
||||||
.d = {
|
.d = {
|
||||||
.dict = dict,
|
.dict = dict,
|
||||||
|
.dictp = &pt->pt_dict,
|
||||||
.hi = dict->dv_hashtab.ht_array,
|
.hi = dict->dv_hashtab.ht_array,
|
||||||
.todo = dict->dv_hashtab.ht_used,
|
.todo = dict->dv_hashtab.ht_used,
|
||||||
},
|
},
|
||||||
|
@@ -192,6 +192,9 @@ typedef struct {
|
|||||||
union {
|
union {
|
||||||
struct {
|
struct {
|
||||||
dict_T *dict; ///< Currently converted dictionary.
|
dict_T *dict; ///< Currently converted dictionary.
|
||||||
|
dict_T **dictp; ///< Location where that dictionary is stored.
|
||||||
|
///< Normally it is &.tv->vval.v_dict, but not when
|
||||||
|
///< converting partials.
|
||||||
hashitem_T *hi; ///< Currently converted dictionary item.
|
hashitem_T *hi; ///< Currently converted dictionary item.
|
||||||
size_t todo; ///< Amount of items left to process.
|
size_t todo; ///< Amount of items left to process.
|
||||||
} d; ///< State of dictionary conversion.
|
} d; ///< State of dictionary conversion.
|
||||||
|
Reference in New Issue
Block a user