diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/data/format/xml.lux | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/stdlib/source/lux/data/format/xml.lux b/stdlib/source/lux/data/format/xml.lux index 5e92de080..a990e6901 100644 --- a/stdlib/source/lux/data/format/xml.lux +++ b/stdlib/source/lux/data/format/xml.lux @@ -10,17 +10,17 @@ ["." number] ["E" error] ["." product] - ["." ident ("ident/." Equivalence<Ident> Codec<Text,Ident>)] + ["." name ("name/." Equivalence<Name> Codec<Text,Name>)] ["." text ("text/." Equivalence<Text> Monoid<Text>) ["l" lexer]] [collection ["." list ("list/." Monad<List>)] ["d" dictionary]]]]) -(type: #export Tag Ident) -(type: #export Attrs (d.Dictionary Ident Text)) +(type: #export Tag Name) +(type: #export Attrs (d.Dictionary Name Text)) -(def: #export attrs Attrs (d.new ident.Hash<Ident>)) +(def: #export attrs Attrs (d.new name.Hash<Name>)) (type: #export #rec XML (#Text Text) @@ -69,7 +69,7 @@ (wrap ($_ text/compose head tail)))) (def: namespaced-symbol^ - (l.Lexer Ident) + (l.Lexer Name) (do p.Monad<Parser> [first-part xml-identifier ?second-part (<| p.maybe (p.after (l.this ":")) xml-identifier)] @@ -97,7 +97,7 @@ (def: attrs^ (l.Lexer Attrs) - (<| (:: p.Monad<Parser> map (d.from-list ident.Hash<Ident>)) + (<| (:: p.Monad<Parser> map (d.from-list name.Hash<Name>)) p.some (p.seq (spaced^ attr-name^)) (p.after (l.this "=")) @@ -111,9 +111,9 @@ (p.after (l.this "/")) (l.enclosed ["<" ">"]))] (p.assert ($_ text/compose "Close tag does not match open tag.\n" - "Expected: " (ident/encode expected) "\n" - " Actual: " (ident/encode actual) "\n") - (ident/= expected actual)))) + "Expected: " (name/encode expected) "\n" + " Actual: " (name/encode actual) "\n") + (name/= expected actual)))) (def: comment^ (l.Lexer Text) @@ -234,7 +234,7 @@ [(#Node reference/tag reference/attrs reference/children) (#Node sample/tag sample/attrs sample/children)] - (and (ident/= reference/tag sample/tag) + (and (name/= reference/tag sample/tag) (:: (d.Equivalence<Dictionary> text.Equivalence<Text>) = reference/attrs sample/attrs) (n/= (list.size reference/children) (list.size sample/children)) @@ -251,8 +251,8 @@ (exception: #export unexpected-input) (exception: #export unknown-attribute) -(exception: #export (wrong-tag {tag Ident}) - (ident/encode tag)) +(exception: #export (wrong-tag {tag Name}) + (name/encode tag)) (exception: #export (unconsumed-inputs {inputs (List XML)}) (|> inputs @@ -275,7 +275,7 @@ (ex.throw unexpected-input []))))) (def: #export (attr name) - (-> Ident (Reader Text)) + (-> Name (Reader Text)) (function (_ docs) (case docs #.Nil @@ -306,7 +306,7 @@ (#E.Error error))) (def: #export (node tag) - (-> Ident (Reader Any)) + (-> Name (Reader Any)) (function (_ docs) (case docs #.Nil @@ -318,7 +318,7 @@ (ex.throw unexpected-input []) (#Node _tag _attrs _children) - (if (ident/= tag _tag) + (if (name/= tag _tag) (#E.Success [docs []]) (ex.throw wrong-tag tag)))))) |