aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/encode.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/eval/encode.c')
-rw-r--r--src/nvim/eval/encode.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/nvim/eval/encode.c b/src/nvim/eval/encode.c
index 869eae74a3..57507f4430 100644
--- a/src/nvim/eval/encode.c
+++ b/src/nvim/eval/encode.c
@@ -315,6 +315,13 @@ int encode_read_from_list(ListReaderState *const state, char *const buf,
ga_append(gap, ')'); \
} while (0)
+#define TYPVAL_ENCODE_CONV_PARTIAL(partial) \
+ do { \
+ ga_concat(gap, "partial("); \
+ TYPVAL_ENCODE_CONV_STRING(partial, STRLEN(partial)); \
+ ga_append(gap, ')'); \
+ } while (0)
+
#define TYPVAL_ENCODE_CONV_EMPTY_LIST() \
ga_concat(gap, "[]")
@@ -661,6 +668,12 @@ static inline int convert_to_json_string(garray_T *const gap,
"attempt to dump function reference"), \
mpstack, objname)
+#undef TYPVAL_ENCODE_CONV_PARTIAL
+#define TYPVAL_ENCODE_CONV_PARTIAL(partial) \
+ return conv_error(_("E474: Error while dumping %s, %s: " \
+ "attempt to dump partial"), \
+ mpstack, objname)
+
/// Check whether given key can be used in json_encode()
///
/// @param[in] tv Key to check.
@@ -718,6 +731,7 @@ TYPVAL_ENCODE_DEFINE_CONV_FUNCTIONS(static, json, garray_T *const, gap)
#undef TYPVAL_ENCODE_CONV_NUMBER
#undef TYPVAL_ENCODE_CONV_FLOAT
#undef TYPVAL_ENCODE_CONV_FUNC
+#undef TYPVAL_ENCODE_CONV_PARTIAL
#undef TYPVAL_ENCODE_CONV_EMPTY_LIST
#undef TYPVAL_ENCODE_CONV_LIST_START
#undef TYPVAL_ENCODE_CONV_EMPTY_DICT
@@ -846,6 +860,11 @@ char *encode_tv2json(typval_T *tv, size_t *len)
"attempt to dump function reference"), \
mpstack, objname)
+#define TYPVAL_ENCODE_CONV_PARTIAL(partial) \
+ return conv_error(_("E951: Error while dumping %s, %s: " \
+ "attempt to dump partial"), \
+ mpstack, objname)
+
#define TYPVAL_ENCODE_CONV_EMPTY_LIST() \
msgpack_pack_array(packer, 0)
@@ -902,6 +921,7 @@ TYPVAL_ENCODE_DEFINE_CONV_FUNCTIONS(, msgpack, msgpack_packer *const, packer)
#undef TYPVAL_ENCODE_CONV_NUMBER
#undef TYPVAL_ENCODE_CONV_FLOAT
#undef TYPVAL_ENCODE_CONV_FUNC
+#undef TYPVAL_ENCODE_CONV_PARTIAL
#undef TYPVAL_ENCODE_CONV_EMPTY_LIST
#undef TYPVAL_ENCODE_CONV_LIST_START
#undef TYPVAL_ENCODE_CONV_EMPTY_DICT