aboutsummaryrefslogtreecommitdiff
path: root/core/encoding/json
diff options
context:
space:
mode:
authorJeroen van Rijn <Kelimion@users.noreply.github.com>2025-10-10 12:24:28 +0200
committerJeroen van Rijn <Kelimion@users.noreply.github.com>2025-10-10 12:24:28 +0200
commitece213afca742bb91e9328230fd21b6b94c85662 (patch)
treebd53a386f09c717dfb8c1af903e95599a22ca6a5 /core/encoding/json
parent4068eeb5fae3981b34a5e5ae96e7c1b0c0eedc85 (diff)
Render examples.
Diffstat (limited to 'core/encoding/json')
-rw-r--r--core/encoding/json/types.odin22
1 files changed, 12 insertions, 10 deletions
diff --git a/core/encoding/json/types.odin b/core/encoding/json/types.odin
index a5f9daa02..75a66f646 100644
--- a/core/encoding/json/types.odin
+++ b/core/encoding/json/types.odin
@@ -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
- JSON5
+ JSON5
pure superset of JSON and valid JavaScript
https://json5.org/
-
+
* Object keys may be an ECMAScript 5.1 IdentifierName.
* Objects 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.
* Single and multi-line comments are allowed.
* Additional white space characters are allowed.
-
+
MJSON
pure superset of JSON5, may not be valid JavaScript
https://bitsquid.blogspot.com/2009/10/simplified-json-notation.html
-
+
* All the same features as JSON5 plus extras.
* Assume an object definition at the root level (no need to surround entire file with { } ).
* Commas are optional, using comma insertion rules with newlines.
* Quotes around object keys are optional if the keys are valid identifiers.
* : can be replaced with =
*/
+package encoding_json
+
+import "core:strings"
+
Specification :: enum {
JSON,
JSON5, // https://json5.org/