Home Explore Blog CI



neovim

3rd chunk of `runtime/doc/pi_msgpack.txt`
d92629195d460bb706a0504519df93d91487cb0e5e44a8ef0000000100000c73
	`%Y-%m-%dT%H:%M:%S`.

msgpack#int_dict_to_str({msgpack-special-int})	*msgpack#int_dict_to_str()*
	Function which converts |msgpack-special-dict| integer value to
	a hexadecimal value like 0x1234567890ABCDEF (always returns exactly 16
	hexadecimal digits).

msgpack#special_type({msgpack-value})		*msgpack#special_type()*
	Returns zero if {msgpack-value} is not |msgpack-special-dict|.  If it
	is it returns name of the key in |v:msgpack_types| which represents
	{msgpack-value} type.

msgpack#type({msgpack-value})				*msgpack#type()*
	Returns name of the key in |v:msgpack_types| that represents
	{msgpack-value} type.  Never returns zero: this function returns
	msgpack type which will be dumped by |msgpackdump()| should it receive
	a list with single {msgpack-value} as input.

msgpack#deepcopy({msgpack-value})			*msgpack#deepcopy()*
	Like |deepcopy()|, but works correctly with |msgpack-special-dict|
	values.  Plain |deepcopy()| will destroy all types in
	|msgpack-special-dict| values because it will copy _TYPE key values,
	while they should be preserved.

msgpack#string({msgpack-value})				*msgpack#string()*
	Like |string()|, but saves information about msgpack types.  Values
	dumped by msgpack#string may be read back by |msgpack#eval()|.
	Returns is the following:

	- Dictionaries are dumped as "{key1: value1, key2: value2}". Note:
	  msgpack allows any values in keys, so with some
	  |msgpack-special-dict| values |msgpack#string()| may produce even
	  "{{1: 2}: 3, [4]: 5}".
	- Lists are dumped as "[value1, value2]".
	- Strings are dumped as
	  1. `"abc"`: binary string.
	  2. `="abc"`: string.
	  3. `+(10)"ext"`: extension strings (10 may be replaced with any
	     8-bit signed integer).
	  Inside strings the following escape sequences may be present: "\0"
	  (represents NUL byte), "\n" (represents line feed) and "\""
	  (represents double quote).
	- Floating-point and integer values are dumped using |string()| or
	  |msgpack#int_dict_to_str()|.
	- Booleans are dumped as "TRUE" or "FALSE".
	- Nil values are dumped as "NIL".

msgpack#eval({string}, {dict})				*msgpack#eval()*
	Transforms string created by |msgpack#string()| into a value suitable
	for |msgpackdump()|.  Second argument allows adding special values
	that start with head characters (|/\h|) and contain only word
	characters (|/\w|).  Built-in special values are "TRUE", "FALSE",
	"NIL", "nan" and "inf" and they cannot be overridden.  Map values are
	always evaluated to |msgpack-special-dict| values, as well as
	hexadecimal digits.  When evaluating maps order of keys is preserved.

	Note that in addition to regular integer representations that may be
	obtained using |msgpack#string()| msgpack#eval() also supports C-style
	“character” integer constants like `'/'` (equivalent to
	`char2nr('/')`: `47`). This also allows `'\0'` (number is decimal).

							*msgpack#equal*
msgpack#equal({msgpack-value}, {msgpack-value})		*msgpack#equal()*
	Returns 1 if given values are equal, 0 otherwise.  When comparing
	msgpack map values order of keys is ignored.  Comparing
	|msgpack-special-dict| with equivalent non-special-dict value
	evaluates to 1.

 vim:tw=78:ts=8:ft=help:fdm=marker

Title: Msgpack.vim Manual: More Functions for Conversion, Evaluation, and Comparison
Summary
This section describes several more functions within the msgpack.vim plugin, focusing on conversion, evaluation, and comparison. It covers converting special dictionaries to hexadecimal strings, identifying special types, determining msgpack types, deep copying with special dictionary preservation, converting values to strings with type information, evaluating strings back into values, and comparing values for equality, including special dictionary handling.