|
@@ -1,15 +1,13 @@
|
|
-// Encoding and decoding JSON in strict `JSON`, `JSON5` and `BitSquid` variants.
|
|
|
|
-package encoding_json
|
|
|
|
-
|
|
|
|
-import "core:strings"
|
|
|
|
-
|
|
|
|
/*
|
|
/*
|
|
- JSON
|
|
|
|
|
|
+Encoding and decoding JSON in strict `JSON`, `JSON5` and `BitSquid` variants.
|
|
|
|
+
|
|
|
|
+Using one of these `Specification`s.
|
|
|
|
+ JSON
|
|
strict JSON
|
|
strict JSON
|
|
- JSON5
|
|
|
|
|
|
+ JSON5
|
|
pure superset of JSON and valid JavaScript
|
|
pure superset of JSON and valid JavaScript
|
|
https://json5.org/
|
|
https://json5.org/
|
|
-
|
|
|
|
|
|
+
|
|
* Object keys may be an ECMAScript 5.1 IdentifierName.
|
|
* Object keys may be an ECMAScript 5.1 IdentifierName.
|
|
* Objects may have a single trailing comma.
|
|
* Objects may have a single trailing comma.
|
|
* Arrays may have a single trailing comma.
|
|
* Arrays may have a single trailing comma.
|
|
@@ -22,17 +20,21 @@ import "core:strings"
|
|
* Numbers may begin with an explicit plus sign.
|
|
* Numbers may begin with an explicit plus sign.
|
|
* Single and multi-line comments are allowed.
|
|
* Single and multi-line comments are allowed.
|
|
* Additional white space characters are allowed.
|
|
* Additional white space characters are allowed.
|
|
-
|
|
|
|
|
|
+
|
|
MJSON
|
|
MJSON
|
|
pure superset of JSON5, may not be valid JavaScript
|
|
pure superset of JSON5, may not be valid JavaScript
|
|
https://bitsquid.blogspot.com/2009/10/simplified-json-notation.html
|
|
https://bitsquid.blogspot.com/2009/10/simplified-json-notation.html
|
|
-
|
|
|
|
|
|
+
|
|
* All the same features as JSON5 plus extras.
|
|
* All the same features as JSON5 plus extras.
|
|
* Assume an object definition at the root level (no need to surround entire file with { } ).
|
|
* Assume an object definition at the root level (no need to surround entire file with { } ).
|
|
* Commas are optional, using comma insertion rules with newlines.
|
|
* Commas are optional, using comma insertion rules with newlines.
|
|
* Quotes around object keys are optional if the keys are valid identifiers.
|
|
* Quotes around object keys are optional if the keys are valid identifiers.
|
|
* : can be replaced with =
|
|
* : can be replaced with =
|
|
*/
|
|
*/
|
|
|
|
+package encoding_json
|
|
|
|
+
|
|
|
|
+import "core:strings"
|
|
|
|
+
|
|
Specification :: enum {
|
|
Specification :: enum {
|
|
JSON,
|
|
JSON,
|
|
JSON5, // https://json5.org/
|
|
JSON5, // https://json5.org/
|