From 81385d85aa9b1641dcda7a16427e9ae730ff61d8 Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Tue, 10 Apr 2018 15:23:06 -0400 Subject: [PATCH] json is not javascript. --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index ddf9f4d8f..7136077fd 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,11 @@ Inspiring links: - The JSON spec defines what a JSON parser is: > A JSON parser transforms a JSON text into another representation. A JSON parser MUST accept all texts that conform to the JSON grammar. A JSON parser MAY accept non-JSON forms or extensions. An implementation may set limits on the size of texts that it accepts. An implementation may set limits on the maximum depth of nesting. An implementation may set limits on the range and precision of numbers. An implementation may set limits on the length and character contents of strings." + +- JSON is not JavaScript: + +> All JSON is Javascript but NOT all Javascript is JSON. So {property:1} is invalid because property does not have double quotes around it. {'property':1} is also invalid, because it's single quoted while the only thing that can placate the JSON specification is double quoting. JSON is even fussy enough that {"property":.1} is invalid too, because you should have of course written {"property":0.1}. Also, don't even think about having comments or semicolons, you guessed it: they're invalid. (credit:https://github.com/elzr/vim-json) + - The structural characters are: