aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-01-07 15:54:46 +0300
committerZyX <kp-pav@yandex.ru>2017-01-07 15:54:55 +0300
commit9a09ffa883ea34d07405af9617201958e5a4c861 (patch)
treed6b1f02be75d974ce8bd6931fcd98e40f2dd97e5 /src/nvim/eval
parent88a4820cc9f6764b285eef239e103e4fc39c5667 (diff)
downloadrneovim-9a09ffa883ea34d07405af9617201958e5a4c861.tar.gz
rneovim-9a09ffa883ea34d07405af9617201958e5a4c861.tar.bz2
rneovim-9a09ffa883ea34d07405af9617201958e5a4c861.zip
eval: Fix failing test
Diffstat (limited to 'src/nvim/eval')
-rw-r--r--src/nvim/eval/encode.c6
-rw-r--r--src/nvim/eval/typval_encode.c.h15
2 files changed, 21 insertions, 0 deletions
diff --git a/src/nvim/eval/encode.c b/src/nvim/eval/encode.c
index 48741abea2..ee66b7cf09 100644
--- a/src/nvim/eval/encode.c
+++ b/src/nvim/eval/encode.c
@@ -385,6 +385,8 @@ int encode_read_from_list(ListReaderState *const state, char *const buf,
#define TYPVAL_ENCODE_CONV_DICT_START(tv, dict, len) \
ga_append(gap, '{')
+#define TYPVAL_ENCODE_CONV_REAL_DICT_AFTER_START(tv, dict, mpsv)
+
#define TYPVAL_ENCODE_CONV_DICT_END(tv, dict) \
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_UNSIGNED_NUMBER
#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_AFTER_KEY
#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) \
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_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_UNSIGNED_NUMBER
#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_AFTER_KEY
#undef TYPVAL_ENCODE_CONV_DICT_BETWEEN_ITEMS
diff --git a/src/nvim/eval/typval_encode.c.h b/src/nvim/eval/typval_encode.c.h
index bade067ea6..365eb2dd77 100644
--- a/src/nvim/eval/typval_encode.c.h
+++ b/src/nvim/eval/typval_encode.c.h
@@ -152,6 +152,9 @@
/// @def TYPVAL_ENCODE_CONV_DICT_START
/// @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
/// point to a special dictionary.
/// @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
/// 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
/// @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;
}
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 {
TYPVAL_ENCODE_CONV_FUNC_BEFORE_SELF(tv, -1);
}