]> gitweb.factorcode.org Git - factor.git/commitdiff
More JSON tweaks
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Sat, 15 Nov 2008 09:09:57 +0000 (03:09 -0600)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Sat, 15 Nov 2008 09:09:57 +0000 (03:09 -0600)
basis/json/json-docs.factor [new file with mode: 0644]
basis/json/json.factor
basis/json/reader/reader-docs.factor
basis/json/reader/reader.factor

diff --git a/basis/json/json-docs.factor b/basis/json/json-docs.factor
new file mode 100644 (file)
index 0000000..816e723
--- /dev/null
@@ -0,0 +1,8 @@
+IN: json
+USING: help.markup help.syntax ;
+
+ARTICLE: "json" "JSON serialization"
+{ $subsection "json.reader" }
+{ $subsection "json.writer" } ;
+
+ABOUT: "json"
index 08d2590ee7dae727c2c2ee8a836523f957d1e3c1..d7cfc0e5bc1eaf794c5a86f053e151a71c677881 100644 (file)
@@ -1,3 +1,7 @@
 IN: json
+USE: vocabs.loader
 
 SINGLETON: json-null
+
+"json.reader" require
+"json.writer" require
index 4700423db5958da67cf779376702f0a8a8d0091f..4446c385d3424085c06291a5fe53a5ca580d6f60 100644 (file)
@@ -3,7 +3,7 @@
 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." } ;
 
index f1520a927253e4ac66b0c40e3a07a0b8d8f4c04c..0014ba1eb19d9491254d093308d3223b33d606e7 100644 (file)
@@ -9,10 +9,8 @@ IN: json.reader
 
 : grammar-list>vector ( seq -- vec ) first2 values swap prefix ;
 
-PRIVATE>
-
 ! Grammar for JSON from RFC 4627
-EBNF: json>
+EBNF: (json>)
 
 ws = (" " | "\r" | "\t" | "\n")*
 
@@ -56,4 +54,8 @@ val = true
 
 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