From 7444deb1b80d469280fcb0684d91c13f752a86d6 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 28 Nov 2020 21:40:29 -0400 Subject: Re-named "_.claim" to "_.cover'". --- stdlib/source/lux/data/format/json.lux | 62 +++++++++++++++++----------------- 1 file changed, 31 insertions(+), 31 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 a5611a7c3..5f46f997e 100644 --- a/stdlib/source/lux/data/format/json.lux +++ b/stdlib/source/lux/data/format/json.lux @@ -10,19 +10,19 @@ [control pipe ["." try (#+ Try)] - ["<>" parser ("#@." monad) + ["<>" parser ("#\." monad) ["<.>" text (#+ Parser)]]] [data ["." bit] ["." maybe] ["." product] - ["." text ("#@." equivalence monoid)] + ["." text ("#\." equivalence monoid)] [number ["n" nat] - ["f" frac ("#@." decimal)]] + ["f" frac ("#\." decimal)]] [collection - ["." list ("#@." fold functor)] - ["." row (#+ Row row) ("#@." monad)] + ["." list ("#\." fold functor)] + ["." row (#+ Row row) ("#\." monad)] ["." dictionary (#+ Dictionary)]]] [macro [syntax (#+ syntax:)] @@ -86,7 +86,7 @@ (wrap (list (` (: JSON #..Null)))) [_ (#.Tuple members)] - (wrap (list (` (: JSON (#..Array ((~! row) (~+ (list@map wrapper members)))))))) + (wrap (list (` (: JSON (#..Array ((~! row) (~+ (list\map wrapper members)))))))) [_ (#.Record pairs)] (do {! ..monad} @@ -114,7 +114,7 @@ (#try.Success (dictionary.keys obj)) _ - (#try.Failure ($_ text@compose "Cannot get the fields of a non-object.")))) + (#try.Failure ($_ text\compose "Cannot get the fields of a non-object.")))) (def: #export (get key json) {#.doc "A JSON object field getter."} @@ -126,10 +126,10 @@ (#try.Success value) #.None - (#try.Failure ($_ text@compose "Missing field '" key "' on object."))) + (#try.Failure ($_ text\compose "Missing field '" key "' on object."))) _ - (#try.Failure ($_ text@compose "Cannot get field '" key "' on a non-object.")))) + (#try.Failure ($_ text\compose "Cannot get field '" key "' on a non-object.")))) (def: #export (set key value json) {#.doc "A JSON object field setter."} @@ -139,18 +139,18 @@ (#try.Success (#Object (dictionary.put key value obj))) _ - (#try.Failure ($_ text@compose "Cannot set field '" key "' on a non-object.")))) + (#try.Failure ($_ text\compose "Cannot set field '" key "' on a non-object.")))) (template [ ] [(def: #export ( key json) - {#.doc (code.text ($_ text@compose "A JSON object field getter for " "."))} + {#.doc (code.text ($_ text\compose "A JSON object field getter for " "."))} (-> Text JSON (Try )) (case (get key json) (#try.Success ( value)) (#try.Success value) (#try.Success _) - (#try.Failure ($_ text@compose "Wrong value type at key: " key)) + (#try.Failure ($_ text\compose "Wrong value type at key: " key)) (#try.Failure error) (#try.Failure error)))] @@ -179,7 +179,7 @@ [(#Array xs) (#Array ys)] (and (n.= (row.size xs) (row.size ys)) - (list@fold (function (_ idx prev) + (list\fold (function (_ idx prev) (and prev (maybe.default #0 (do maybe.monad @@ -191,7 +191,7 @@ [(#Object xs) (#Object ys)] (and (n.= (dictionary.size xs) (dictionary.size ys)) - (list@fold (function (_ [xk xv] prev) + (list\fold (function (_ [xk xv] prev) (and prev (case (dictionary.get xk ys) #.None #0 @@ -226,7 +226,7 @@ (|> raw (text.split 1) maybe.assume product.right)))))) (def: escape "\") -(def: escaped-dq (text@compose ..escape text.double-quote)) +(def: escaped-dq (text\compose ..escape text.double-quote)) (def: format-string (-> String Text) @@ -250,14 +250,14 @@ (def: (format-array format) (-> (-> JSON Text) (-> Array Text)) - (|>> (row@map format) + (|>> (row\map format) row.to-list (text.join-with ..separator) (text.enclose [..open-array ..close-array]))) (def: (format-kv format [key value]) (-> (-> JSON Text) (-> [String JSON] Text)) - ($_ text@compose + ($_ text\compose (..format-string key) ..entry-separator (format value) @@ -266,7 +266,7 @@ (def: (format-object format) (-> (-> JSON Text) (-> Object Text)) (|>> dictionary.entries - (list@map (..format-kv format)) + (list\map (..format-kv format)) (text.join-with ..separator) (text.enclose [..open-object ..close-object]))) @@ -336,8 +336,8 @@ [mark (.one-of "eE") signed?' (<>.parses? (.this "-")) offset (.many .decimal)] - (wrap ($_ text@compose mark (if signed?' "-" "") offset))))] - (case (f@decode ($_ text@compose (if signed? "-" "") digits "." decimals exp)) + (wrap ($_ text\compose mark (if signed?' "-" "") offset))))] + (case (f\decode ($_ text\compose (if signed? "-" "") digits "." decimals exp)) (#try.Failure message) (<>.fail message) @@ -348,32 +348,32 @@ (Parser Text) ($_ <>.either (<>.after (.this "\t") - (<>@wrap text.tab)) + (<>\wrap text.tab)) (<>.after (.this "\b") - (<>@wrap text.back-space)) + (<>\wrap text.back-space)) (<>.after (.this "\n") - (<>@wrap text.new-line)) + (<>\wrap text.new-line)) (<>.after (.this "\r") - (<>@wrap text.carriage-return)) + (<>\wrap text.carriage-return)) (<>.after (.this "\f") - (<>@wrap text.form-feed)) - (<>.after (.this (text@compose "\" text.double-quote)) - (<>@wrap text.double-quote)) + (<>\wrap text.form-feed)) + (<>.after (.this (text\compose "\" text.double-quote)) + (<>\wrap text.double-quote)) (<>.after (.this "\\") - (<>@wrap "\")))) + (<>\wrap "\")))) (def: parse-string (Parser String) (<| (.enclosed [text.double-quote text.double-quote]) (loop [_ []]) (do {! <>.monad} - [chars (.some (.none-of (text@compose "\" text.double-quote))) + [chars (.some (.none-of (text\compose "\" text.double-quote))) stop .peek]) - (if (text@= "\" stop) + (if (text\= "\" stop) (do ! [escaped parse-escaped next-chars (recur [])] - (wrap ($_ text@compose chars escaped next-chars))) + (wrap ($_ text\compose chars escaped next-chars))) (wrap chars)))) (def: (parse-kv parse-json) -- cgit v1.2.3