diff options
Diffstat (limited to 'stdlib/source')
89 files changed, 374 insertions, 263 deletions
diff --git a/stdlib/source/documentation/lux/control/exception.lux b/stdlib/source/documentation/lux/control/exception.lux index 297ac38fd..15b3cc88a 100644 --- a/stdlib/source/documentation/lux/control/exception.lux +++ b/stdlib/source/documentation/lux/control/exception.lux @@ -40,7 +40,8 @@ ["Simple case:" (exception: .public some_exception)] ["Complex case:" - (exception: .public [arbitrary type variables] (some_exception {optional Text} {arguments Int}) + (exception: .public [arbitrary type variables] (some_exception [optional Text + arguments Int]) optional_body)]) (documentation: /.report diff --git a/stdlib/source/library/lux/control/concurrency/actor.lux b/stdlib/source/library/lux/control/concurrency/actor.lux index 27d413c10..617068a4c 100644 --- a/stdlib/source/library/lux/control/concurrency/actor.lux +++ b/stdlib/source/library/lux/control/concurrency/actor.lux @@ -299,7 +299,7 @@ (<code>.form ($_ <>.and (<>.else (list) (<code>.tuple (<>.some <code>.local_identifier))) <code>.local_identifier - (<>.some |input|.parser) + |input|.parser <code>.local_identifier <code>.local_identifier))) diff --git a/stdlib/source/library/lux/control/concurrency/semaphore.lux b/stdlib/source/library/lux/control/concurrency/semaphore.lux index bcbd71158..013720460 100644 --- a/stdlib/source/library/lux/control/concurrency/semaphore.lux +++ b/stdlib/source/library/lux/control/concurrency/semaphore.lux @@ -65,7 +65,7 @@ <get_in_line>))))) signal))) - (exception: .public (semaphore_is_maxed_out {max_positions Nat}) + (exception: .public (semaphore_is_maxed_out [max_positions Nat]) (exception.report ["Max Positions" (%.nat max_positions)])) diff --git a/stdlib/source/library/lux/control/exception.lux b/stdlib/source/library/lux/control/exception.lux index ecf71dc49..039265ff7 100644 --- a/stdlib/source/library/lux/control/exception.lux +++ b/stdlib/source/library/lux/control/exception.lux @@ -81,7 +81,7 @@ (let [private (: (Parser [(List |type_variable|.Variable) [Text (List |input|.Input)] (Maybe Code)]) ($_ <>.and (<>.else (list) (<code>.tuple (<>.some |type_variable|.parser))) - (<>.either (<code>.form (<>.and <code>.local_identifier (<>.some |input|.parser))) + (<>.either (<code>.form (<>.and <code>.local_identifier |input|.parser)) (<>.and <code>.local_identifier (<>\in (list)))) (<>.maybe <code>.any) ))] diff --git a/stdlib/source/library/lux/control/function/contract.lux b/stdlib/source/library/lux/control/function/contract.lux index 4b349c534..8edd01c63 100644 --- a/stdlib/source/library/lux/control/function/contract.lux +++ b/stdlib/source/library/lux/control/function/contract.lux @@ -16,7 +16,7 @@ ["i" int]]]]]) (template [<name>] - [(exception: .public (<name> {condition Code}) + [(exception: .public (<name> [condition Code]) (exception.report ["Condition" (%.code condition)]))] diff --git a/stdlib/source/library/lux/control/parser/analysis.lux b/stdlib/source/library/lux/control/parser/analysis.lux index 9bbb6840b..bbc90f043 100644 --- a/stdlib/source/library/lux/control/parser/analysis.lux +++ b/stdlib/source/library/lux/control/parser/analysis.lux @@ -39,11 +39,11 @@ (list\each /.%analysis) (text.interposed " ")))) -(exception: .public (cannot_parse {input (List Analysis)}) +(exception: .public (cannot_parse [input (List Analysis)]) (exception.report ["Input" (exception.listing /.%analysis input)])) -(exception: .public (unconsumed_input {input (List Analysis)}) +(exception: .public (unconsumed_input [input (List Analysis)]) (exception.report ["Input" (exception.listing /.%analysis input)])) diff --git a/stdlib/source/library/lux/control/parser/binary.lux b/stdlib/source/library/lux/control/parser/binary.lux index 4304bbc02..66dd9f3c5 100644 --- a/stdlib/source/library/lux/control/parser/binary.lux +++ b/stdlib/source/library/lux/control/parser/binary.lux @@ -32,7 +32,8 @@ (type: .public Parser (//.Parser [Offset Binary])) -(exception: .public (binary_was_not_fully_read {binary_length Nat} {bytes_read Nat}) +(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)])) @@ -101,7 +102,8 @@ (Parser Frac) (//\each frac.of_bits ..bits/64)) -(exception: .public (invalid_tag {range Nat} {byte Nat}) +(exception: .public (invalid_tag [range Nat + byte Nat]) (exception.report ["Tag range" (%.nat range)] ["Tag value" (%.nat byte)])) @@ -133,7 +135,7 @@ (Parser Any) (//\in [])) -(exception: .public (not_a_bit {value Nat}) +(exception: .public (not_a_bit [value Nat]) (exception.report ["Expected values" "either 0 or 1"] ["Actual value" (%.nat value)])) diff --git a/stdlib/source/library/lux/control/parser/environment.lux b/stdlib/source/library/lux/control/parser/environment.lux index ab577eeb4..1ad723411 100644 --- a/stdlib/source/library/lux/control/parser/environment.lux +++ b/stdlib/source/library/lux/control/parser/environment.lux @@ -18,7 +18,7 @@ (type: .public Environment (Dictionary Property Text)) -(exception: .public (unknown_property {property Property}) +(exception: .public (unknown_property [property Property]) (exception.report ["Property" (%.text property)])) diff --git a/stdlib/source/library/lux/control/parser/json.lux b/stdlib/source/library/lux/control/parser/json.lux index 114b49f3b..4d09fa72b 100644 --- a/stdlib/source/library/lux/control/parser/json.lux +++ b/stdlib/source/library/lux/control/parser/json.lux @@ -25,7 +25,7 @@ (type: .public (Parser a) (//.Parser (List JSON) a)) -(exception: .public (unconsumed_input {input (List JSON)}) +(exception: .public (unconsumed_input [input (List JSON)]) (exception.report ["Input" (exception.listing /.format input)])) @@ -55,7 +55,7 @@ (#.Item head tail) (#try.Success [tail head])))) -(exception: .public (unexpected_value {value JSON}) +(exception: .public (unexpected_value [value JSON]) (exception.report ["Value" (/.format value)])) @@ -77,7 +77,8 @@ [string /.String #/.String] ) -(exception: .public [a] (value_mismatch {reference JSON} {sample JSON}) +(exception: .public [a] (value_mismatch [reference JSON + sample JSON]) (exception.report ["Reference" (/.format reference)] ["Sample" (/.format sample)])) diff --git a/stdlib/source/library/lux/control/parser/synthesis.lux b/stdlib/source/library/lux/control/parser/synthesis.lux index a4927b521..0bc446089 100644 --- a/stdlib/source/library/lux/control/parser/synthesis.lux +++ b/stdlib/source/library/lux/control/parser/synthesis.lux @@ -27,19 +27,20 @@ ["/" synthesis {"+" [Synthesis Abstraction]}]]]]]]] ["[0]" //]) -(exception: .public (cannot_parse {input (List Synthesis)}) +(exception: .public (cannot_parse [input (List Synthesis)]) (exception.report ["Input" (exception.listing /.%synthesis input)])) -(exception: .public (unconsumed_input {input (List Synthesis)}) +(exception: .public (unconsumed_input [input (List Synthesis)]) (exception.report ["Input" (exception.listing /.%synthesis input)])) -(exception: .public (expected_empty_input {input (List Synthesis)}) +(exception: .public (expected_empty_input [input (List Synthesis)]) (exception.report ["Input" (exception.listing /.%synthesis input)])) -(exception: .public (wrong_arity {expected Arity} {actual Arity}) +(exception: .public (wrong_arity [expected Arity + actual Arity]) (exception.report ["Expected" (%.nat expected)] ["Actual" (%.nat actual)])) diff --git a/stdlib/source/library/lux/control/parser/text.lux b/stdlib/source/library/lux/control/parser/text.lux index 256d749bc..9c847ad5c 100644 --- a/stdlib/source/library/lux/control/parser/text.lux +++ b/stdlib/source/library/lux/control/parser/text.lux @@ -39,13 +39,15 @@ (-> Offset Text Text) (|> tape (/.clip_since offset) maybe.trusted)) -(exception: .public (unconsumed_input {offset Offset} {tape Text}) +(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)])) -(exception: .public (expected_to_fail {offset Offset} {tape Text}) +(exception: .public (expected_to_fail [offset Offset + tape Text]) (exception.report ["Offset" (n\encoded offset)] ["Input" (..left_over offset tape)])) @@ -118,7 +120,7 @@ [not! Slice ..any!] ) -(exception: .public (cannot_match {reference Text}) +(exception: .public (cannot_match [reference Text]) (exception.report ["Reference" (/.format reference)])) @@ -194,7 +196,8 @@ (range (char "A") (char "F")))) (template [<name>] - [(exception: .public (<name> {options Text} {character Char}) + [(exception: .public (<name> [options Text + character Char]) (exception.report ["Options" (/.format options)] ["Character" (/.format (/.of_char character))]))] @@ -241,7 +244,7 @@ [none_of! .not ..character_should_not_be] ) -(exception: .public (character_does_not_satisfy_predicate {character Char}) +(exception: .public (character_does_not_satisfy_predicate [character Char]) (exception.report ["Character" (/.format (/.of_char character))])) diff --git a/stdlib/source/library/lux/control/parser/type.lux b/stdlib/source/library/lux/control/parser/type.lux index 437574acb..735b594d8 100644 --- a/stdlib/source/library/lux/control/parser/type.lux +++ b/stdlib/source/library/lux/control/parser/type.lux @@ -26,7 +26,7 @@ [(#.Primitive "" #.End)]) (template [<name>] - [(exception: .public (<name> {type Type}) + [(exception: .public (<name> [type Type]) (exception.report ["Type" (%.type type)]))] @@ -43,7 +43,8 @@ ) (template [<name>] - [(exception: .public (<name> {expected Type} {actual Type}) + [(exception: .public (<name> [expected Type + actual Type]) (exception.report ["Expected" (%.type expected)] ["Actual" (%.type actual)]))] @@ -54,7 +55,7 @@ (exception: .public empty_input) -(exception: .public (unconsumed_input {remaining (List Type)}) +(exception: .public (unconsumed_input [remaining (List Type)]) (exception.report ["Types" (|> remaining (list\each (|>> %.type (format text.new_line "* "))) diff --git a/stdlib/source/library/lux/control/parser/xml.lux b/stdlib/source/library/lux/control/parser/xml.lux index 55d18cab2..a54e68170 100644 --- a/stdlib/source/library/lux/control/parser/xml.lux +++ b/stdlib/source/library/lux/control/parser/xml.lux @@ -23,17 +23,19 @@ (exception: .public empty_input) (exception: .public unexpected_input) -(exception: .public (wrong_tag {expected Tag} {actual Tag}) +(exception: .public (wrong_tag [expected Tag + actual Tag]) (exception.report ["Expected" (%.text (/.tag expected))] ["Actual" (%.text (/.tag actual))])) -(exception: .public (unknown_attribute {expected Attribute} {available (List Attribute)}) +(exception: .public (unknown_attribute [expected Attribute + available (List Attribute)]) (exception.report ["Expected" (%.text (/.attribute expected))] ["Available" (exception.listing (|>> /.attribute %.text) available)])) -(exception: .public (unconsumed_inputs {inputs (List XML)}) +(exception: .public (unconsumed_inputs [inputs (List XML)]) (exception.report ["Inputs" (exception.listing (\ /.codec encoded) inputs)])) diff --git a/stdlib/source/library/lux/control/region.lux b/stdlib/source/library/lux/control/region.lux index 26dd017e8..58f406e3a 100644 --- a/stdlib/source/library/lux/control/region.lux +++ b/stdlib/source/library/lux/control/region.lux @@ -31,8 +31,8 @@ "-----------------------------------------" text.new_line text.new_line)) -(exception: .public [a] (clean_up_error {error Text} - {output (Try a)}) +(exception: .public [a] (clean_up_error [error Text + output (Try a)]) (format error (case output (#try.Success _) diff --git a/stdlib/source/library/lux/control/remember.lux b/stdlib/source/library/lux/control/remember.lux index a65e9fc2d..b2db48900 100644 --- a/stdlib/source/library/lux/control/remember.lux +++ b/stdlib/source/library/lux/control/remember.lux @@ -21,7 +21,10 @@ ["[0]" template] [syntax {"+" [syntax:]}]]]]) -(exception: .public (must_remember {deadline Date} {today Date} {message Text} {focus (Maybe Code)}) +(exception: .public (must_remember [deadline Date + today Date + message Text + focus (Maybe Code)]) (exception.report ["Deadline" (%.date deadline)] ["Today" (%.date today)] diff --git a/stdlib/source/library/lux/data/binary.lux b/stdlib/source/library/lux/data/binary.lux index de9481bc5..8d1975b8f 100644 --- a/stdlib/source/library/lux/data/binary.lux +++ b/stdlib/source/library/lux/data/binary.lux @@ -22,12 +22,15 @@ ["f" frac] ["[0]" i64]]]]]) -(exception: .public (index_out_of_bounds {size Nat} {index Nat}) +(exception: .public (index_out_of_bounds [size Nat + index Nat]) (exception.report ["Size" (%.nat size)] ["Index" (%.nat index)])) -(exception: .public (slice_out_of_bounds {size Nat} {offset Nat} {length Nat}) +(exception: .public (slice_out_of_bounds [size Nat + offset Nat + length Nat]) (exception.report ["Size" (%.nat size)] ["Offset" (%.nat offset)] @@ -299,9 +302,9 @@ @.jvm (as_is)} ... Default - (exception: .public (cannot_copy_bytes {bytes Nat} - {source_input Nat} - {target_output Nat}) + (exception: .public (cannot_copy_bytes [bytes Nat + source_input Nat + target_output Nat]) (exception.report ["Bytes" (%.nat bytes)] ["Source input space" (%.nat source_input)] diff --git a/stdlib/source/library/lux/data/collection/row.lux b/stdlib/source/library/lux/data/collection/row.lux index 438e1a408..5080c4c1c 100644 --- a/stdlib/source/library/lux/data/collection/row.lux +++ b/stdlib/source/library/lux/data/collection/row.lux @@ -242,7 +242,8 @@ (exception: incorrect_row_structure) -(exception: .public [a] (index_out_of_bounds {row (Row a)} {index Nat}) +(exception: .public [a] (index_out_of_bounds [row (Row a) + index Nat]) (exception.report ["Size" (\ n.decimal encoded (value@ #size row))] ["Index" (\ n.decimal encoded index)])) diff --git a/stdlib/source/library/lux/data/format/tar.lux b/stdlib/source/library/lux/data/format/tar.lux index 7a5d8106b..c0864904c 100644 --- a/stdlib/source/library/lux/data/format/tar.lux +++ b/stdlib/source/library/lux/data/format/tar.lux @@ -65,7 +65,7 @@ (list\mix n.* 1) ++)) - (exception: .public (<exception> {value Nat}) + (exception: .public (<exception> [value Nat]) (exception.report ["Value" (%.nat value)] ["Maximum" (%.nat (-- <limit>))])) @@ -110,7 +110,8 @@ as_big] ) -(exception: .public (wrong_character {expected Char} {actual Char}) +(exception: .public (wrong_character [expected Char + actual Char]) (exception.report ["Expected" (%.nat expected)] ["Actual" (%.nat actual)])) @@ -219,7 +220,7 @@ (n.<= ..last_ascii char))) true))) -(exception: .public (not_ascii {text Text}) +(exception: .public (not_ascii [text Text]) (exception.report ["Text" (%.text text)])) @@ -246,7 +247,7 @@ [(abstract: .public <type> <representation> - [(exception: .public (<exception> {value Text}) + [(exception: .public (<exception> [value Text]) (exception.report ["Value" (%.text value)] ["Size" (%.nat (text.size value))] @@ -416,7 +417,7 @@ <options> ) - (exception: .public (invalid_link_flag {value Nat}) + (exception: .public (invalid_link_flag [value Nat]) (exception.report ["Value" (%.nat value)])) @@ -455,7 +456,7 @@ try.trusted ..small_writer)) - (exception: .public (invalid_mode {value Nat}) + (exception: .public (invalid_mode [value Nat]) (exception.report ["Value" (%.nat value)])) @@ -738,7 +739,8 @@ tar) (format.segment ..end_of_archive_size end_of_archive))))) -(exception: .public (wrong_checksum {expected Nat} {actual Nat}) +(exception: .public (wrong_checksum [expected Nat + actual Nat]) (exception.report ["Expected" (%.nat expected)] ["Actual" (%.nat actual)])) @@ -800,7 +802,8 @@ #major_device major_device #minor_device minor_device]))) -(exception: .public (wrong_link_flag {expected Link_Flag} {actual Link_Flag}) +(exception: .public (wrong_link_flag [expected Link_Flag + actual Link_Flag]) (exception.report ["Expected" (%.nat (..link_flag expected))] ["Actual" (%.nat (..link_flag actual))])) diff --git a/stdlib/source/library/lux/data/text/escape.lux b/stdlib/source/library/lux/data/text/escape.lux index de20d1ee1..db706cc42 100644 --- a/stdlib/source/library/lux/data/text/escape.lux +++ b/stdlib/source/library/lux/data/text/escape.lux @@ -140,18 +140,21 @@ (recur (++ offset) previous current limit))) (format previous current)))) -(exception: .public (dangling_escape {text Text}) +(exception: .public (dangling_escape [text Text]) (exception.report ["In" (%.text text)] ["At" (%.nat (-- (//.size text)))])) -(exception: .public (invalid_escape {text Text} {offset Nat} {sigil Char}) +(exception: .public (invalid_escape [text Text + offset Nat + sigil Char]) (exception.report ["In" (%.text text)] ["At" (%.nat offset)] ["Name" (%.text (//.of_char sigil))])) -(exception: .public (invalid_unicode_escape {text Text} {offset Nat}) +(exception: .public (invalid_unicode_escape [text Text + offset Nat]) (exception.report ["In" (%.text text)] ["At" (%.nat offset)])) diff --git a/stdlib/source/library/lux/data/text/regex.lux b/stdlib/source/library/lux/data/text/regex.lux index 714a84445..0be5f7ebd 100644 --- a/stdlib/source/library/lux/data/text/regex.lux +++ b/stdlib/source/library/lux/data/text/regex.lux @@ -229,7 +229,8 @@ (in (` ((~! together^) ((~! <>.many) (~ base))))) ))) -(exception: .public (incorrect_quantification {from Nat} {to Nat}) +(exception: .public (incorrect_quantification [from Nat + to Nat]) (exception.report ["Input" (format (%.nat from) "," (%.nat to))] ["Should be" (format (%.nat to) "," (%.nat from))])) diff --git a/stdlib/source/library/lux/debug.lux b/stdlib/source/library/lux/debug.lux index ffda8f9fe..e8fcb8348 100644 --- a/stdlib/source/library/lux/debug.lux +++ b/stdlib/source/library/lux/debug.lux @@ -378,7 +378,7 @@ )) }))) -(exception: .public (cannot_represent_value {type Type}) +(exception: .public (cannot_represent_value [type Type]) (exception.report ["Type" (%.type type)])) @@ -530,7 +530,8 @@ (-> Text Any) ("lux io log" message)) -(exception: .public (type_hole {location Location} {type Type}) +(exception: .public (type_hole [location Location + type Type]) (exception.report ["Location" (%.location location)] ["Type" (%.type type)])) @@ -551,7 +552,7 @@ (<code>.record (<>.and <code>.local_identifier (\ <>.monad each (|>> #.Some) <code>.any))))) -(exception: .public (unknown_local_binding {name Text}) +(exception: .public (unknown_local_binding [name Text]) (exception.report ["Name" (%.text name)])) diff --git a/stdlib/source/library/lux/documentation.lux b/stdlib/source/library/lux/documentation.lux index 9ee1db78d..17998d949 100644 --- a/stdlib/source/library/lux/documentation.lux +++ b/stdlib/source/library/lux/documentation.lux @@ -466,7 +466,7 @@ (<>.or (<code>.text! "") <code>.any)) -(exception: .public (unqualified_identifier {name Name}) +(exception: .public (unqualified_identifier [name Name]) (exception.report ["Name" (%.name name)])) diff --git a/stdlib/source/library/lux/ffi.jvm.lux b/stdlib/source/library/lux/ffi.jvm.lux index e1b4e93bb..b71944646 100644 --- a/stdlib/source/library/lux/ffi.jvm.lux +++ b/stdlib/source/library/lux/ffi.jvm.lux @@ -551,12 +551,12 @@ (<code>.this! (' "abstract")) (in [])))) -(exception: .public (class_names_cannot_contain_periods {name Text}) +(exception: .public (class_names_cannot_contain_periods [name Text]) (exception.report ["Name" (%.text name)])) -(exception: .public (class_name_cannot_be_a_type_variable {name Text} - {type_vars (List (Type Var))}) +(exception: .public (class_name_cannot_be_a_type_variable [name Text + type_vars (List (Type Var))]) (exception.report ["Name" (%.text name)] ["Type Variables" (exception.listing parser.name type_vars)])) @@ -589,8 +589,8 @@ (<code>.form (<>.and class_name^ (<>.some (parameter^ type_vars))))))] (in (type.class (name.safe name) parameters)))) -(exception: .public (unexpected_type_variable {name Text} - {type_vars (List (Type Var))}) +(exception: .public (unexpected_type_variable [name Text + type_vars (List (Type Var))]) (exception.report ["Unexpected Type Variable" (%.text name)] ["Expected Type Variables" (exception.listing parser.name type_vars)])) @@ -1704,7 +1704,7 @@ (in (list (` (: (~ (value_type #ManualPrM (type.array type))) ("jvm array new object" (~ g!size)))))))))) -(exception: .public (cannot_convert_to_jvm_type {type .Type}) +(exception: .public (cannot_convert_to_jvm_type [type .Type]) (exception.report ["Lux Type" (%.type type)])) @@ -1915,7 +1915,7 @@ (syntax: .public (type [type (..type^ (list))]) (in (list (..value_type #ManualPrM type)))) -(exception: .public (cannot_cast_to_non_object {type (Type Value)}) +(exception: .public (cannot_cast_to_non_object [type (Type Value)]) (exception.report ["Signature" (..signature type)] ["Reflection" (..reflection type)])) diff --git a/stdlib/source/library/lux/macro/local.lux b/stdlib/source/library/lux/macro/local.lux index 77b5ce94e..ca48592af 100644 --- a/stdlib/source/library/lux/macro/local.lux +++ b/stdlib/source/library/lux/macro/local.lux @@ -17,12 +17,13 @@ ["[0]" // ["[1][0]" code]]) -(exception: .public (unknown_module {module Text}) +(exception: .public (unknown_module [module Text]) (exception.report ["Module" (text.format module)])) (template [<name>] - [(exception: .public (<name> {module Text} {definition Text}) + [(exception: .public (<name> [module Text + definition Text]) (exception.report ["Module" (text.format module)] ["Definition" (text.format definition)]))] diff --git a/stdlib/source/library/lux/macro/syntax/definition.lux b/stdlib/source/library/lux/macro/syntax/definition.lux index 3f92e3118..707c44ea2 100644 --- a/stdlib/source/library/lux/macro/syntax/definition.lux +++ b/stdlib/source/library/lux/macro/syntax/definition.lux @@ -81,7 +81,7 @@ <code>.bit )))) -(exception: .public (lacks_type {definition Definition}) +(exception: .public (lacks_type [definition Definition]) (exception.report ["Definition" (%.code (..format definition))])) diff --git a/stdlib/source/library/lux/macro/syntax/input.lux b/stdlib/source/library/lux/macro/syntax/input.lux index b7ff83a59..51aa4b5fe 100644 --- a/stdlib/source/library/lux/macro/syntax/input.lux +++ b/stdlib/source/library/lux/macro/syntax/input.lux @@ -7,7 +7,9 @@ ["<>" parser ["<[0]>" code {"+" [Parser]}]]] [data - ["[0]" product]] + ["[0]" product] + [collection + ["[0]" list ("[1]\[0]" monad)]]] [macro ["[0]" code]]]]) @@ -23,16 +25,19 @@ code.equivalence )) -(def: .public (format value) - (-> Input Code) - (code.record - (list [(value@ #binding value) - (value@ #type value)]))) +(def: .public format + (-> (List Input) Code) + (|>> (list\each (function (_ value) + (list (value@ #binding value) + (value@ #type value)))) + list\conjoint + code.tuple)) (def: .public parser - (Parser Input) - (<code>.record - ($_ <>.and - <code>.any - <code>.any - ))) + (Parser (List Input)) + (<| <code>.tuple + <>.some + ($_ <>.and + <code>.any + <code>.any + ))) diff --git a/stdlib/source/library/lux/macro/template.lux b/stdlib/source/library/lux/macro/template.lux index cef131e88..3da90c053 100644 --- a/stdlib/source/library/lux/macro/template.lux +++ b/stdlib/source/library/lux/macro/template.lux @@ -133,7 +133,8 @@ #parameters (List Text) #template (List Code)])) -(exception: .public (irregular_arguments {expected Nat} {actual Nat}) +(exception: .public (irregular_arguments [expected Nat + actual Nat]) (exception.report ["Expected" (\ nat.decimal encoded expected)] ["Actual" (\ nat.decimal encoded actual)])) diff --git a/stdlib/source/library/lux/math/modular.lux b/stdlib/source/library/lux/math/modular.lux index a1f8b8bd3..189a4b060 100644 --- a/stdlib/source/library/lux/math/modular.lux +++ b/stdlib/source/library/lux/math/modular.lux @@ -46,8 +46,8 @@ [value Int product.right] ) - (exception: .public [%] (incorrect_modulus {modulus (Modulus %)} - {parsed Int}) + (exception: .public [%] (incorrect_modulus [modulus (Modulus %) + parsed Int]) (exception.report ["Expected" (i\encoded (//.divisor modulus))] ["Actual" (i\encoded parsed)])) @@ -140,8 +140,8 @@ _ #.None)))] ) -(exception: .public [r% s%] (moduli_are_not_equal {reference (Modulus r%)} - {subject (Modulus s%)}) +(exception: .public [r% s%] (moduli_are_not_equal [reference (Modulus r%) + subject (Modulus s%)]) (exception.report ["Reference" (i\encoded (//.divisor reference))] ["Subject" (i\encoded (//.divisor subject))])) diff --git a/stdlib/source/library/lux/target/jvm/bytecode.lux b/stdlib/source/library/lux/target/jvm/bytecode.lux index 2c78e57d0..85fa58c78 100644 --- a/stdlib/source/library/lux/target/jvm/bytecode.lux +++ b/stdlib/source/library/lux/target/jvm/bytecode.lux @@ -112,15 +112,15 @@ [..relative_identity (value@ #next tracker)]]))) -(exception: .public (label_has_already_been_set {label Label}) +(exception: .public (label_has_already_been_set [label Label]) (exception.report ["Label" (%.nat label)])) -(exception: .public (mismatched_environments {instruction Name} - {label Label} - {address Address} - {expected Stack} - {actual Stack}) +(exception: .public (mismatched_environments [instruction Name + label Label + address Address + expected Stack + actual Stack]) (exception.report ["Instruction" (%.name instruction)] ["Label" (%.nat label)] @@ -576,7 +576,7 @@ _ (..arbitrary_double value)))) -(exception: .public (invalid_register {id Nat}) +(exception: .public (invalid_register [id Nat]) (exception.report ["ID" (%.nat id)])) @@ -678,13 +678,13 @@ [$0 $1 sipush _.sipush S2] ) -(exception: .public (unknown_label {label Label}) +(exception: .public (unknown_label [label Label]) (exception.report ["Label" (%.nat label)])) -(exception: .public (cannot_do_a_big_jump {label Label} - {@from Address} - {jump Big_Jump}) +(exception: .public (cannot_do_a_big_jump [label Label + @from Address + jump Big_Jump]) (exception.report ["Label" (%.nat label)] ["Start" (|> @from /address.value //unsigned.value %.nat)] @@ -708,7 +708,7 @@ (\ ! each (|>> #.Left) (//signed.s4 jump)) (\ ! each (|>> #.Right) (//signed.s2 jump)))))) -(exception: .public (unset_label {label Label}) +(exception: .public (unset_label [label Label]) (exception.report ["Label" (%.nat label)])) @@ -944,7 +944,7 @@ [register (..register register)] (..bytecode $0 $0 (/registry.for register) _.iinc [register increase]))) -(exception: .public (multiarray_cannot_be_zero_dimensional {class (Type Object)}) +(exception: .public (multiarray_cannot_be_zero_dimensional [class (Type Object)]) (exception.report ["Class" (..reflection class)])) (def: .public (multianewarray class dimensions) @@ -1014,7 +1014,8 @@ [$2 putfield _.putfield/1 _.putfield/2] ) -(exception: .public (invalid_range_for_try {start Address} {end Address}) +(exception: .public (invalid_range_for_try [start Address + end Address]) (exception.report ["Start" (|> start /address.value //unsigned.value %.nat)] ["End" (|> end /address.value //unsigned.value %.nat)])) diff --git a/stdlib/source/library/lux/target/jvm/bytecode/environment.lux b/stdlib/source/library/lux/target/jvm/bytecode/environment.lux index 99bb9946a..9ba2ca0d4 100644 --- a/stdlib/source/library/lux/target/jvm/bytecode/environment.lux +++ b/stdlib/source/library/lux/target/jvm/bytecode/environment.lux @@ -63,8 +63,8 @@ (-> Environment Environment) (with@ #..stack #.None)) -(exception: .public (mismatched_stacks {expected Stack} - {actual Stack}) +(exception: .public (mismatched_stacks [expected Stack + actual Stack]) (exception.report ["Expected" (/stack.format expected)] ["Actual" (/stack.format actual)])) diff --git a/stdlib/source/library/lux/target/jvm/encoding/signed.lux b/stdlib/source/library/lux/target/jvm/encoding/signed.lux index 5a13c9619..3bafb4bfc 100644 --- a/stdlib/source/library/lux/target/jvm/encoding/signed.lux +++ b/stdlib/source/library/lux/target/jvm/encoding/signed.lux @@ -41,8 +41,8 @@ (def: (< reference sample) (i.< (:representation reference) (:representation sample)))) - (exception: .public (value_exceeds_the_scope {value Int} - {scope Nat}) + (exception: .public (value_exceeds_the_scope [value Int + scope Nat]) (exception.report ["Value" (%.int value)] ["Scope (in bytes)" (%.nat scope)])) diff --git a/stdlib/source/library/lux/target/jvm/encoding/unsigned.lux b/stdlib/source/library/lux/target/jvm/encoding/unsigned.lux index 199ea697a..df550075b 100644 --- a/stdlib/source/library/lux/target/jvm/encoding/unsigned.lux +++ b/stdlib/source/library/lux/target/jvm/encoding/unsigned.lux @@ -42,18 +42,18 @@ (n.< (:representation reference) (:representation sample)))) - (exception: .public (value_exceeds_the_maximum {type Name} - {value Nat} - {maximum (Unsigned Any)}) + (exception: .public (value_exceeds_the_maximum [type Name + value Nat + maximum (Unsigned Any)]) (exception.report ["Type" (%.name type)] ["Value" (%.nat value)] ["Maximum" (%.nat (:representation maximum))])) (exception: .public [brand] (subtraction_cannot_yield_negative_value - {type Name} - {parameter (Unsigned brand)} - {subject (Unsigned brand)}) + [type Name + parameter (Unsigned brand) + subject (Unsigned brand)]) (exception.report ["Type" (%.name type)] ["Parameter" (%.nat (:representation parameter))] diff --git a/stdlib/source/library/lux/target/jvm/loader.lux b/stdlib/source/library/lux/target/jvm/loader.lux index 039ae4c0f..596e57dab 100644 --- a/stdlib/source/library/lux/target/jvm/loader.lux +++ b/stdlib/source/library/lux/target/jvm/loader.lux @@ -22,15 +22,16 @@ (type: .public Library (Atom (Dictionary Text Binary))) -(exception: .public (already_stored {class Text}) +(exception: .public (already_stored [class Text]) (exception.report ["Class" class])) -(exception: .public (unknown {class Text}) +(exception: .public (unknown [class Text]) (exception.report ["Class" class])) -(exception: .public (cannot_define {class Text} {error Text}) +(exception: .public (cannot_define [class Text + error Text]) (exception.report ["Class" class] ["Error" error])) diff --git a/stdlib/source/library/lux/target/jvm/reflection.lux b/stdlib/source/library/lux/target/jvm/reflection.lux index 5f24cce7f..740d43c63 100644 --- a/stdlib/source/library/lux/target/jvm/reflection.lux +++ b/stdlib/source/library/lux/target/jvm/reflection.lux @@ -111,12 +111,12 @@ (getConstructors [] [(java/lang/reflect/Constructor java/lang/Object)]) (getDeclaredMethods [] [java/lang/reflect/Method])]) -(exception: .public (unknown_class {class External}) +(exception: .public (unknown_class [class External]) (exception.report ["Class" (%.text class)])) (template [<name>] - [(exception: .public (<name> {jvm_type java/lang/reflect/Type}) + [(exception: .public (<name> [jvm_type java/lang/reflect/Type]) (exception.report ["Type" (java/lang/reflect/Type::getTypeName jvm_type)] ["Class" (|> jvm_type java/lang/Object::getClass java/lang/Object::toString)]))] @@ -272,23 +272,23 @@ #.None <else>))) -(exception: .public (cannot_correspond {class (java/lang/Class java/lang/Object)} - {type Type}) +(exception: .public (cannot_correspond [class (java/lang/Class java/lang/Object) + type Type]) (exception.report ["Class" (java/lang/Object::toString class)] ["Type" (%.type type)])) -(exception: .public (type_parameter_mismatch {expected Nat} - {actual Nat} - {class (java/lang/Class java/lang/Object)} - {type Type}) +(exception: .public (type_parameter_mismatch [expected Nat + actual Nat + class (java/lang/Class java/lang/Object) + type Type]) (exception.report ["Expected" (%.nat expected)] ["Actual" (%.nat actual)] ["Class" (java/lang/Object::toString class)] ["Type" (%.type type)])) -(exception: .public (non_jvm_type {type Type}) +(exception: .public (non_jvm_type [type Type]) (exception.report ["Type" (%.type type)])) @@ -326,17 +326,17 @@ _ (exception.except ..non_jvm_type [type]))) -(exception: .public (mistaken_field_owner {field java/lang/reflect/Field} - {owner (java/lang/Class java/lang/Object)} - {target (java/lang/Class java/lang/Object)}) +(exception: .public (mistaken_field_owner [field java/lang/reflect/Field + owner (java/lang/Class java/lang/Object) + target (java/lang/Class java/lang/Object)]) (exception.report ["Field" (java/lang/Object::toString field)] ["Owner" (java/lang/Object::toString owner)] ["Target" (java/lang/Object::toString target)])) (template [<name>] - [(exception: .public (<name> {field Text} - {class (java/lang/Class java/lang/Object)}) + [(exception: .public (<name> [field Text + class (java/lang/Class java/lang/Object)]) (exception.report ["Field" (%.text field)] ["Class" (java/lang/Object::toString class)]))] diff --git a/stdlib/source/library/lux/target/jvm/type/lux.lux b/stdlib/source/library/lux/target/jvm/type/lux.lux index 0c340843c..023d844e8 100644 --- a/stdlib/source/library/lux/target/jvm/type/lux.lux +++ b/stdlib/source/library/lux/target/jvm/type/lux.lux @@ -42,7 +42,7 @@ Mapping (dictionary.empty text.hash)) -(exception: .public (unknown_var {var Text}) +(exception: .public (unknown_var [var Text]) (exception.report ["Var" (%.text var)])) diff --git a/stdlib/source/library/lux/test.lux b/stdlib/source/library/lux/test.lux index a0d2c802d..ae72ceb48 100644 --- a/stdlib/source/library/lux/test.lux +++ b/stdlib/source/library/lux/test.lux @@ -362,7 +362,7 @@ (~ (code.text coverage)) (~ test))))))) -(exception: .public (error_during_execution {error Text}) +(exception: .public (error_during_execution [error Text]) (exception.report ["Error" (%.text error)])) diff --git a/stdlib/source/library/lux/time.lux b/stdlib/source/library/lux/time.lux index 1cb95dc1f..de7525d42 100644 --- a/stdlib/source/library/lux/time.lux +++ b/stdlib/source/library/lux/time.lux @@ -38,7 +38,7 @@ Nat (.nat (duration.millis duration.day))) -(exception: .public (time_exceeds_a_day {time Nat}) +(exception: .public (time_exceeds_a_day [time Nat]) (exception.report ["Time (in milli-seconds)" (n\encoded time)] ["Maximum (in milli-seconds)" (n\encoded (-- limit))])) @@ -57,7 +57,7 @@ (\ <>.monad in 0))) (template [<maximum> <parser> <exception> <sub_parser>] - [(exception: .public (<exception> {value Nat}) + [(exception: .public (<exception> [value Nat]) (exception.report ["Value" (n\encoded value)] ["Minimum" (n\encoded 0)] diff --git a/stdlib/source/library/lux/time/date.lux b/stdlib/source/library/lux/time/date.lux index 74f0d2b8c..a739ff6f5 100644 --- a/stdlib/source/library/lux/time/date.lux +++ b/stdlib/source/library/lux/time/date.lux @@ -49,7 +49,9 @@ (or (n.< ..minimum_day day) (n.> (..month_days year month) day))) -(exception: .public (invalid_day {year Year} {month Month} {day Nat}) +(exception: .public (invalid_day [year Year + month Month + day Nat]) (exception.report ["Value" (n\encoded day)] ["Minimum" (n\encoded ..minimum_day)] @@ -151,7 +153,7 @@ (\ <>.monad in 0))) (template [<minimum> <maximum> <parser> <exception>] - [(exception: .public (<exception> {value Nat}) + [(exception: .public (<exception> [value Nat]) (exception.report ["Value" (n\encoded value)] ["Minimum" (n\encoded <minimum>)] diff --git a/stdlib/source/library/lux/time/day.lux b/stdlib/source/library/lux/time/day.lux index 0a5c006d4..ecdbc79ab 100644 --- a/stdlib/source/library/lux/time/day.lux +++ b/stdlib/source/library/lux/time/day.lux @@ -91,7 +91,7 @@ #Saturday #Friday #Sunday #Saturday))) -(exception: .public (not_a_day_of_the_week {value Text}) +(exception: .public (not_a_day_of_the_week [value Text]) (exception.report ["Value" (text.format value)])) @@ -146,7 +146,7 @@ [<day> <number>]) (<pairs>))) - (exception: .public (invalid_day {number Nat}) + (exception: .public (invalid_day [number Nat]) (exception.report ["Number" (\ n.decimal encoded number)] ["Valid range" ($_ "lux text concat" diff --git a/stdlib/source/library/lux/time/month.lux b/stdlib/source/library/lux/time/month.lux index 4ae8ce7f8..57724be44 100644 --- a/stdlib/source/library/lux/time/month.lux +++ b/stdlib/source/library/lux/time/month.lux @@ -76,7 +76,7 @@ [<month> <number>]) (<pairs>))) - (exception: .public (invalid_month {number Nat}) + (exception: .public (invalid_month [number Nat]) (exception.report ["Number" (\ n.decimal encoded number)] ["Valid range" ($_ "lux text concat" @@ -200,7 +200,7 @@ #November #December)) -(exception: .public (not_a_month_of_the_year {value Text}) +(exception: .public (not_a_month_of_the_year [value Text]) (exception.report ["Value" (text.format value)])) diff --git a/stdlib/source/library/lux/tool/compiler.lux b/stdlib/source/library/lux/tool/compiler.lux index a91d6846b..21a73b224 100644 --- a/stdlib/source/library/lux/tool/compiler.lux +++ b/stdlib/source/library/lux/tool/compiler.lux @@ -44,6 +44,6 @@ (type: .public (Instancer s d o) (-> (Key d) (List Parameter) (Compiler s d o))) -(exception: .public (cannot_compile {module Module}) +(exception: .public (cannot_compile [module Module]) (exception.report ["Module" module])) diff --git a/stdlib/source/library/lux/tool/compiler/default/platform.lux b/stdlib/source/library/lux/tool/compiler/default/platform.lux index c2442dd78..be5d7df27 100644 --- a/stdlib/source/library/lux/tool/compiler/default/platform.lux +++ b/stdlib/source/library/lux/tool/compiler/default/platform.lux @@ -357,18 +357,18 @@ (or (dependence? import (value@ #depends_on) module) (dependence? module (value@ #depended_by) import)))) - (exception: .public (module_cannot_import_itself {module Module}) + (exception: .public (module_cannot_import_itself [module Module]) (exception.report ["Module" (%.text module)])) - (exception: .public (cannot_import_circular_dependency {importer Module} - {importee Module}) + (exception: .public (cannot_import_circular_dependency [importer Module + importee Module]) (exception.report ["Importer" (%.text importer)] ["importee" (%.text importee)])) - (exception: .public (cannot_import_twice {importer Module} - {duplicates (Set Module)}) + (exception: .public (cannot_import_twice [importer Module + duplicates (Set Module)]) (exception.report ["Importer" (%.text importer)] ["Duplicates" (%.list %.text (set.list duplicates))])) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/macro.lux b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/macro.lux index c0bc4a79e..0b9e317fe 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/macro.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/macro.lux @@ -13,13 +13,17 @@ [///// ["[0]" phase]]) -(exception: .public (expansion_failed {macro Name} {inputs (List Code)} {error Text}) +(exception: .public (expansion_failed [macro Name + inputs (List Code) + error Text]) (exception.report ["Macro" (%.name macro)] ["Inputs" (exception.listing %.code inputs)] ["Error" error])) -(exception: .public (must_have_single_expansion {macro Name} {inputs (List Code)} {outputs (List Code)}) +(exception: .public (must_have_single_expansion [macro Name + inputs (List Code) + outputs (List Code)]) (exception.report ["Macro" (%.name macro)] ["Inputs" (exception.listing %.code inputs)] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/generation.lux b/stdlib/source/library/lux/tool/compiler/language/lux/generation.lux index efad246fd..7ed71e658 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/generation.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/generation.lux @@ -36,12 +36,12 @@ (type: .public (Buffer directive) (Row [artifact.ID (Maybe Text) directive])) -(exception: .public (cannot_interpret {error Text}) +(exception: .public (cannot_interpret [error Text]) (exception.report ["Error" error])) (template [<name>] - [(exception: .public (<name> {artifact_id artifact.ID}) + [(exception: .public (<name> [artifact_id artifact.ID]) (exception.report ["Artifact ID" (%.nat artifact_id)]))] @@ -257,8 +257,8 @@ [learn_directive artifact.directive] ) -(exception: .public (unknown_definition {name Name} - {known_definitions (List Text)}) +(exception: .public (unknown_definition [name Name + known_definitions (List Text)]) (exception.report ["Definition" (name.short name)] ["Module" (name.module name)] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis.lux index c7f8130fe..c8c2b9fd3 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis.lux @@ -28,7 +28,7 @@ [meta [archive {"+" [Archive]}]]]]]]) -(exception: .public (unrecognized_syntax {code Code}) +(exception: .public (unrecognized_syntax [code Code]) (exception.report ["Code" (%.code code)])) ... TODO: Had to split the 'compile' function due to compilation issues diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux index fda27838d..ec8fb396e 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux @@ -34,29 +34,33 @@ [/// ["[1]" phase]]]]]]) -(exception: .public (cannot_match_with_pattern {type Type} {pattern Code}) +(exception: .public (cannot_match_with_pattern [type Type + pattern Code]) (exception.report ["Type" (%.type type)] ["Pattern" (%.code pattern)])) -(exception: .public (sum_has_no_case {case Nat} {type Type}) +(exception: .public (sum_has_no_case [case Nat + type Type]) (exception.report ["Case" (%.nat case)] ["Type" (%.type type)])) -(exception: .public (not_a_pattern {code Code}) +(exception: .public (not_a_pattern [code Code]) (exception.report ["Code" (%.code code)])) -(exception: .public (cannot_simplify_for_pattern_matching {type Type}) +(exception: .public (cannot_simplify_for_pattern_matching [type Type]) (exception.report ["Type" (%.type type)])) -(exception: .public (non_exhaustive_pattern_matching {input Code} {branches (List [Code Code])} {coverage Coverage}) +(exception: .public (non_exhaustive_pattern_matching [input Code + branches (List [Code Code]) + coverage Coverage]) (exception.report ["Input" (%.code input)] ["Branches" (%.code (code.record branches))] ["Coverage" (/coverage.%coverage coverage)])) -(exception: .public (cannot_have_empty_branches {message Text}) +(exception: .public (cannot_have_empty_branches [message Text]) message) (def: (re_quantify envs baseT) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case/coverage.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case/coverage.lux index 8427dd68b..5dcedd669 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case/coverage.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case/coverage.lux @@ -24,7 +24,7 @@ [/// ["[1]" phase ("[1]\[0]" monad)]]]]) -(exception: .public (invalid_tuple_pattern) +(exception: .public invalid_tuple_pattern "Tuple size must be >= 2") (def: cases @@ -167,7 +167,8 @@ ... always be a pattern prior to them that would match the input. ... Because of that, the presence of redundant patterns is assumed to ... be a bug, likely due to programmer carelessness. -(exception: .public (redundant_pattern {so_far Coverage} {addition Coverage}) +(exception: .public (redundant_pattern [so_far Coverage + addition Coverage]) (exception.report ["Coverage so-far" (%coverage so_far)] ["Coverage addition" (%coverage addition)])) @@ -212,7 +213,8 @@ (open: "coverage/[0]" ..equivalence) -(exception: .public (variants_do_not_match {addition_cases Nat} {so_far_cases Nat}) +(exception: .public (variants_do_not_match [addition_cases Nat + so_far_cases Nat]) (exception.report ["So-far Cases" (%.nat so_far_cases)] ["Addition Cases" (%.nat addition_cases)])) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/function.lux index 7574d89aa..fe0a32584 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/function.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/function.lux @@ -27,13 +27,18 @@ [reference {"+" []} [variable {"+" []}]]]]]]) -(exception: .public (cannot_analyse {expected Type} {function Text} {argument Text} {body Code}) +(exception: .public (cannot_analyse [expected Type + function Text + argument Text + body Code]) (ex.report ["Type" (%.type expected)] ["Function" function] ["Argument" argument] ["Body" (%.code body)])) -(exception: .public (cannot_apply {functionT Type} {functionC Code} {arguments (List Code)}) +(exception: .public (cannot_apply [functionT Type + functionC Code + arguments (List Code)]) (ex.report ["Function type" (%.type functionT)] ["Function" (%.code functionC)] ["Arguments" (|> arguments diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/inference.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/inference.lux index 96d5b870e..b6d610a7f 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/inference.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/inference.lux @@ -28,29 +28,34 @@ [meta [archive {"+" [Archive]}]]]]]]) -(exception: .public (variant_tag_out_of_bounds {size Nat} {tag Tag} {type Type}) +(exception: .public (variant_tag_out_of_bounds [size Nat + tag Tag + type Type]) (exception.report ["Tag" (%.nat tag)] ["Variant size" (%.int (.int size))] ["Variant type" (%.type type)])) -(exception: .public (cannot_infer {type Type} {args (List Code)}) +(exception: .public (cannot_infer [type Type + args (List Code)]) (exception.report ["Type" (%.type type)] ["Arguments" (exception.listing %.code args)])) -(exception: .public (cannot_infer_argument {inferred Type} {argument Code}) +(exception: .public (cannot_infer_argument [inferred Type + argument Code]) (exception.report ["Inferred Type" (%.type inferred)] ["Argument" (%.code argument)])) -(exception: .public (smaller_variant_than_expected {expected Nat} {actual Nat}) +(exception: .public (smaller_variant_than_expected [expected Nat + actual Nat]) (exception.report ["Expected" (%.int (.int expected))] ["Actual" (%.int (.int actual))])) (template [<name>] - [(exception: .public (<name> {type Type}) + [(exception: .public (<name> [type Type]) (%.type type))] [not_a_variant_type] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/module.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/module.lux index 845d07f17..31ace4429 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/module.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/module.lux @@ -24,12 +24,13 @@ (type: .public Tag Text) -(exception: .public (unknown_module {module Text}) +(exception: .public (unknown_module [module Text]) (exception.report ["Module" module])) (template [<name>] - [(exception: .public (<name> {tags (List Text)} {owner Type}) + [(exception: .public (<name> [tags (List Text) + owner Type]) (exception.report ["Tags" (text.interposed " " tags)] ["Type" (%.type owner)]))] @@ -38,7 +39,8 @@ [cannot_declare_tags_for_foreign_type] ) -(exception: .public (cannot_define_more_than_once {name Name} {already_existing Global}) +(exception: .public (cannot_define_more_than_once [name Name + already_existing Global]) (exception.report ["Definition" (%.name name)] ["Original" (case already_existing @@ -57,7 +59,8 @@ (#.Slot _) (format "slot " (%.name name)))])) -(exception: .public (can_only_change_state_of_active_module {module Text} {state Module_State}) +(exception: .public (can_only_change_state_of_active_module [module Text + state Module_State]) (exception.report ["Module" module] ["Desired state" (case state diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/reference.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/reference.lux index 33b1c7e32..f3bc9d282 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/reference.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/reference.lux @@ -20,16 +20,17 @@ ["[1][0]" reference] ["[1]" phase]]]]]) -(exception: .public (foreign_module_has_not_been_imported {current Text} {foreign Text}) +(exception: .public (foreign_module_has_not_been_imported [current Text + foreign Text]) (exception.report ["Current" current] ["Foreign" foreign])) -(exception: .public (definition_has_not_been_exported {definition Name}) +(exception: .public (definition_has_not_been_exported [definition Name]) (exception.report ["Definition" (%.name definition)])) -(exception: .public (labels_are_not_definitions {definition Name}) +(exception: .public (labels_are_not_definitions [definition Name]) (exception.report ["Label" (%.name definition)])) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/structure.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/structure.lux index 3c18c178b..f6c226e9a 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/structure.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/structure.lux @@ -37,14 +37,17 @@ [meta [archive {"+" [Archive]}]]]]]]) -(exception: .public (invalid_variant_type {type Type} {tag Tag} {code Code}) +(exception: .public (invalid_variant_type [type Type + tag Tag + code Code]) (exception.report ["Type" (%.type type)] ["Tag" (%.nat tag)] ["Expression" (%.code code)])) (template [<name>] - [(exception: .public (<name> {type Type} {members (List Code)}) + [(exception: .public (<name> [type Type + members (List Code)]) (exception.report ["Type" (%.type type)] ["Expression" (%.code (` [(~+ members)]))]))] @@ -53,11 +56,13 @@ [cannot_analyse_tuple] ) -(exception: .public (not_a_quantified_type {type Type}) +(exception: .public (not_a_quantified_type [type Type]) (%.type type)) (template [<name>] - [(exception: .public (<name> {type Type} {tag Tag} {code Code}) + [(exception: .public (<name> [type Type + tag Tag + code Code]) (exception.report ["Type" (%.type type)] ["Tag" (%.nat tag)] @@ -68,7 +73,8 @@ ) (template [<name>] - [(exception: .public (<name> {key Name} {record (List [Name Code])}) + [(exception: .public (<name> [key Name + record (List [Name Code])]) (exception.report ["Tag" (%.code (code.tag key))] ["Record" (%.code (code.record (list\each (function (_ [keyI valC]) @@ -78,12 +84,16 @@ [cannot_repeat_tag] ) -(exception: .public (slot_does_not_belong_to_record {key Name} {type Type}) +(exception: .public (slot_does_not_belong_to_record [key Name + type Type]) (exception.report ["Tag" (%.code (code.tag key))] ["Type" (%.type type)])) -(exception: .public (record_size_mismatch {expected Nat} {actual Nat} {type Type} {record (List [Name Code])}) +(exception: .public (record_size_mismatch [expected Nat + actual Nat + type Type + record (List [Name Code])]) (exception.report ["Expected" (%.nat expected)] ["Actual" (%.nat actual)] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/directive.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/directive.lux index 7a42fbb7e..3d3163553 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/directive.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/directive.lux @@ -28,15 +28,15 @@ [meta [archive {"+" [Archive]}]]]]]) -(exception: .public (not_a_directive {code Code}) +(exception: .public (not_a_directive [code Code]) (exception.report ["Directive" (%.code code)])) -(exception: .public (invalid_macro_call {code Code}) +(exception: .public (invalid_macro_call [code Code]) (exception.report ["Code" (%.code code)])) -(exception: .public (macro_was_not_found {name Name}) +(exception: .public (macro_was_not_found [name Name]) (exception.report ["Name" (%.name name)])) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension.lux index 637c7e0a6..d54049e4e 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension.lux @@ -61,22 +61,27 @@ (type: .public (Phase s i o) (//.Phase (State s i o) i o)) -(exception: .public (cannot_overwrite {name Name}) +(exception: .public (cannot_overwrite [name Name]) (exception.report ["Extension" (%.text name)])) -(exception: .public (incorrect_arity {name Name} {arity Nat} {args Nat}) +(exception: .public (incorrect_arity [name Name + arity Nat + args Nat]) (exception.report ["Extension" (%.text name)] ["Expected" (%.nat arity)] ["Actual" (%.nat args)])) -(exception: .public [a] (invalid_syntax {name Name} {%format (Format a)} {inputs (List a)}) +(exception: .public [a] (invalid_syntax [name Name + %format (Format a) + inputs (List a)]) (exception.report ["Extension" (%.text name)] ["Inputs" (exception.listing %format inputs)])) -(exception: .public [s i o] (unknown {name Name} {bundle (Bundle s i o)}) +(exception: .public [s i o] (unknown [name Name + bundle (Bundle s i o)]) (exception.report ["Extension" (%.text name)] ["Available" (|> bundle diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux index 8591286fb..9ea592c20 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux @@ -115,7 +115,8 @@ (getDeclaredAnnotations [] [java/lang/annotation/Annotation])]) (template [<name>] - [(exception: .public (<name> {class External} {field Text}) + [(exception: .public (<name> [class External + field Text]) (exception.report ["Class" (%.text class)] ["Field" (%.text field)]))] @@ -124,13 +125,15 @@ [deprecated_field] ) -(exception: .public (deprecated_method {class External} {method Text} {type .Type}) +(exception: .public (deprecated_method [class External + method Text + type .Type]) (exception.report ["Class" (%.text class)] ["Method" (%.text method)] ["Type" (%.type type)])) -(exception: .public (deprecated_class {class External}) +(exception: .public (deprecated_class [class External]) (exception.report ["Class" (%.text class)])) @@ -204,7 +207,7 @@ #exceptions (List .Type)])) (template [<name>] - [(exception: .public (<name> {type .Type}) + [(exception: .public (<name> [type .Type]) (exception.report ["Type" (%.type type)]))] @@ -215,7 +218,7 @@ ) (template [<name>] - [(exception: .public (<name> {class External}) + [(exception: .public (<name> [class External]) (exception.report ["Class/type" (%.text class)]))] @@ -225,10 +228,10 @@ ) (template [<name>] - [(exception: .public (<name> {class External} - {method Text} - {inputsJT (List (Type Value))} - {hints (List Method_Signature)}) + [(exception: .public (<name> [class External + method Text + inputsJT (List (Type Value)) + hints (List Method_Signature)]) (exception.report ["Class" class] ["Method" method] @@ -239,14 +242,16 @@ [too_many_candidates] ) -(exception: .public (cannot_cast {from .Type} {to .Type} {value Code}) +(exception: .public (cannot_cast [from .Type + to .Type + value Code]) (exception.report ["From" (%.type from)] ["To" (%.type to)] ["Value" (%.code value)])) (template [<name>] - [(exception: .public (<name> {message Text}) + [(exception: .public (<name> [message Text]) message)] [primitives_cannot_have_type_parameters] @@ -1589,7 +1594,7 @@ ) (template [<name>] - [(exception: .public (<name> {methods (List [Text (Type Method)])}) + [(exception: .public (<name> [methods (List [Text (Type Method)])]) (exception.report ["Methods" (exception.listing (function (_ [name type]) @@ -1889,12 +1894,15 @@ <code>.any ))) -(exception: .public (unknown_super {name Text} {supers (List (Type Class))}) +(exception: .public (unknown_super [name Text + supers (List (Type Class))]) (exception.report ["Name" (%.text name)] ["Available" (exception.listing (|>> jvm_parser.read_class product.left) supers)])) -(exception: .public (mismatched_super_parameters {name Text} {expected Nat} {actual Nat}) +(exception: .public (mismatched_super_parameters [name Text + expected Nat + actual Nat]) (exception.report ["Name" (%.text name)] ["Expected" (%.nat expected)] @@ -2052,8 +2060,8 @@ not)) sub_set)) -(exception: .public (class_parameter_mismatch {expected (List Text)} - {actual (List (Type Parameter))}) +(exception: .public (class_parameter_mismatch [expected (List Text) + actual (List (Type Parameter))]) (exception.report ["Expected (amount)" (%.nat (list.size expected))] ["Expected (parameters)" (exception.listing %.text expected)] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux index a8e9ae29f..fb283bf9e 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux @@ -81,7 +81,7 @@ ... TODO: Get rid of this ASAP (as_is - (exception: .public (char_text_must_be_size_1 {text Text}) + (exception: .public (char_text_must_be_size_1 [text Text]) (exception.report ["Text" (%.text text)])) @@ -199,7 +199,7 @@ (typeA.with_type input (phase archive valueC))))])) -(exception: .public (not_a_type {symbol Name}) +(exception: .public (not_a_type [symbol Name]) (exception.report ["Symbol" (%.name symbol)])) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux index 1da688392..0ebdde096 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux @@ -305,13 +305,16 @@ (in [#/////directive.imports imports #/////directive.referrals (list)])))])) -(exception: .public (cannot_alias_an_alias {local Alias} {foreign Alias} {target Name}) +(exception: .public (cannot_alias_an_alias [local Alias + foreign Alias + target Name]) (exception.report ["Local alias" (%.name local)] ["Foreign alias" (%.name foreign)] ["Target definition" (%.name target)])) -(exception: .public (cannot_alias_a_label {local Alias} {foreign Alias}) +(exception: .public (cannot_alias_a_label [local Alias + foreign Alias]) (exception.report ["Alias" (%.name local)] ["Label" (%.name foreign)])) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/host.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/host.lux index ac5f0fce9..e0626e0b6 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/host.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/host.lux @@ -330,7 +330,7 @@ [return Return parser.return] ) -(exception: .public (not_an_object_array {arrayJT (Type Array)}) +(exception: .public (not_an_object_array [arrayJT (Type Array)]) (exception.report ["JVM Type" (|> arrayJT type.signature signature.signature)])) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/host.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/host.lux index df781631c..6e5030da6 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/host.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/host.lux @@ -60,18 +60,21 @@ (def: init::type (type.method [(list) type.void (list)])) (def: init::modifier ($_ modifier\composite method.public method.static method.strict)) -(exception: .public (cannot_load {class Text} {error Text}) +(exception: .public (cannot_load [class Text + error Text]) (exception.report ["Class" class] ["Error" error])) -(exception: .public (invalid_field {class Text} {field Text} {error Text}) +(exception: .public (invalid_field [class Text + field Text + error Text]) (exception.report ["Class" class] ["Field" field] ["Error" error])) -(exception: .public (invalid_value {class Text}) +(exception: .public (invalid_value [class Text]) (exception.report ["Class" class])) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/common.lux index 3b820934f..4b9ef22e4 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/common.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/common.lux @@ -113,7 +113,7 @@ Unary (runtimeT.lux//try riskyO)) -(exception: .public (Wrong_Syntax {message Text}) +(exception: .public (Wrong_Syntax [message Text]) message) (def: .public (wrong_syntax procedure args) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/function.lux index 316a1bed0..96139976a 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/function.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/function.lux @@ -27,7 +27,8 @@ ["[1]/[0]" variable {"+" [Register Variable]}]] ["[0]" phase ("[1]\[0]" monad)]]]]) -(exception: .public (cannot_find_foreign_variable_in_environment {foreign Register} {environment (Environment Synthesis)}) +(exception: .public (cannot_find_foreign_variable_in_environment [foreign Register + environment (Environment Synthesis)]) (exception.report ["Foreign" (%.nat foreign)] ["Environment" (exception.listing /.%synthesis environment)])) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/variable.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/variable.lux index afa30d83c..91e229d1a 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/variable.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/variable.lux @@ -209,7 +209,7 @@ (#.Item head tail)]))))) (template [<name>] - [(exception: .public (<name> {register Register}) + [(exception: .public (<name> [register Register]) (exception.report ["Register" (%.nat register)]))] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/program.lux b/stdlib/source/library/lux/tool/compiler/language/lux/program.lux index ecafe7615..f085683fc 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/program.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/program.lux @@ -28,7 +28,7 @@ Text "") -(exception: .public (cannot_find_program {modules (List Module)}) +(exception: .public (cannot_find_program [modules (List Module)]) (exception.report ["Modules" (exception.listing %.text modules)])) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux b/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux index a04571b5b..3df8bb802 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux @@ -144,7 +144,7 @@ ["." name_separator] ) -(exception: .public (end_of_file {module Text}) +(exception: .public (end_of_file [module Text]) (exception.report ["Module" (%.text module)])) @@ -155,7 +155,10 @@ (let [end (|> start (!n/+ amount_of_input_shown) (n.min ("lux text size" input)))] (!clip start end input))) -(exception: .public (unrecognized_input {[file line column] Location} {context Text} {input Text} {offset Offset}) +(exception: .public (unrecognized_input [[file line column] Location + context Text + input Text + offset Offset]) (exception.report ["File" file] ["Line" (%.nat line)] @@ -163,7 +166,7 @@ ["Context" (%.text context)] ["Input" (input_at offset input)])) -(exception: .public (text_cannot_contain_new_lines {text Text}) +(exception: .public (text_cannot_contain_new_lines [text Text]) (exception.report ["Text" (%.text text)])) diff --git a/stdlib/source/library/lux/tool/compiler/meta/archive.lux b/stdlib/source/library/lux/tool/compiler/meta/archive.lux index d57f4a08b..d7d2fe237 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/archive.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/archive.lux @@ -41,29 +41,29 @@ (type: .public Output (Row [artifact.ID (Maybe Text) Binary])) -(exception: .public (unknown_document {module Module} - {known_modules (List Module)}) +(exception: .public (unknown_document [module Module + known_modules (List Module)]) (exception.report ["Module" (%.text module)] ["Known Modules" (exception.listing %.text known_modules)])) -(exception: .public (cannot_replace_document {module Module} - {old (Document Any)} - {new (Document Any)}) +(exception: .public (cannot_replace_document [module Module + old (Document Any) + new (Document Any)]) (exception.report ["Module" (%.text module)] ["Old key" (signature.description (document.signature old))] ["New key" (signature.description (document.signature new))])) -(exception: .public (module_has_already_been_reserved {module Module}) +(exception: .public (module_has_already_been_reserved [module Module]) (exception.report ["Module" (%.text module)])) -(exception: .public (module_must_be_reserved_before_it_can_be_added {module Module}) +(exception: .public (module_must_be_reserved_before_it_can_be_added [module Module]) (exception.report ["Module" (%.text module)])) -(exception: .public (module_is_only_reserved {module Module}) +(exception: .public (module_is_only_reserved [module Module]) (exception.report ["Module" (%.text module)])) @@ -240,7 +240,8 @@ [version next] (binary.result ..writer)))) - (exception: .public (version_mismatch {expected Version} {actual Version}) + (exception: .public (version_mismatch [expected Version + actual Version]) (exception.report ["Expected" (%.nat expected)] ["Actual" (%.nat actual)])) diff --git a/stdlib/source/library/lux/tool/compiler/meta/archive/artifact.lux b/stdlib/source/library/lux/tool/compiler/meta/archive/artifact.lux index e3ad0fd89..a9851c301 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/archive/artifact.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/archive/artifact.lux @@ -124,7 +124,7 @@ (row\each (value@ #category)) artifacts))) - (exception: .public (invalid_category {tag Nat}) + (exception: .public (invalid_category [tag Nat]) (exception.report ["Tag" (%.nat tag)])) diff --git a/stdlib/source/library/lux/tool/compiler/meta/archive/document.lux b/stdlib/source/library/lux/tool/compiler/meta/archive/document.lux index ddb71ac93..3fcf381d3 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/archive/document.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/archive/document.lux @@ -20,7 +20,8 @@ ["[0]" key {"+" [Key]}] [descriptor {"+" [Module]}]]) -(exception: .public (invalid_signature {expected Signature} {actual Signature}) +(exception: .public (invalid_signature [expected Signature + actual Signature]) (exception.report ["Expected" (signature.description expected)] ["Actual" (signature.description actual)])) diff --git a/stdlib/source/library/lux/tool/compiler/meta/io/archive.lux b/stdlib/source/library/lux/tool/compiler/meta/io/archive.lux index d6a427d0b..1d7baccbd 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/io/archive.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/io/archive.lux @@ -51,9 +51,9 @@ ["[0]" directive] ["[1]/[0]" program]]]]]]) -(exception: .public (cannot_prepare {archive file.Path} - {module_id archive.ID} - {error Text}) +(exception: .public (cannot_prepare [archive file.Path + module_id archive.ID + error Text]) (exception.report ["Archive" archive] ["Module ID" (%.nat module_id)] diff --git a/stdlib/source/library/lux/tool/compiler/meta/io/context.lux b/stdlib/source/library/lux/tool/compiler/meta/io/context.lux index 177f552e3..af43ef991 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/io/context.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/io/context.lux @@ -31,12 +31,13 @@ [descriptor {"+" [Module]}]] ["/[1]" // {"+" [Input]}]]]) -(exception: .public (cannot_find_module {importer Module} {module Module}) +(exception: .public (cannot_find_module [importer Module + module Module]) (exception.report ["Module" (%.text module)] ["Importer" (%.text importer)])) -(exception: .public (cannot_read_module {module Module}) +(exception: .public (cannot_read_module [module Module]) (exception.report ["Module" (%.text module)])) diff --git a/stdlib/source/library/lux/tool/interpreter.lux b/stdlib/source/library/lux/tool/interpreter.lux index 6385fe34c..8a12cd2db 100644 --- a/stdlib/source/library/lux/tool/interpreter.lux +++ b/stdlib/source/library/lux/tool/interpreter.lux @@ -29,7 +29,7 @@ ["[0]" console {"+" [Console]}]]]] ["[0]" /type]) -(exception: .public (error {message Text}) +(exception: .public (error [message Text]) message) (def: .public module "<INTERPRETER>") diff --git a/stdlib/source/library/lux/type/check.lux b/stdlib/source/library/lux/type/check.lux index 310918cee..51bb8d13e 100644 --- a/stdlib/source/library/lux/type/check.lux +++ b/stdlib/source/library/lux/type/check.lux @@ -27,26 +27,30 @@ (template: (!text\= reference subject) [("lux text =" reference subject)]) -(exception: .public (unknown_type_var {id Nat}) +(exception: .public (unknown_type_var [id Nat]) (exception.report ["ID" (n\encoded id)])) -(exception: .public (unbound_type_var {id Nat}) +(exception: .public (unbound_type_var [id Nat]) (exception.report ["ID" (n\encoded id)])) -(exception: .public (invalid_type_application {funcT Type} {argT Type}) +(exception: .public (invalid_type_application [funcT Type + argT Type]) (exception.report ["Type function" (//.format funcT)] ["Type argument" (//.format argT)])) -(exception: .public (cannot_rebind_var {id Nat} {type Type} {bound Type}) +(exception: .public (cannot_rebind_var [id Nat + type Type + bound Type]) (exception.report ["Var" (n\encoded id)] ["Wanted Type" (//.format type)] ["Current Type" (//.format bound)])) -(exception: .public (type_check_failed {expected Type} {actual Type}) +(exception: .public (type_check_failed [expected Type + actual Type]) (exception.report ["Expected" (//.format expected)] ["Actual" (//.format actual)])) diff --git a/stdlib/source/library/lux/type/dynamic.lux b/stdlib/source/library/lux/type/dynamic.lux index 2ffccf010..0709b67e2 100644 --- a/stdlib/source/library/lux/type/dynamic.lux +++ b/stdlib/source/library/lux/type/dynamic.lux @@ -15,7 +15,8 @@ ["[0]" type abstract]]]) -(exception: .public (wrong_type {expected Type} {actual Type}) +(exception: .public (wrong_type [expected Type + actual Type]) (exception.report ["Expected" (%.type expected)] ["Actual" (%.type actual)])) diff --git a/stdlib/source/library/lux/type/resource.lux b/stdlib/source/library/lux/type/resource.lux index 5743ab70b..244644d57 100644 --- a/stdlib/source/library/lux/type/resource.lux +++ b/stdlib/source/library/lux/type/resource.lux @@ -101,7 +101,7 @@ (\ monad in [keys (:representation resource)])))] ) -(exception: .public (index_cannot_be_repeated {index Nat}) +(exception: .public (index_cannot_be_repeated [index Nat]) (exception.report ["Index" (%.nat index)])) diff --git a/stdlib/source/library/lux/world/console.lux b/stdlib/source/library/lux/world/console.lux index 304c8c3c9..a31de2fdc 100644 --- a/stdlib/source/library/lux/world/console.lux +++ b/stdlib/source/library/lux/world/console.lux @@ -60,8 +60,7 @@ ("static" out java/io/PrintStream)]) (template [<name>] - [(exception: .public (<name>) - "")] + [(exception: .public <name>)] [cannot_open] [cannot_close] diff --git a/stdlib/source/library/lux/world/file.lux b/stdlib/source/library/lux/world/file.lux index 3eb8ea3e6..9cbb0f8e4 100644 --- a/stdlib/source/library/lux/world/file.lux +++ b/stdlib/source/library/lux/world/file.lux @@ -142,7 +142,7 @@ (format parent (\ fs separator) child)) (template [<name>] - [(exception: .public (<name> {file Path}) + [(exception: .public (<name> [file Path]) (exception.report ["Path" file]))] @@ -156,7 +156,8 @@ [cannot_read_all_data] ) -(with_expansions [<for_jvm> (as_is (exception: .public (cannot_modify_file {instant Instant} {file Path}) +(with_expansions [<for_jvm> (as_is (exception: .public (cannot_modify_file [instant Instant + file Path]) (exception.report ["Instant" (%.instant instant)] ["Path" file])) @@ -837,7 +838,7 @@ ... (def: default_separator (..DIRECTORY_SEPARATOR)) ... (template [<name>] - ... [(exception: .public (<name> {file Path}) + ... [(exception: .public (<name> [file Path]) ... (exception.report ... ["Path" file]))] diff --git a/stdlib/source/library/lux/world/file/watch.lux b/stdlib/source/library/lux/world/file/watch.lux index 73ef783b9..d26778c03 100644 --- a/stdlib/source/library/lux/world/file/watch.lux +++ b/stdlib/source/library/lux/world/file/watch.lux @@ -93,7 +93,7 @@ poll))) (template [<name>] - [(exception: .public (<name> {path //.Path}) + [(exception: .public (<name> [path //.Path]) (exception.report ["Path" (%.text path)]))] diff --git a/stdlib/source/library/lux/world/program.lux b/stdlib/source/library/lux/world/program.lux index ea0423155..3203a12b1 100644 --- a/stdlib/source/library/lux/world/program.lux +++ b/stdlib/source/library/lux/world/program.lux @@ -35,7 +35,7 @@ [file {"+" [Path]}] [shell {"+" [Exit]}]]) -(exception: .public (unknown_environment_variable {name Text}) +(exception: .public (unknown_environment_variable [name Text]) (exception.report ["Name" (%.text name)])) diff --git a/stdlib/source/program/aedifex.lux b/stdlib/source/program/aedifex.lux index a275eebea..682c30099 100644 --- a/stdlib/source/program/aedifex.lux +++ b/stdlib/source/program/aedifex.lux @@ -93,8 +93,8 @@ (in (#try.Failure ""))))] (in output))) -(exception: (cannot_find_repository {repository Text} - {options (Dictionary Text Address)}) +(exception: (cannot_find_repository [repository Text + options (Dictionary Text Address)]) (exception.report ["Repository" (%.text repository)] ["Options" (exception.listing (function (_ [name repo]) diff --git a/stdlib/source/program/aedifex/artifact/time/date.lux b/stdlib/source/program/aedifex/artifact/time/date.lux index 18688bf1a..e5f0f7617 100644 --- a/stdlib/source/program/aedifex/artifact/time/date.lux +++ b/stdlib/source/program/aedifex/artifact/time/date.lux @@ -32,7 +32,7 @@ (def: min_year +1,000) (def: max_year +9,999) -(exception: .public (year_is_out_of_range {year year.Year}) +(exception: .public (year_is_out_of_range [year year.Year]) (exception.report ["Minimum" (%.int ..min_year)] ["Maximum" (%.int ..max_year)] diff --git a/stdlib/source/program/aedifex/dependency/resolution.lux b/stdlib/source/program/aedifex/dependency/resolution.lux index 04609b10b..3bb2fb687 100644 --- a/stdlib/source/program/aedifex/dependency/resolution.lux +++ b/stdlib/source/program/aedifex/dependency/resolution.lux @@ -60,7 +60,9 @@ ["[1]/[0]" snapshot]]]]) (template [<name>] - [(exception: .public (<name> {artifact Artifact} {extension Extension} {hash Text}) + [(exception: .public (<name> [artifact Artifact + extension Extension + hash Text]) (exception.report ["Artifact" (///artifact.format artifact)] ["Extension" (%.text extension)] @@ -157,7 +159,7 @@ (Equivalence Resolution) (dictionary.equivalence ///package.equivalence)) -(exception: .public (cannot_resolve {dependency Dependency}) +(exception: .public (cannot_resolve [dependency Dependency]) (exception.report ["Artifact" (%.text (///artifact.format (value@ #//.artifact dependency)))] ["Type" (%.text (value@ #//.type dependency))])) diff --git a/stdlib/source/program/aedifex/hash.lux b/stdlib/source/program/aedifex/hash.lux index 996858e3e..74e54679f 100644 --- a/stdlib/source/program/aedifex/hash.lux +++ b/stdlib/source/program/aedifex/hash.lux @@ -77,14 +77,15 @@ (def: hex_per_chunk (n.* hex_per_byte i64.bytes_per_i64)) - (exception: .public (not_a_hash {size Nat} {value Text}) + (exception: .public (not_a_hash [size Nat + value Text]) (exception.report ["Pseudo hash" (%.text value)] ["Expected size" (%.nat size)] ["Actual size" (%.nat (text.size value))])) (template [<name> <size>] - [(exception: .public (<name> {data Binary}) + [(exception: .public (<name> [data Binary]) (exception.report ["Pseudo hash" (%.text (..encoded data))] ["Expected size" (%.nat <size>)] diff --git a/stdlib/source/program/aedifex/project.lux b/stdlib/source/program/aedifex/project.lux index e7ed18148..1d1d55998 100644 --- a/stdlib/source/program/aedifex/project.lux +++ b/stdlib/source/program/aedifex/project.lux @@ -41,11 +41,12 @@ (def: composite (dictionary.merged_with (\ //.monoid composite)))) -(exception: .public (unknown_profile {name Name}) +(exception: .public (unknown_profile [name Name]) (exception.report ["Name" (%.text name)])) -(exception: .public (circular_dependency {dependee Name} {dependent Name}) +(exception: .public (circular_dependency [dependee Name + dependent Name]) (exception.report ["Dependent" (%.text dependent)] ["Dependee" (%.text dependee)])) diff --git a/stdlib/source/program/aedifex/repository/remote.lux b/stdlib/source/program/aedifex/repository/remote.lux index 69fd9c255..4f852c2b7 100644 --- a/stdlib/source/program/aedifex/repository/remote.lux +++ b/stdlib/source/program/aedifex/repository/remote.lux @@ -34,7 +34,8 @@ URL) (template [<name>] - [(exception: .public (<name> {url URL} {status Nat}) + [(exception: .public (<name> [url URL + status Nat]) (exception.report ["URL" (%.text url)] ["Status Code" (%.nat status)]))] diff --git a/stdlib/source/program/compositor/import.lux b/stdlib/source/program/compositor/import.lux index b15c95080..6b092e546 100644 --- a/stdlib/source/program/compositor/import.lux +++ b/stdlib/source/program/compositor/import.lux @@ -34,7 +34,8 @@ (exception: .public useless_tar_entry) -(exception: .public (duplicate {library Library} {module Module}) +(exception: .public (duplicate [library Library + module Module]) (exception.report ["Module" (%.text module)] ["Library" (%.text library)])) diff --git a/stdlib/source/test/aedifex/repository.lux b/stdlib/source/test/aedifex/repository.lux index 7958dc7bb..0cbea2733 100644 --- a/stdlib/source/test/aedifex/repository.lux +++ b/stdlib/source/test/aedifex/repository.lux @@ -42,11 +42,11 @@ (-> Version Artifact) (|>> ["com.github.luxlang" "test-artifact"])) -(exception: (not_found {uri URI}) +(exception: (not_found [uri URI]) (exception.report ["URI" (%.text uri)])) -(exception: (cannot_upload {uri URI}) +(exception: (cannot_upload [uri URI]) (exception.report ["URI" (%.text uri)])) diff --git a/stdlib/source/test/lux/control/concurrency/actor.lux b/stdlib/source/test/lux/control/concurrency/actor.lux index 7616ea1a9..012a9f796 100644 --- a/stdlib/source/test/lux/control/concurrency/actor.lux +++ b/stdlib/source/test/lux/control/concurrency/actor.lux @@ -33,7 +33,7 @@ [((on_mail message state self) (message state self)) - (message: (count! {increment Nat} state self) + (message: (count! [increment Nat] state self) Nat (let [state' (n.+ increment state)] (async\in (#try.Success [state' state']))))] diff --git a/stdlib/source/test/lux/control/exception.lux b/stdlib/source/test/lux/control/exception.lux index cbb91dec4..faeac513e 100644 --- a/stdlib/source/test/lux/control/exception.lux +++ b/stdlib/source/test/lux/control/exception.lux @@ -20,7 +20,7 @@ (exception: another_exception) (def: label "YOLO") -(exception: (custom_exception {value Nat}) +(exception: (custom_exception [value Nat]) (/.report [label (%.nat value)])) (def: .public test diff --git a/stdlib/source/test/lux/macro/syntax/input.lux b/stdlib/source/test/lux/macro/syntax/input.lux index 0f4060cdc..bed8f2768 100644 --- a/stdlib/source/test/lux/macro/syntax/input.lux +++ b/stdlib/source/test/lux/macro/syntax/input.lux @@ -10,6 +10,9 @@ ["[0]" try] [parser ["<[0]>" code]]] + [data + [collection + ["[0]" list]]] [math ["[0]" random {"+" [Random]}] [number @@ -37,10 +40,9 @@ (do random.monad [expected ..random] (_.cover [/.format /.parser] - (case (<code>.result /.parser - (list (/.format expected))) + (case (<code>.result /.parser (list (/.format (list expected)))) (#try.Failure _) false (#try.Success actual) - (\ /.equivalence = expected actual))))))) + (\ (list.equivalence /.equivalence) = (list expected) actual))))))) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/primitive.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/primitive.lux index da4112798..d3ef99670 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/primitive.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/primitive.lux @@ -65,7 +65,8 @@ [Text code.text (r.unicode 5)] ))))) -(exception: (wrong_inference {expected Type} {inferred Type}) +(exception: (wrong_inference [expected Type + inferred Type]) (exception.report ["Expected" (%.type expected)] ["Inferred" (%.type inferred)])) |