diff options
Diffstat (limited to 'stdlib/source/library/lux/control/parser/xml.lux')
-rw-r--r-- | stdlib/source/library/lux/control/parser/xml.lux | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/stdlib/source/library/lux/control/parser/xml.lux b/stdlib/source/library/lux/control/parser/xml.lux index a54e68170..6a1eb1206 100644 --- a/stdlib/source/library/lux/control/parser/xml.lux +++ b/stdlib/source/library/lux/control/parser/xml.lux @@ -42,13 +42,13 @@ (def: (result' parser attrs documents) (All (_ a) (-> (Parser a) Attrs (List XML) (Try a))) (case (//.result parser [attrs documents]) - (#try.Success [[attrs' remaining] output]) + {#try.Success [[attrs' remaining] output]} (if (list.empty? remaining) - (#try.Success output) + {#try.Success output} (exception.except ..unconsumed_inputs remaining)) - (#try.Failure error) - (#try.Failure error))) + {#try.Failure error} + {#try.Failure error})) (def: .public (result parser documents) (All (_ a) (-> (Parser a) (List XML) (Try a))) @@ -61,12 +61,12 @@ #.End (exception.except ..empty_input []) - (#.Item head tail) + {#.Item head tail} (case head - (#/.Text value) - (#try.Success [[attrs tail] value]) + {#/.Text value} + {#try.Success [[attrs tail] value]} - (#/.Node _) + {#/.Node _} (exception.except ..unexpected_input []))))) (def: .public tag @@ -76,13 +76,13 @@ #.End (exception.except ..empty_input []) - (#.Item head _) + {#.Item head _} (case head - (#/.Text _) + {#/.Text _} (exception.except ..unexpected_input []) - (#/.Node tag _ _) - (#try.Success [[attrs documents] tag]))))) + {#/.Node tag _ _} + {#try.Success [[attrs documents] tag]})))) (def: .public (attribute name) (-> Attribute (Parser Text)) @@ -91,8 +91,8 @@ #.None (exception.except ..unknown_attribute [name (dictionary.keys attrs)]) - (#.Some value) - (#try.Success [[attrs documents] value])))) + {#.Some value} + {#try.Success [[attrs documents] value]}))) (def: .public (node expected parser) (All (_ a) (-> Tag (Parser a) (Parser a))) @@ -101,12 +101,12 @@ #.End (exception.except ..empty_input []) - (#.Item head tail) + {#.Item head tail} (case head - (#/.Text _) + {#/.Text _} (exception.except ..unexpected_input []) - (#/.Node actual attrs' children) + {#/.Node actual attrs' children} (if (name\= expected actual) (|> children (..result' parser attrs') @@ -120,8 +120,8 @@ #.End (exception.except ..empty_input []) - (#.Item head tail) - (#try.Success [[attrs tail] head])))) + {#.Item head tail} + {#try.Success [[attrs tail] head]}))) (exception: .public nowhere) @@ -129,16 +129,16 @@ (All (_ a) (-> (Parser a) (Parser a))) (function (recur [attrs input]) (case (//.result parser [attrs input]) - (#try.Success [[attrs remaining] output]) - (#try.Success [[attrs remaining] output]) + {#try.Success [[attrs remaining] output]} + {#try.Success [[attrs remaining] output]} - (#try.Failure error) + {#try.Failure error} (case input #.End (exception.except ..nowhere []) - (#.Item head tail) + {#.Item head tail} (do try.monad [[[attrs tail'] output] (recur [attrs tail])] - (in [[attrs (#.Item head tail')] + (in [[attrs {#.Item head tail'}] output])))))) |