diff options
author | Eduardo Julian | 2019-04-19 01:27:10 -0400 |
---|---|---|
committer | Eduardo Julian | 2019-04-19 01:27:10 -0400 |
commit | 0ed7cb3a7d07cf92be57a8f26355212bcee0325d (patch) | |
tree | 935d5ff38d6494971b2d2661e60513401a94cf26 /stdlib/source/lux/data/format/json.lux | |
parent | 692f9751f36fbfc4a5f1148c7b1fadc03495fa6b (diff) |
Renamed both "Poly" and "Lexer" to "Parser" in order to normalize naming a bit.
Diffstat (limited to 'stdlib/source/lux/data/format/json.lux')
-rw-r--r-- | stdlib/source/lux/data/format/json.lux | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/stdlib/source/lux/data/format/json.lux b/stdlib/source/lux/data/format/json.lux index beb5eca8d..162cf8387 100644 --- a/stdlib/source/lux/data/format/json.lux +++ b/stdlib/source/lux/data/format/json.lux @@ -7,8 +7,8 @@ codec] [control pipe - ["p" parser (#+ Parser) ("#@." monad) - ["l" text]] + ["p" parser ("#@." monad) + ["l" text (#+ Parser)]] ["ex" exception (#+ exception:)]] [data ["." bit] @@ -53,7 +53,7 @@ (type: #export (Reader a) {#.doc "JSON reader."} - (Parser (List JSON) a)) + (p.Parser (List JSON) a)) (syntax: #export (json token) {#.doc (doc "A simple way to produce JSON literals." @@ -436,22 +436,22 @@ ############################################################ (def: space~ - (l.Lexer Text) + (Parser Text) (l.some l.space)) (def: data-sep - (l.Lexer [Text Any Text]) + (Parser [Text Any Text]) ($_ p.and space~ (l.this ",") space~)) (def: null~ - (l.Lexer Null) + (Parser Null) (do p.monad [_ (l.this "null")] (wrap []))) (template [<name> <token> <value>] [(def: <name> - (l.Lexer Boolean) + (Parser Boolean) (do p.monad [_ (l.this <token>)] (wrap <value>)))] @@ -461,11 +461,11 @@ ) (def: boolean~ - (l.Lexer Boolean) + (Parser Boolean) (p.either true~ false~)) (def: number~ - (l.Lexer Number) + (Parser Number) (do p.monad [signed? (l.this? "-") digits (l.many l.decimal) @@ -487,7 +487,7 @@ (wrap value)))) (def: escaped~ - (l.Lexer Text) + (Parser Text) ($_ p.either (p.after (l.this "\t") (p@wrap text.tab)) @@ -505,7 +505,7 @@ (p@wrap "\")))) (def: string~ - (l.Lexer String) + (Parser String) (<| (l.enclosed [text.double-quote text.double-quote]) (loop [_ []]) (do p.monad @@ -519,7 +519,7 @@ (wrap chars)))) (def: (kv~ json~) - (-> (-> Any (l.Lexer JSON)) (l.Lexer [String JSON])) + (-> (-> Any (Parser JSON)) (Parser [String JSON])) (do p.monad [key string~ _ space~ @@ -530,7 +530,7 @@ (template [<name> <type> <open> <close> <elem-parser> <prep>] [(def: (<name> json~) - (-> (-> Any (l.Lexer JSON)) (l.Lexer <type>)) + (-> (-> Any (Parser JSON)) (Parser <type>)) (do p.monad [_ (l.this <open>) _ space~ @@ -544,7 +544,7 @@ ) (def: (json~' _) - (-> Any (l.Lexer JSON)) + (-> Any (Parser JSON)) ($_ p.or null~ boolean~ number~ string~ (array~ json~') (object~ json~'))) (structure: #export codec (Codec Text JSON) |