diff options
author | Eduardo Julian | 2022-04-08 05:42:36 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-04-08 05:42:36 -0400 |
commit | 0d909187d5b9effcd08f533d50af7d29c0d6bfd8 (patch) | |
tree | c50f12c5e47e3db90c3a701b54ee9953da942210 /stdlib/source/library/lux/data/format/json.lux | |
parent | e5e4c2aff562e5c01fefb808d1d68a40f29c9cc5 (diff) |
De-sigil-ification: $
Diffstat (limited to 'stdlib/source/library/lux/data/format/json.lux')
-rw-r--r-- | stdlib/source/library/lux/data/format/json.lux | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/stdlib/source/library/lux/data/format/json.lux b/stdlib/source/library/lux/data/format/json.lux index 2f21d8dc5..1eb7c31fb 100644 --- a/stdlib/source/library/lux/data/format/json.lux +++ b/stdlib/source/library/lux/data/format/json.lux @@ -83,17 +83,17 @@ (<code>.Parser JSON') (<>.rec (function (_ jsonP) - ($_ <>.or - (<code>.form (<>#in [])) - <code>.bit - <code>.frac - <code>.text - (<>#each sequence.of_list - (<code>.tuple (<>.some jsonP))) - (<>#each (dictionary.of_list text.hash) - (<code>.variant (<>.some (<>.and <code>.text jsonP)))) - <code>.any - )))) + (all <>.or + (<code>.form (<>#in [])) + <code>.bit + <code>.frac + <code>.text + (<>#each sequence.of_list + (<code>.tuple (<>.some jsonP))) + (<>#each (dictionary.of_list text.hash) + (<code>.variant (<>.some (<>.and <code>.text jsonP)))) + <code>.any + )))) (def: (jsonF token) (-> JSON' Code) @@ -132,7 +132,7 @@ {try.#Success (dictionary.keys obj)} _ - {try.#Failure ($_ text#composite "Cannot get the fields of a non-object.")})) + {try.#Failure (all text#composite "Cannot get the fields of a non-object.")})) (def: .public (field key json) (-> String JSON (Try JSON)) @@ -143,10 +143,10 @@ {try.#Success value} {.#None} - {try.#Failure ($_ text#composite "Missing field '" key "' on object.")}) + {try.#Failure (all text#composite "Missing field '" key "' on object.")}) _ - {try.#Failure ($_ text#composite "Cannot get field '" key "' on a non-object.")})) + {try.#Failure (all text#composite "Cannot get field '" key "' on a non-object.")})) (def: .public (has key value json) (-> String JSON JSON (Try JSON)) @@ -155,7 +155,7 @@ {try.#Success {#Object (dictionary.has key value obj)}} _ - {try.#Failure ($_ text#composite "Cannot set field '" key "' on a non-object.")})) + {try.#Failure (all text#composite "Cannot set field '" key "' on a non-object.")})) (template [<name> <tag> <type>] [(def: .public (<name> key json) @@ -165,7 +165,7 @@ {try.#Success value} {try.#Success _} - {try.#Failure ($_ text#composite "Wrong value type at key: " key)} + {try.#Failure (all text#composite "Wrong value type at key: " key)} {try.#Failure error} {try.#Failure error}))] @@ -275,11 +275,11 @@ (def: (kv_format format [key value]) (-> (-> JSON Text) (-> [String JSON] Text)) - ($_ text#composite - (..string_format key) - ..entry_separator - (format value) - )) + (all text#composite + (..string_format key) + ..entry_separator + (format value) + )) (def: (object_format format) (-> (-> JSON Text) (-> Object Text)) @@ -312,10 +312,10 @@ (def: value_separator_parser (Parser [Text Any Text]) - ($_ <>.and - ..space_parser - (<text>.this ..value_separator) - ..space_parser)) + (all <>.and + ..space_parser + (<text>.this ..value_separator) + ..space_parser)) (def: null_parser (Parser Null) @@ -336,9 +336,9 @@ (def: boolean_parser (Parser Boolean) - ($_ <>.either - ..true_parser - ..false_parser)) + (all <>.either + ..true_parser + ..false_parser)) (def: number_parser (Parser Number) @@ -354,8 +354,8 @@ [mark (<text>.one_of "eE") signed?' (<>.parses? (<text>.this "-")) offset (<text>.many <text>.decimal)] - (in ($_ text#composite mark (if signed?' "-" "") offset))))] - (case (f#decoded ($_ text#composite (if signed? "-" "") digits "." decimals exp)) + (in (all text#composite mark (if signed?' "-" "") offset))))] + (case (f#decoded (all text#composite (if signed? "-" "") digits "." decimals exp)) {try.#Failure message} (<>.failure message) @@ -364,21 +364,21 @@ (def: escaped_parser (Parser Text) - ($_ <>.either - (<>.after (<text>.this "\t") - (<>#in text.tab)) - (<>.after (<text>.this "\b") - (<>#in text.back_space)) - (<>.after (<text>.this "\n") - (<>#in text.new_line)) - (<>.after (<text>.this "\r") - (<>#in text.carriage_return)) - (<>.after (<text>.this "\f") - (<>#in text.form_feed)) - (<>.after (<text>.this (text#composite "\" text.double_quote)) - (<>#in text.double_quote)) - (<>.after (<text>.this "\\") - (<>#in "\")))) + (all <>.either + (<>.after (<text>.this "\t") + (<>#in text.tab)) + (<>.after (<text>.this "\b") + (<>#in text.back_space)) + (<>.after (<text>.this "\n") + (<>#in text.new_line)) + (<>.after (<text>.this "\r") + (<>#in text.carriage_return)) + (<>.after (<text>.this "\f") + (<>#in text.form_feed)) + (<>.after (<text>.this (text#composite "\" text.double_quote)) + (<>#in text.double_quote)) + (<>.after (<text>.this "\\") + (<>#in "\")))) (def: string_parser (Parser String) @@ -391,7 +391,7 @@ (do ! [escaped escaped_parser next_chars (again [])] - (in ($_ text#composite chars escaped next_chars))) + (in (all text#composite chars escaped next_chars))) (in chars)))) (def: (kv_parser json_parser) @@ -423,13 +423,13 @@ (Parser JSON) (<>.rec (function (_ json_parser) - ($_ <>.or - null_parser - boolean_parser - number_parser - string_parser - (array_parser json_parser) - (object_parser json_parser))))) + (all <>.or + null_parser + boolean_parser + number_parser + string_parser + (array_parser json_parser) + (object_parser json_parser))))) (implementation: .public codec (Codec Text JSON) |