diff options
Diffstat (limited to 'stdlib/source/library/lux/data/format/xml.lux')
-rw-r--r-- | stdlib/source/library/lux/data/format/xml.lux | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/stdlib/source/library/lux/data/format/xml.lux b/stdlib/source/library/lux/data/format/xml.lux index 5131090ec..90aaa1b1e 100644 --- a/stdlib/source/library/lux/data/format/xml.lux +++ b/stdlib/source/library/lux/data/format/xml.lux @@ -37,8 +37,8 @@ (type: .public XML (Rec XML (Variant - (#Text Text) - (#Node Tag Attrs (List XML))))) + {#Text Text} + {#Node Tag Attrs (List XML)}))) (def: namespace_separator ":") @@ -61,7 +61,7 @@ #.None (<>.codec int.decimal (<text>.many <text>.decimal)) - (#.Some _) + {#.Some _} (<>.codec int.decimal (<text>.many <text>.hexadecimal)))] (in (|> code .nat text.of_char))) (<>.before (<text>.this ";")) @@ -95,7 +95,7 @@ #.None (in ["" first_part]) - (#.Some second_part) + {#.Some second_part} (in [first_part second_part])))) (def: tag^ namespaced_symbol^) @@ -176,18 +176,18 @@ .let [no_children^ ($_ <>.either (do <>.monad [_ (<text>.this "/>")] - (in (#Node tag attrs (list)))) + (in {#Node tag attrs (list)})) (do <>.monad [_ (<text>.this ">") _ (<>.some (<>.either <text>.space ..comment^)) _ (..close_tag^ tag)] - (in (#Node tag attrs (list))))) + (in {#Node tag attrs (list)}))) with_children^ (do <>.monad [_ (<text>.this ">") children (<>.many node^) _ (..close_tag^ tag)] - (in (#Node tag attrs children)))]] + (in {#Node tag attrs children}))]] ($_ <>.either no_children^ with_children^)) @@ -245,10 +245,10 @@ (loop [prefix "" input input] (case input - (#Text value) + {#Text value} (sanitize_value value) - (^ (#Node xml_tag xml_attrs (list (#Text value)))) + (^ {#Node xml_tag xml_attrs (list {#Text value})}) (let [tag (..tag xml_tag) attrs (if (dictionary.empty? xml_attrs) "" @@ -258,7 +258,7 @@ (sanitize_value value) "</" tag ">")) - (#Node xml_tag xml_attrs xml_children) + {#Node xml_tag xml_attrs xml_children} (let [tag (..tag xml_tag) attrs (if (dictionary.empty? xml_attrs) "" @@ -279,11 +279,11 @@ (def: (= reference sample) (case [reference sample] - [(#Text reference/value) (#Text sample/value)] + [{#Text reference/value} {#Text sample/value}] (text\= reference/value sample/value) - [(#Node reference/tag reference/attrs reference/children) - (#Node sample/tag sample/attrs sample/children)] + [{#Node reference/tag reference/attrs reference/children} + {#Node sample/tag sample/attrs sample/children}] (and (name\= reference/tag sample/tag) (\ (dictionary.equivalence text.equivalence) = reference/attrs sample/attrs) (n.= (list.size reference/children) |