d36c4f2159b8 — Chris Cannam v1.0.0 7 years ago
Doc updates
2 files changed, 23 insertions(+), 13 deletions(-)

M README
M json.sml
M README +8 -5
@@ 2,10 2,13 @@ 
 Simple Standard ML JSON parser
 ==============================
 
-An RFC-compliant JSON parser in one SML file with no dependency on
-anything outside the Basis library. Also includes a simple serialiser.
+https://bitbucket.org/cannam/sml-simplejson
 
-Tested with MLton, Poly/ML, and SML/NJ.
+An RFC-compliant JSON parser in one SML file (json.sml) with no
+dependency on anything outside the Basis library. Also includes a
+simple serialiser.
+
+Tested with MLton, Poly/ML, and SML/NJ compilers.
 
 Parser notes:
 

          
@@ 16,8 19,8 @@ Parser notes:
    exist at the time of writing, as listed in "Parsing JSON is a
    Minefield" (http://seriot.ch/parsing_json.php)
  
- * Two-pass parser using naive exploded strings, therefore not very
-   fast and not suitable for large input files
+ * Two-pass parser using naive exploded strings, therefore not
+   particularly fast and not suitable for large input files
 
  * Only supports UTF-8 input, not UTF-16 or UTF-32. Doesn't check
    that JSON strings are valid UTF-8 -- the caller must do that --

          
M json.sml +15 -8
@@ 1,8 1,15 @@ 
 
-(* An RFC-compliant JSON parser in one SML file with no dependency 
+(* Simple Standard ML JSON parser
+   ==============================
+
+   https://bitbucket.org/cannam/sml-simplejson
+
+   An RFC-compliant JSON parser in one SML file with no dependency 
    on anything outside the Basis library. Also includes a simple
    serialiser.
 
+   Tested with MLton, Poly/ML, and SML/NJ compilers.
+
    Parser notes:
 
    * Complies with RFC 7159, The JavaScript Object Notation (JSON)

          
@@ 12,8 19,8 @@ 
      exist at the time of writing, as listed in "Parsing JSON is a
      Minefield" (http://seriot.ch/parsing_json.php)
  
-   * Two-pass parser using naive exploded strings, therefore not very
-     fast and not suitable for large input files
+   * Two-pass parser using naive exploded strings, therefore not
+     particularly fast and not suitable for large input files
 
    * Only supports UTF-8 input, not UTF-16 or UTF-32. Doesn't check
      that JSON strings are valid UTF-8 -- the caller must do that --

          
@@ 23,10 30,8 @@ 
      float type (common but not guaranteed in SML) then we're pretty
      standard for a JSON parser
 
-   Some of this is based on the JSON parser in the Ponyo library by
-   Phil Eaton.
-
    Copyright 2017 Chris Cannam.
+   Parts based on the JSON parser in the Ponyo library by Phil Eaton.
 
    Permission is hereby granted, free of charge, to any person
    obtaining a copy of this software and associated documentation

          
@@ 284,8 289,10 @@ structure Json :> JSON = struct
               | parseObject' acc tokens =
                 case parsePair tokens of
                     ERROR e => ERROR e
-                  | OK (pair, T.COMMA :: xs) => parseObject' (pair :: acc) xs
-                  | OK (pair, T.CURLY_R :: xs) => OK (OBJECT (rev (pair :: acc)), xs)
+                  | OK (pair, T.COMMA :: xs) =>
+                    parseObject' (pair :: acc) xs
+                  | OK (pair, T.CURLY_R :: xs) =>
+                    OK (OBJECT (rev (pair :: acc)), xs)
                   | OK (_, _) => ERROR "Expected , or } after object element"
         in
             parseObject' [] tokens