mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
eval: Fix failing test
This commit is contained in:
parent
88a4820cc9
commit
9a09ffa883
@ -429,6 +429,8 @@ static inline void typval_encode_dict_start(EncodedData *const edata,
|
|||||||
#define TYPVAL_ENCODE_CONV_DICT_START(tv, dict, len) \
|
#define TYPVAL_ENCODE_CONV_DICT_START(tv, dict, len) \
|
||||||
typval_encode_dict_start(edata, (size_t)(len))
|
typval_encode_dict_start(edata, (size_t)(len))
|
||||||
|
|
||||||
|
#define TYPVAL_ENCODE_CONV_REAL_DICT_AFTER_START(tv, dict, mpsv)
|
||||||
|
|
||||||
#define TYPVAL_ENCODE_SPECIAL_DICT_KEY_CHECK(label, kv_pair)
|
#define TYPVAL_ENCODE_SPECIAL_DICT_KEY_CHECK(label, kv_pair)
|
||||||
|
|
||||||
static inline void typval_encode_after_key(EncodedData *const edata)
|
static inline void typval_encode_after_key(EncodedData *const edata)
|
||||||
@ -507,6 +509,7 @@ static inline void typval_encode_dict_end(EncodedData *const edata)
|
|||||||
#undef TYPVAL_ENCODE_CONV_BOOL
|
#undef TYPVAL_ENCODE_CONV_BOOL
|
||||||
#undef TYPVAL_ENCODE_CONV_UNSIGNED_NUMBER
|
#undef TYPVAL_ENCODE_CONV_UNSIGNED_NUMBER
|
||||||
#undef TYPVAL_ENCODE_CONV_DICT_START
|
#undef TYPVAL_ENCODE_CONV_DICT_START
|
||||||
|
#undef TYPVAL_ENCODE_CONV_REAL_DICT_AFTER_START
|
||||||
#undef TYPVAL_ENCODE_CONV_DICT_END
|
#undef TYPVAL_ENCODE_CONV_DICT_END
|
||||||
#undef TYPVAL_ENCODE_CONV_DICT_AFTER_KEY
|
#undef TYPVAL_ENCODE_CONV_DICT_AFTER_KEY
|
||||||
#undef TYPVAL_ENCODE_CONV_DICT_BETWEEN_ITEMS
|
#undef TYPVAL_ENCODE_CONV_DICT_BETWEEN_ITEMS
|
||||||
|
@ -19185,9 +19185,9 @@ static inline void _nothing_conv_list_end(typval_T *const tv)
|
|||||||
}
|
}
|
||||||
#define TYPVAL_ENCODE_CONV_LIST_END(tv) _nothing_conv_list_end(tv)
|
#define TYPVAL_ENCODE_CONV_LIST_END(tv) _nothing_conv_list_end(tv)
|
||||||
|
|
||||||
static inline int _nothing_conv_dict_start(typval_T *const tv,
|
static inline int _nothing_conv_real_dict_after_start(
|
||||||
dict_T **const dictp,
|
typval_T *const tv, dict_T **const dictp, const void *const nodictvar,
|
||||||
const void *const nodictvar)
|
MPConvStackVal *const mpsv)
|
||||||
FUNC_ATTR_ALWAYS_INLINE FUNC_ATTR_WARN_UNUSED_RESULT
|
FUNC_ATTR_ALWAYS_INLINE FUNC_ATTR_WARN_UNUSED_RESULT
|
||||||
{
|
{
|
||||||
if (tv != NULL) {
|
if (tv != NULL) {
|
||||||
@ -19196,15 +19196,18 @@ static inline int _nothing_conv_dict_start(typval_T *const tv,
|
|||||||
if ((const void *)dictp != nodictvar && (*dictp)->dv_refcount > 1) {
|
if ((const void *)dictp != nodictvar && (*dictp)->dv_refcount > 1) {
|
||||||
(*dictp)->dv_refcount--;
|
(*dictp)->dv_refcount--;
|
||||||
*dictp = NULL;
|
*dictp = NULL;
|
||||||
|
mpsv->data.d.todo = 0;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
return NOTDONE;
|
return NOTDONE;
|
||||||
}
|
}
|
||||||
#define TYPVAL_ENCODE_CONV_DICT_START(tv, dict, len) \
|
#define TYPVAL_ENCODE_CONV_DICT_START(tv, dict, len)
|
||||||
|
|
||||||
|
#define TYPVAL_ENCODE_CONV_REAL_DICT_AFTER_START(tv, dict, mpsv) \
|
||||||
do { \
|
do { \
|
||||||
if (_nothing_conv_dict_start(tv, (dict_T **)&dict, \
|
if (_nothing_conv_real_dict_after_start( \
|
||||||
(void *)&TYPVAL_ENCODE_NODICT_VAR) \
|
tv, (dict_T **)&dict, (void *)&TYPVAL_ENCODE_NODICT_VAR, \
|
||||||
!= NOTDONE) { \
|
&mpsv) != NOTDONE) { \
|
||||||
goto typval_encode_stop_converting_one_item; \
|
goto typval_encode_stop_converting_one_item; \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
@ -19259,6 +19262,7 @@ static inline void _nothing_conv_dict_end(typval_T *const tv,
|
|||||||
#undef TYPVAL_ENCODE_CONV_LIST_BETWEEN_ITEMS
|
#undef TYPVAL_ENCODE_CONV_LIST_BETWEEN_ITEMS
|
||||||
#undef TYPVAL_ENCODE_CONV_LIST_END
|
#undef TYPVAL_ENCODE_CONV_LIST_END
|
||||||
#undef TYPVAL_ENCODE_CONV_DICT_START
|
#undef TYPVAL_ENCODE_CONV_DICT_START
|
||||||
|
#undef TYPVAL_ENCODE_CONV_REAL_DICT_AFTER_START
|
||||||
#undef TYPVAL_ENCODE_SPECIAL_DICT_KEY_CHECK
|
#undef TYPVAL_ENCODE_SPECIAL_DICT_KEY_CHECK
|
||||||
#undef TYPVAL_ENCODE_CONV_DICT_AFTER_KEY
|
#undef TYPVAL_ENCODE_CONV_DICT_AFTER_KEY
|
||||||
#undef TYPVAL_ENCODE_CONV_DICT_BETWEEN_ITEMS
|
#undef TYPVAL_ENCODE_CONV_DICT_BETWEEN_ITEMS
|
||||||
|
@ -385,6 +385,8 @@ int encode_read_from_list(ListReaderState *const state, char *const buf,
|
|||||||
#define TYPVAL_ENCODE_CONV_DICT_START(tv, dict, len) \
|
#define TYPVAL_ENCODE_CONV_DICT_START(tv, dict, len) \
|
||||||
ga_append(gap, '{')
|
ga_append(gap, '{')
|
||||||
|
|
||||||
|
#define TYPVAL_ENCODE_CONV_REAL_DICT_AFTER_START(tv, dict, mpsv)
|
||||||
|
|
||||||
#define TYPVAL_ENCODE_CONV_DICT_END(tv, dict) \
|
#define TYPVAL_ENCODE_CONV_DICT_END(tv, dict) \
|
||||||
ga_append(gap, '}')
|
ga_append(gap, '}')
|
||||||
|
|
||||||
@ -797,6 +799,7 @@ bool encode_check_json_key(const typval_T *const tv)
|
|||||||
#undef TYPVAL_ENCODE_CONV_BOOL
|
#undef TYPVAL_ENCODE_CONV_BOOL
|
||||||
#undef TYPVAL_ENCODE_CONV_UNSIGNED_NUMBER
|
#undef TYPVAL_ENCODE_CONV_UNSIGNED_NUMBER
|
||||||
#undef TYPVAL_ENCODE_CONV_DICT_START
|
#undef TYPVAL_ENCODE_CONV_DICT_START
|
||||||
|
#undef TYPVAL_ENCODE_CONV_REAL_DICT_AFTER_START
|
||||||
#undef TYPVAL_ENCODE_CONV_DICT_END
|
#undef TYPVAL_ENCODE_CONV_DICT_END
|
||||||
#undef TYPVAL_ENCODE_CONV_DICT_AFTER_KEY
|
#undef TYPVAL_ENCODE_CONV_DICT_AFTER_KEY
|
||||||
#undef TYPVAL_ENCODE_CONV_DICT_BETWEEN_ITEMS
|
#undef TYPVAL_ENCODE_CONV_DICT_BETWEEN_ITEMS
|
||||||
@ -959,6 +962,8 @@ char *encode_tv2json(typval_T *tv, size_t *len)
|
|||||||
#define TYPVAL_ENCODE_CONV_DICT_START(tv, dict, len) \
|
#define TYPVAL_ENCODE_CONV_DICT_START(tv, dict, len) \
|
||||||
msgpack_pack_map(packer, (size_t)(len))
|
msgpack_pack_map(packer, (size_t)(len))
|
||||||
|
|
||||||
|
#define TYPVAL_ENCODE_CONV_REAL_DICT_AFTER_START(tv, dict, mpsv)
|
||||||
|
|
||||||
#define TYPVAL_ENCODE_CONV_DICT_END(tv, dict)
|
#define TYPVAL_ENCODE_CONV_DICT_END(tv, dict)
|
||||||
|
|
||||||
#define TYPVAL_ENCODE_CONV_DICT_AFTER_KEY(tv, dict)
|
#define TYPVAL_ENCODE_CONV_DICT_AFTER_KEY(tv, dict)
|
||||||
@ -1005,6 +1010,7 @@ char *encode_tv2json(typval_T *tv, size_t *len)
|
|||||||
#undef TYPVAL_ENCODE_CONV_BOOL
|
#undef TYPVAL_ENCODE_CONV_BOOL
|
||||||
#undef TYPVAL_ENCODE_CONV_UNSIGNED_NUMBER
|
#undef TYPVAL_ENCODE_CONV_UNSIGNED_NUMBER
|
||||||
#undef TYPVAL_ENCODE_CONV_DICT_START
|
#undef TYPVAL_ENCODE_CONV_DICT_START
|
||||||
|
#undef TYPVAL_ENCODE_CONV_REAL_DICT_AFTER_START
|
||||||
#undef TYPVAL_ENCODE_CONV_DICT_END
|
#undef TYPVAL_ENCODE_CONV_DICT_END
|
||||||
#undef TYPVAL_ENCODE_CONV_DICT_AFTER_KEY
|
#undef TYPVAL_ENCODE_CONV_DICT_AFTER_KEY
|
||||||
#undef TYPVAL_ENCODE_CONV_DICT_BETWEEN_ITEMS
|
#undef TYPVAL_ENCODE_CONV_DICT_BETWEEN_ITEMS
|
||||||
|
@ -152,6 +152,9 @@
|
|||||||
/// @def TYPVAL_ENCODE_CONV_DICT_START
|
/// @def TYPVAL_ENCODE_CONV_DICT_START
|
||||||
/// @brief Macros used before starting to convert non-empty dictionary
|
/// @brief Macros used before starting to convert non-empty dictionary
|
||||||
///
|
///
|
||||||
|
/// Only used for real dict_T* dictionaries, not for special dictionaries. Also
|
||||||
|
/// used for partial self dictionary.
|
||||||
|
///
|
||||||
/// @param tv Pointer to typval where dictionary is stored. May be NULL. May
|
/// @param tv Pointer to typval where dictionary is stored. May be NULL. May
|
||||||
/// point to a special dictionary.
|
/// point to a special dictionary.
|
||||||
/// @param dict Converted dictionary, lvalue or #TYPVAL_ENCODE_NODICT_VAR
|
/// @param dict Converted dictionary, lvalue or #TYPVAL_ENCODE_NODICT_VAR
|
||||||
@ -159,6 +162,14 @@
|
|||||||
/// @param len Dictionary length. Is an expression which evaluates to an
|
/// @param len Dictionary length. Is an expression which evaluates to an
|
||||||
/// integer.
|
/// integer.
|
||||||
|
|
||||||
|
/// @def TYPVAL_ENCODE_CONV_REAL_DICT_AFTER_START
|
||||||
|
/// @brief Macros used after pushing dictionary onto the stack
|
||||||
|
///
|
||||||
|
/// @param tv Pointer to typval where dictionary is stored. May be NULL.
|
||||||
|
/// May not point to a special dictionary.
|
||||||
|
/// @param dict Converted dictionary, lvalue.
|
||||||
|
/// @param mpsv Pushed MPConvStackVal value.
|
||||||
|
|
||||||
/// @def TYPVAL_ENCODE_SPECIAL_DICT_KEY_CHECK
|
/// @def TYPVAL_ENCODE_SPECIAL_DICT_KEY_CHECK
|
||||||
/// @brief Macros used to check special dictionary key
|
/// @brief Macros used to check special dictionary key
|
||||||
///
|
///
|
||||||
@ -575,6 +586,8 @@ _convert_one_value_regular_dict:
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
TYPVAL_ENCODE_CONV_REAL_DICT_AFTER_START(tv, tv->vval.v_dict,
|
||||||
|
_mp_last(*mpstack));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case VAR_UNKNOWN: {
|
case VAR_UNKNOWN: {
|
||||||
@ -743,6 +756,8 @@ typval_encode_stop_converting_one_item:
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
TYPVAL_ENCODE_CONV_REAL_DICT_AFTER_START(NULL, pt->pt_dict,
|
||||||
|
_mp_last(mpstack));
|
||||||
} else {
|
} else {
|
||||||
TYPVAL_ENCODE_CONV_FUNC_BEFORE_SELF(tv, -1);
|
TYPVAL_ENCODE_CONV_FUNC_BEFORE_SELF(tv, -1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user