Hi
Attached patch updates json_decode() help:
- {'1':2} was not a valid JSON example.
JSON spec requires double quotes so it should be
{"1":2}. Sorry, this was my mistake.
- empty JSON expression is accepted
despite not being valid according to the JSON spec.
Regards
Dominique
--
--
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.
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 93958d174..00c3deae6 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -5885,7 +5885,7 @@ json_decode({string}) *json_decode()*
- A trailing comma in an array and object is ignored, e.g.
"[1, 2, ]" is the same as "[1, 2]".
- Integer keys are accepted in objects, e.g. {1:2} is the
- same as {'1':2}.
+ same as {"1":2}.
- More floating point numbers are recognized, e.g. "1." for
"1.0", or "001.2" for "1.2". Special floating point values
"Infinity", "-Infinity" and "NaN" (capitalization ignored)
@@ -5897,6 +5897,8 @@ json_decode({string}) *json_decode()*
- Control characters U+0000 through U+001F which are not
escaped in strings are accepted, e.g. " " (tab
character in string) for "\t".
+ - An empty JSON expression or made of only spaces is accepted
+ and results in v:none.
- Backslash in an invalid 2-character sequence escape is
ignored, e.g. "\a" is decoded as "a".
- A correct surrogate pair in JSON strings should normally be