diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/control/parser/xml.lux | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/stdlib/source/lux/control/parser/xml.lux b/stdlib/source/lux/control/parser/xml.lux index bc8c6ad93..3b9732ae5 100644 --- a/stdlib/source/lux/control/parser/xml.lux +++ b/stdlib/source/lux/control/parser/xml.lux @@ -19,20 +19,20 @@ (type: #export (Parser a) (//.Parser (List XML) a)) -(exception: #export empty-input) -(exception: #export unexpected-input) +(exception: #export empty_input) +(exception: #export unexpected_input) -(exception: #export (wrong-tag {expected Tag} {actual Tag}) +(exception: #export (wrong_tag {expected Tag} {actual Tag}) (exception.report ["Expected" (%.text (/.tag expected))] ["Actual" (%.text (/.tag actual))])) -(exception: #export (unknown-attribute {expected Attribute} {available (List Attribute)}) +(exception: #export (unknown_attribute {expected Attribute} {available (List Attribute)}) (exception.report ["Expected" (%.text (/.attribute expected))] ["Available" (exception.enumerate (|>> /.attribute %.text) available)])) -(exception: #export (unconsumed-inputs {inputs (List XML)}) +(exception: #export (unconsumed_inputs {inputs (List XML)}) (exception.report ["Inputs" (exception.enumerate (\ /.codec encode) inputs)])) @@ -41,7 +41,7 @@ (function (_ docs) (case docs #.Nil - (exception.throw ..empty-input []) + (exception.throw ..empty_input []) (#.Cons head tail) (case head @@ -49,36 +49,36 @@ (#try.Success [tail value]) (#/.Node _) - (exception.throw ..unexpected-input []))))) + (exception.throw ..unexpected_input []))))) (def: #export (node expected) (-> Tag (Parser Any)) (function (_ docs) (case docs #.Nil - (exception.throw ..empty-input []) + (exception.throw ..empty_input []) (#.Cons head _) (case head (#/.Text _) - (exception.throw ..unexpected-input []) + (exception.throw ..unexpected_input []) (#/.Node actual _attributes _children) (if (name\= expected actual) (#try.Success [docs []]) - (exception.throw ..wrong-tag [expected actual])))))) + (exception.throw ..wrong_tag [expected actual])))))) (def: #export tag (Parser Tag) (function (_ docs) (case docs #.Nil - (exception.throw ..empty-input []) + (exception.throw ..empty_input []) (#.Cons head _) (case head (#/.Text _) - (exception.throw ..unexpected-input []) + (exception.throw ..unexpected_input []) (#/.Node tag _attributes _children) (#try.Success [docs tag]))))) @@ -88,17 +88,17 @@ (function (_ docs) (case docs #.Nil - (exception.throw ..empty-input []) + (exception.throw ..empty_input []) (#.Cons head _) (case head (#/.Text _) - (exception.throw ..unexpected-input []) + (exception.throw ..unexpected_input []) (#/.Node tag attributes children) (case (dictionary.get name attributes) #.None - (exception.throw ..unknown-attribute [name (dictionary.keys attributes)]) + (exception.throw ..unknown_attribute [name (dictionary.keys attributes)]) (#.Some value) (#try.Success [docs value])))))) @@ -109,7 +109,7 @@ (#try.Success [remaining output]) (if (list.empty? remaining) (#try.Success output) - (exception.throw ..unconsumed-inputs remaining)) + (exception.throw ..unconsumed_inputs remaining)) (#try.Failure error) (#try.Failure error))) @@ -119,12 +119,12 @@ (function (_ docs) (case docs #.Nil - (exception.throw ..empty-input []) + (exception.throw ..empty_input []) (#.Cons head tail) (case head (#/.Text _) - (exception.throw ..unexpected-input []) + (exception.throw ..unexpected_input []) (#/.Node _tag _attributes children) (do try.monad @@ -136,7 +136,7 @@ (function (_ docs) (case docs #.Nil - (exception.throw ..empty-input []) + (exception.throw ..empty_input []) (#.Cons head tail) (#try.Success [tail []])))) |