From a2f8078dcc79d7f4aa0f596b08f4402546df5ddb Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 1 Jul 2017 16:09:02 -0400 Subject: - Text no longer has a codec (because the decoding didn't handle unicode escaping). --- stdlib/source/lux/data/format/json.lux | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'stdlib/source/lux/data/format/json.lux') diff --git a/stdlib/source/lux/data/format/json.lux b/stdlib/source/lux/data/format/json.lux index 573849b9e..0ce1b602a 100644 --- a/stdlib/source/lux/data/format/json.lux +++ b/stdlib/source/lux/data/format/json.lux @@ -109,11 +109,11 @@ ## [Values] (def: #hidden (show-null _) (-> Null Text) "null") (do-template [ ] - [(def: (-> Text) (:: encode))] + [(def: (-> Text) )] - [show-boolean Boolean bool;Codec] - [show-number Number number;Codec] - [show-string String text;Codec]) + [show-boolean Boolean (:: bool;Codec encode)] + [show-number Number (:: number;Codec encode)] + [show-string String text;encode]) (def: (show-array show-json elems) (-> (-> JSON Text) (-> Array Text)) @@ -126,7 +126,7 @@ (format "{" (|> object d;entries - (L/map (function [[key value]] (format (:: text;Codec encode key) ":" (show-json value)))) + (L/map (function [[key value]] (format (show-string key) ":" (show-json value)))) (text;join-with ",")) "}")) @@ -395,7 +395,7 @@ [text Text #String "text" id] ) -(do-template [
]
+(do-template [       
]
   [(def: #export ( test json)
      {#;doc (#;TextA (format "Asks whether a JSON value is a "  "."))}
      (->  (Parser Bool))
@@ -415,15 +415,15 @@
          (if (::  = test value)
            (#R;Success [])
            (#R;Error (format "Value mismatch: "
-                             (::  encode test) "=/=" (::  encode value)))))
+                             ( test) "=/=" ( value)))))
 
        _
        (#R;Error (format "JSON value is not a "  ": " (show-json json)))))]
 
-  [bool? bool! Bool bool;Eq   bool;Codec   #Boolean "boolean" id]
-  [int?  int!  Int  number;Eq  number;Codec  #Number  "number"  real-to-int]
-  [real? real! Real number;Eq number;Codec #Number  "number"  id]
-  [text? text! Text text;Eq   text;Codec   #String  "string"  id]
+  [bool? bool! Bool bool;Eq   (:: bool;Codec encode)   #Boolean "boolean" id]
+  [int?  int!  Int  number;Eq  (:: number;Codec encode)  #Number  "number"  real-to-int]
+  [real? real! Real number;Eq (:: number;Codec encode) #Number  "number"  id]
+  [text? text! Text text;Eq   text;encode                         #String  "string"  id]
   )
 
 (def: #export (char json)
-- 
cgit v1.2.3