diff options
author | Eduardo Julian | 2022-07-06 16:25:43 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-07-06 16:25:43 -0400 |
commit | 5270f301eba5237feebc8eca14aee6b7a992a819 (patch) | |
tree | a1adb545189f4db807d712a1fcc7d20048c11222 /stdlib/source/parser | |
parent | 0c32c7f03ad1f8f0db54b623dc407713bbf8cacd (diff) |
Made exception.report a function.
Diffstat (limited to 'stdlib/source/parser')
-rw-r--r-- | stdlib/source/parser/lux/data/binary.lux | 18 | ||||
-rw-r--r-- | stdlib/source/parser/lux/data/format/json.lux | 8 | ||||
-rw-r--r-- | stdlib/source/parser/lux/data/format/xml.lux | 10 | ||||
-rw-r--r-- | stdlib/source/parser/lux/data/text.lux | 18 | ||||
-rw-r--r-- | stdlib/source/parser/lux/meta/compiler/language/lux/analysis.lux | 4 | ||||
-rw-r--r-- | stdlib/source/parser/lux/meta/compiler/language/lux/synthesis.lux | 10 | ||||
-rw-r--r-- | stdlib/source/parser/lux/meta/type.lux | 12 | ||||
-rw-r--r-- | stdlib/source/parser/lux/world/environment.lux | 2 |
8 files changed, 41 insertions, 41 deletions
diff --git a/stdlib/source/parser/lux/data/binary.lux b/stdlib/source/parser/lux/data/binary.lux index 8cd81ed6d..d1cf273f3 100644 --- a/stdlib/source/parser/lux/data/binary.lux +++ b/stdlib/source/parser/lux/data/binary.lux @@ -41,8 +41,8 @@ (exception .public (binary_was_not_fully_read [binary_length Nat bytes_read Nat]) (exception.report - "Binary length" (%.nat binary_length) - "Bytes read" (%.nat bytes_read))) + (.list ["Binary length" (%.nat binary_length)] + ["Bytes read" (%.nat bytes_read)]))) (with_template [<name> <extension>] [(def <name> @@ -93,9 +93,9 @@ start Nat end Nat]) (exception.report - "Length" (%.nat length) - "Range start" (%.nat start) - "Range end" (%.nat end))) + (.list ["Length" (%.nat length)] + ["Range start" (%.nat start)] + ["Range end" (%.nat end)]))) (with_template [<name> <size> <read>] [(def .public <name> @@ -129,8 +129,8 @@ (exception .public (invalid_tag [range Nat byte Nat]) (exception.report - "Tag range" (%.nat range) - "Tag value" (%.nat byte))) + (.list ["Tag range" (%.nat range)] + ["Tag value" (%.nat byte)]))) (def !variant (template (!variant <case>+) @@ -162,8 +162,8 @@ (exception .public (not_a_bit [value Nat]) (exception.report - "Expected values" "either 0 or 1" - "Actual value" (%.nat value))) + (.list ["Expected values" "either 0 or 1"] + ["Actual value" (%.nat value)]))) (def .public bit (Parser Bit) diff --git a/stdlib/source/parser/lux/data/format/json.lux b/stdlib/source/parser/lux/data/format/json.lux index c125d79d1..d440cd091 100644 --- a/stdlib/source/parser/lux/data/format/json.lux +++ b/stdlib/source/parser/lux/data/format/json.lux @@ -27,7 +27,7 @@ (exception .public (unconsumed_input [input (List JSON)]) (exception.report - "Input" (exception.listing /.format input))) + (list ["Input" (exception.listing /.format input)]))) (exception .public empty_input) @@ -57,7 +57,7 @@ (exception .public (unexpected_value [value JSON]) (exception.report - "Value" (/.format value))) + (list ["Value" (/.format value)]))) (with_template [<name> <type> <tag>] [(def .public <name> @@ -80,8 +80,8 @@ (exception .public [a] (value_mismatch [reference JSON sample JSON]) (exception.report - "Reference" (/.format reference) - "Sample" (/.format sample))) + (list ["Reference" (/.format reference)] + ["Sample" (/.format sample)]))) (with_template [<test> <check> <type> <equivalence> <tag>] [(def .public (<test> test) diff --git a/stdlib/source/parser/lux/data/format/xml.lux b/stdlib/source/parser/lux/data/format/xml.lux index 70376d2c6..0a54431e2 100644 --- a/stdlib/source/parser/lux/data/format/xml.lux +++ b/stdlib/source/parser/lux/data/format/xml.lux @@ -27,18 +27,18 @@ (exception .public (wrong_tag [expected Tag actual Tag]) (exception.report - "Expected" (%.text (/.tag expected)) - "Actual" (%.text (/.tag actual)))) + (list ["Expected" (%.text (/.tag expected))] + ["Actual" (%.text (/.tag actual))]))) (exception .public (unknown_attribute [expected Attribute available (List Attribute)]) (exception.report - "Expected" (%.text (/.attribute expected)) - "Available" (exception.listing (|>> /.attribute %.text) available))) + (list ["Expected" (%.text (/.attribute expected))] + ["Available" (exception.listing (|>> /.attribute %.text) available)]))) (exception .public (unconsumed_inputs [inputs (List XML)]) (exception.report - "Inputs" (exception.listing (at /.codec encoded) inputs))) + (list ["Inputs" (exception.listing (at /.codec encoded) inputs)]))) (def (result' parser attrs documents) (All (_ a) (-> (Parser a) Attrs (List XML) (Try a))) diff --git a/stdlib/source/parser/lux/data/text.lux b/stdlib/source/parser/lux/data/text.lux index 31a12ed16..75c30816f 100644 --- a/stdlib/source/parser/lux/data/text.lux +++ b/stdlib/source/parser/lux/data/text.lux @@ -59,15 +59,15 @@ (exception .public (unconsumed_input [offset Offset tape Text]) (exception.report - "Offset" (n#encoded offset) - "Input size" (n#encoded (/.size tape)) - "Remaining input" (..left_over offset tape))) + (list ["Offset" (n#encoded offset)] + ["Input size" (n#encoded (/.size tape))] + ["Remaining input" (..left_over offset tape)]))) (exception .public (expected_to_fail [offset Offset tape Text]) (exception.report - "Offset" (n#encoded offset) - "Input" (..left_over offset tape))) + (list ["Offset" (n#encoded offset)] + ["Input" (..left_over offset tape)]))) (def .public (result parser input) (All (_ a) (-> (Parser a) Text (Try a))) @@ -136,7 +136,7 @@ (exception .public (cannot_match [reference Text]) (exception.report - "Reference" (/.format reference))) + (list ["Reference" (/.format reference)]))) (def .public (this reference) (-> Text (Parser Any)) @@ -233,8 +233,8 @@ [(exception .public (<name> [options Text character Char]) (exception.report - "Options" (/.format options) - "Character" (/.format (/.of_char character))))] + (list ["Options" (/.format options)] + ["Character" (/.format (/.of_char character))])))] [character_should_be] [character_should_not_be] @@ -280,7 +280,7 @@ (exception .public (character_does_not_satisfy_predicate [character Char]) (exception.report - "Character" (/.format (/.of_char character)))) + (list ["Character" (/.format (/.of_char character))]))) (def .public (satisfies parser) (-> (-> Char Bit) (Parser Text)) diff --git a/stdlib/source/parser/lux/meta/compiler/language/lux/analysis.lux b/stdlib/source/parser/lux/meta/compiler/language/lux/analysis.lux index 999fca556..e8be9f6dc 100644 --- a/stdlib/source/parser/lux/meta/compiler/language/lux/analysis.lux +++ b/stdlib/source/parser/lux/meta/compiler/language/lux/analysis.lux @@ -39,11 +39,11 @@ (exception .public (cannot_parse [input (List Analysis)]) (exception.report - "Input" (exception.listing /.format input))) + (list ["Input" (exception.listing /.format input)]))) (exception .public (unconsumed_input [input (List Analysis)]) (exception.report - "Input" (exception.listing /.format input))) + (list ["Input" (exception.listing /.format input)]))) (type .public Parser (//.Parser (List Analysis))) diff --git a/stdlib/source/parser/lux/meta/compiler/language/lux/synthesis.lux b/stdlib/source/parser/lux/meta/compiler/language/lux/synthesis.lux index 76248a4af..9431da2a7 100644 --- a/stdlib/source/parser/lux/meta/compiler/language/lux/synthesis.lux +++ b/stdlib/source/parser/lux/meta/compiler/language/lux/synthesis.lux @@ -32,21 +32,21 @@ (exception .public (cannot_parse [input (List Synthesis)]) (exception.report - "Input" (exception.listing /.%synthesis input))) + (list ["Input" (exception.listing /.%synthesis input)]))) (exception .public (unconsumed_input [input (List Synthesis)]) (exception.report - "Input" (exception.listing /.%synthesis input))) + (list ["Input" (exception.listing /.%synthesis input)]))) (exception .public (expected_empty_input [input (List Synthesis)]) (exception.report - "Input" (exception.listing /.%synthesis input))) + (list ["Input" (exception.listing /.%synthesis input)]))) (exception .public (wrong_arity [expected Arity actual Arity]) (exception.report - "Expected" (%.nat expected) - "Actual" (%.nat actual))) + (list ["Expected" (%.nat expected)] + ["Actual" (%.nat actual)]))) (exception .public empty_input) diff --git a/stdlib/source/parser/lux/meta/type.lux b/stdlib/source/parser/lux/meta/type.lux index 6f31848ae..b7cc07bef 100644 --- a/stdlib/source/parser/lux/meta/type.lux +++ b/stdlib/source/parser/lux/meta/type.lux @@ -32,7 +32,7 @@ (with_template [<name>] [(exception .public (<name> [type Type]) (exception.report - "Type" (%.type type)))] + (list ["Type" (%.type type)])))] [not_existential] [not_recursive] @@ -50,8 +50,8 @@ [(exception .public (<name> [expected Type actual Type]) (exception.report - "Expected" (%.type expected) - "Actual" (%.type actual)))] + (list ["Expected" (%.type expected)] + ["Actual" (%.type actual)])))] [types_do_not_match] [wrong_parameter] @@ -61,9 +61,9 @@ (exception .public (unconsumed_input [remaining (List Type)]) (exception.report - "Types" (|> remaining - (list#each (|>> %.type (format text.new_line "* "))) - (text.interposed "")))) + (list ["Types" (|> remaining + (list#each (|>> %.type (format text.new_line "* "))) + (text.interposed ""))]))) (type .public Env (Dictionary Nat [Type Code])) diff --git a/stdlib/source/parser/lux/world/environment.lux b/stdlib/source/parser/lux/world/environment.lux index 33089f2a3..311048fdf 100644 --- a/stdlib/source/parser/lux/world/environment.lux +++ b/stdlib/source/parser/lux/world/environment.lux @@ -20,7 +20,7 @@ (exception .public (unknown_property [property Property]) (exception.report - "Property" (%.text property))) + (list ["Property" (%.text property)]))) (type .public (Parser a) (//.Parser Environment a)) |