--- /dev/null
+IN: json
+USING: help.markup help.syntax ;
+
+ARTICLE: "json" "JSON serialization"
+{ $subsection "json.reader" }
+{ $subsection "json.writer" } ;
+
+ABOUT: "json"
IN: json
+USE: vocabs.loader
SINGLETON: json-null
+
+"json.reader" require
+"json.writer" require
USING: help.markup help.syntax ;
IN: json.reader
-HELP: json> ( string -- object )
+HELP: json>
{ $values { "string" "a string in JSON format" } { "object" "a deserialized object" } }
{ $description "Deserializes the JSON formatted string into a Factor object. JSON objects are converted to Factor hashtables. All other JSON objects convert to their obvious Factor equivalents." } ;
: grammar-list>vector ( seq -- vec ) first2 values swap prefix ;
-PRIVATE>
-
! Grammar for JSON from RFC 4627
-EBNF: json>
+EBNF: (json>)
ws = (" " | "\r" | "\t" | "\n")*
value = ws val:v ws => [[ v ]]
-;EBNF
\ No newline at end of file
+;EBNF
+
+PRIVATE>
+
+: json> ( string -- object ) (json>) ;
\ No newline at end of file