runtime/msgpack: Add support for special values

This commit is contained in:
ZyX
2016-01-31 02:28:53 +03:00
parent d70a322c40
commit 6e5498c3e3
2 changed files with 24 additions and 1 deletions

View File

@@ -356,6 +356,8 @@ let s:MSGPACK_STANDARD_TYPES = {
\type(''): 'binary',
\type([]): 'array',
\type({}): 'map',
\type(v:true): 'boolean',
\type(v:null): 'nil',
\}
""
@@ -379,7 +381,7 @@ endfunction
""
" Dump boolean value.
function s:msgpack_dump_boolean(v) abort
return a:v._VAL ? 'TRUE' : 'FALSE'
return (a:v is v:true || (a:v isnot v:false && a:v._VAL)) ? 'TRUE' : 'FALSE'
endfunction
""