Comment #1 on issue 383 by [email protected]: Add support for marshalling JSON
https://code.google.com/p/vim/issues/detail?id=383

`null` is usually parsed in as zero, not as an empty string (depends on the plugin author obviously; I use zero, same does NeoVim for msgpack Nil). tojson/fromjson names break usual naming: it is mostly either get/set{smth} (getline/setline, etc) or {smth}{action} (foldopen, foldclose, …), so jsondump/parse are better. To dump/parse null, true, false unambigiously I propose a second argument: a dictionary looking like

    :let specialsdict = {'null': {}, 'true': {}, 'false': {}}
    :echo jsonparse("true", specialsdict) is# specialdicts.true
    1
    :echo jsondump([specialsdict.null, {}, 0, ''], specialsdict)
    [null, {}, 0, ""]

Note that 99% of JSON you may parse with eval like in VAM (it has a regex that verifies that parsing is safe). But you don’t get normal errors in this case. It also does not work with surrogate pairs.

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui