diff options
251 files changed, 1474 insertions, 1696 deletions
diff --git a/lux-js/source/program.lux b/lux-js/source/program.lux index 6d13abf41..d90d5e711 100644 --- a/lux-js/source/program.lux +++ b/lux-js/source/program.lux @@ -176,11 +176,11 @@ (org/openjdk/nashorn/api/scripting/AbstractJSObject [] (getMember self [member java/lang/String]) java/lang/Object (case (ffi.of_string member) - (pattern (static runtime.i64_high_field)) + (static runtime.i64_high_field) (|> value .nat runtime.high jvm_int (ffi.is java/lang/Object)) - (pattern (static runtime.i64_low_field)) + (static runtime.i64_low_field) (|> value .nat runtime.low jvm_int (ffi.is java/lang/Object)) @@ -275,12 +275,12 @@ (|> (::slice js_object value) (ffi.is java/lang/Object)) - (pattern (static runtime.variant_tag_field)) + (static runtime.variant_tag_field) (|> value (array.read! 0) maybe.trusted) - (pattern (static runtime.variant_flag_field)) + (static runtime.variant_flag_field) (case (array.read! 1 value) {.#Some set!} set! @@ -288,7 +288,7 @@ _ (ffi.null)) - (pattern (static runtime.variant_value_field)) + (static runtime.variant_value_field) (|> value (array.read! 2) maybe.trusted diff --git a/lux-lua/source/program.lux b/lux-lua/source/program.lux index 7b13d2d9d..75ba9a99c 100644 --- a/lux-lua/source/program.lux +++ b/lux-lua/source/program.lux @@ -296,11 +296,11 @@ (loop (again [lux_function abstraction input/* input/*]) (`` (`` (case input/* - (pattern (list)) + (list) (in self) (,, (with_template [<arity>] - [(pattern (list (,, (static.literals function.identity (..input/* <arity>))))) + [(list (,, (static.literals function.identity (..input/* <arity>)))) (in (to_host ((as (,, (static.literal function.identity (..function/* <arity>))) lux_function) (,, (static.literals function.identity (..input/* <arity>))))))] @@ -312,7 +312,7 @@ [5] )) - (pattern (list.partial (,, (static.literals function.identity (..input/* 5))) input/+)) + (list.partial (,, (static.literals function.identity (..input/* 5))) input/+) (again ((as (,, (static.literal function.identity (..function/* 5))) lux_function) (,, (static.literals function.identity (..input/* 5)))) @@ -397,7 +397,7 @@ (case (ffi.as net/sandius/rembulan/ByteString field) {.#Some field} (case (ffi.of_string (net/sandius/rembulan/ByteString::decode field)) - (pattern (static runtime.variant_tag_field)) + (static runtime.variant_tag_field) (case (array.item 0 value) {.#Some it} (|> it @@ -407,7 +407,7 @@ {.#None} (undefined)) - (pattern (static runtime.variant_flag_field)) + (static runtime.variant_flag_field) (case (array.item 1 value) {.#Some _} (as java/lang/Object "") @@ -415,7 +415,7 @@ {.#None} (ffi.null)) - (pattern (static runtime.variant_value_field)) + (static runtime.variant_value_field) (|> value (array.item 2) maybe.trusted diff --git a/lux-mode/lux-mode.el b/lux-mode/lux-mode.el index 00ed0293f..641d96ab5 100644 --- a/lux-mode/lux-mode.el +++ b/lux-mode/lux-mode.el @@ -362,7 +362,7 @@ Called by `imenu--generic-function'." (revRE (literal (concat "\\." natural))) (specialRE (let (;; Control (control//flow (altRE "case" "exec" "let" "if" "cond" "loop" "do" "be")) - (control//pattern-matching (altRE "pattern" "open")) + (control//pattern-matching (altRE "open")) (control//logic (altRE "and" "or")) (control//contract (altRE "pre" "post")) ;; Type diff --git a/lux-php/source/program.lux b/lux-php/source/program.lux index 64cdb5d4b..8ce0efe16 100644 --- a/lux-php/source/program.lux +++ b/lux-php/source/program.lux @@ -279,14 +279,14 @@ index java/lang/String]) php/runtime/Memory (case (as Text index) - (pattern (static runtime.variant_tag_field)) + (static runtime.variant_tag_field) (|> value (array.read! 0) maybe.trusted (as java/lang/Integer) php/runtime/memory/LongMemory::valueOf) - (pattern (static runtime.variant_flag_field)) + (static runtime.variant_flag_field) (case (array.read! 1 value) {.#None} (php/runtime/memory/NullMemory::INSTANCE) @@ -294,13 +294,13 @@ {.#Some value} ..unit) - (pattern (static runtime.variant_value_field)) + (static runtime.variant_value_field) (|> value (array.read! 2) maybe.trusted (..value_wrapper lux_structure)) - (pattern (static runtime.tuple_size_field)) + (static runtime.tuple_size_field) (php/runtime/memory/LongMemory::new (array.size value)) _ diff --git a/lux-python/source/program.lux b/lux-python/source/program.lux index bafdc790a..d24824965 100644 --- a/lux-python/source/program.lux +++ b/lux-python/source/program.lux @@ -270,11 +270,11 @@ (in (loop (again [it it inputs inputs]) (`` (`` (case inputs - (pattern (list)) + (list) (as org/python/core/PyObject self) (,, (with_template [<arity>] - [(pattern (list (,, (static.literals code.local (inputs/? <arity>))))) + [(list (,, (static.literals code.local (inputs/? <arity>)))) (to_host ((as (,, (static.literal function.identity (function/? <arity>))) it) (,, (static.literals code.local (inputs/? <arity>)))))] @@ -287,8 +287,8 @@ [7] [8])) - (pattern (list.partial (,, (static.literals code.local (inputs/? 8))) - input/+)) + (list.partial (,, (static.literals code.local (inputs/? 8))) + input/+) (again ((as (,, (static.literal function.identity (function/? 8))) it) (,, (static.literals code.local (inputs/? 8)))) input/+)))))))))))) diff --git a/lux-ruby/source/program.lux b/lux-ruby/source/program.lux index 932e48f80..704296d36 100644 --- a/lux-ruby/source/program.lux +++ b/lux-ruby/source/program.lux @@ -402,35 +402,35 @@ (ffi.read! index args))) (monad.each ! (|>> (ffi.is java/lang/Object) ..read))) output (case args - (pattern (list arg/0)) + (list arg/0) (in ((as (-> Any java/lang/Object) value) arg/0)) - (pattern (list arg/0 arg/1)) + (list arg/0 arg/1) (in ((as (-> Any Any java/lang/Object) value) arg/0 arg/1)) - (pattern (list arg/0 arg/1 arg/2)) + (list arg/0 arg/1 arg/2) (in ((as (-> Any Any Any java/lang/Object) value) arg/0 arg/1 arg/2)) - (pattern (list arg/0 arg/1 arg/2 arg/3)) + (list arg/0 arg/1 arg/2 arg/3) (in ((as (-> Any Any Any Any java/lang/Object) value) arg/0 arg/1 arg/2 arg/3)) - (pattern (list arg/0 arg/1 arg/2 arg/3 arg/4)) + (list arg/0 arg/1 arg/2 arg/3 arg/4) (in ((as (-> Any Any Any Any Any java/lang/Object) value) arg/0 arg/1 arg/2 arg/3 arg/4)) - (pattern (list arg/0 arg/1 arg/2 arg/3 arg/4 arg/5)) + (list arg/0 arg/1 arg/2 arg/3 arg/4 arg/5) (in ((as (-> Any Any Any Any Any Any java/lang/Object) value) arg/0 arg/1 arg/2 arg/3 arg/4 arg/5)) - (pattern (list arg/0 arg/1 arg/2 arg/3 arg/4 arg/5 arg/6)) + (list arg/0 arg/1 arg/2 arg/3 arg/4 arg/5 arg/6) (in ((as (-> Any Any Any Any Any Any Any java/lang/Object) value) arg/0 arg/1 arg/2 arg/3 arg/4 arg/5 arg/6)) - (pattern (list arg/0 arg/1 arg/2 arg/3 arg/4 arg/5 arg/6 arg/7)) + (list arg/0 arg/1 arg/2 arg/3 arg/4 arg/5 arg/6 arg/7) (in ((as (-> Any Any Any Any Any Any Any Any java/lang/Object) value) arg/0 arg/1 arg/2 arg/3 arg/4 arg/5 arg/6 arg/7)) @@ -475,7 +475,7 @@ (case (ffi.as org/jruby/RubyString member) {.#Some member} (case (ffi.of_string (org/jruby/RubyString::asJavaString member)) - (pattern (static runtime.variant_tag_field)) + (static runtime.variant_tag_field) (|> value (array.item 0) maybe.trusted @@ -484,7 +484,7 @@ (org/jruby/RubyFixnum::new ..initial_ruby_runtime) (ffi.is org/jruby/runtime/builtin/IRubyObject)) - (pattern (static runtime.variant_flag_field)) + (static runtime.variant_flag_field) (case (array.item 1 value) {.#None} ..ruby_nil @@ -492,7 +492,7 @@ {.#Some flag} ..lux_unit) - (pattern (static runtime.variant_value_field)) + (static runtime.variant_value_field) (case (array.item 2 value) {.#Some value} (wrapped_lux_value (as_expected useful_object_class) lux_structure value) @@ -853,9 +853,9 @@ (monad.each ! (|>> (ffi.is java/lang/Object) ..read)))]) (case inputs ... It seems that org/jruby/runtime/Block::call can misbehave when getting called with a Lux state value. - (pattern (list info source location current_module modules scopes type_context expected seed scope_type_vars extensions eval host)) + (list info source location current_module modules scopes type_context expected seed scope_type_vars extensions eval host) (case partial_application - (pattern (list partial/0 partial/1)) + (list partial/0 partial/1) (in (..to_host ((as (-> Any Any Any Any) phase) partial/0 partial/1 @@ -864,21 +864,21 @@ _ (exception.except ..invaid_phase_application [partial_application inputs])) - (pattern (list)) + (list) {try.#Success (<| (ffi.is org/jruby/runtime/builtin/IRubyObject) (host_phase partial_application phase))} - (pattern (list input/0)) + (list input/0) (case partial_application - (pattern (list)) + (list) (in (<| (ffi.is org/jruby/runtime/builtin/IRubyObject) (host_phase (list input/0) phase))) - (pattern (list partial/0)) + (list partial/0) (in (<| (ffi.is org/jruby/runtime/builtin/IRubyObject) (host_phase (list partial/0 input/0) phase))) - (pattern (list partial/0 partial/1)) + (list partial/0 partial/1) (in (..to_host ((as (-> Any Any Any Any) phase) partial/0 partial/1 @@ -887,13 +887,13 @@ _ (exception.except ..invaid_phase_application [partial_application inputs])) - (pattern (list input/0 input/1)) + (list input/0 input/1) (case partial_application - (pattern (list)) + (list) (in (<| (ffi.is org/jruby/runtime/builtin/IRubyObject) (host_phase (list input/0 input/1) phase))) - (pattern (list partial/0)) + (list partial/0) (in (..to_host ((as (-> Any Any Any Any) phase) partial/0 input/0 @@ -902,9 +902,9 @@ _ (exception.except ..invaid_phase_application [partial_application inputs])) - (pattern (list input/0 input/1 input/2)) + (list input/0 input/1 input/2) (case partial_application - (pattern (list)) + (list) (in (..to_host ((as (-> Any Any Any Any) phase) input/0 input/1 diff --git a/stdlib/source/documentation/lux.lux b/stdlib/source/documentation/lux.lux index 7be9e1622..1819cb426 100644 --- a/stdlib/source/documentation/lux.lux +++ b/stdlib/source/documentation/lux.lux @@ -11,9 +11,7 @@ ["%" \\format (.only format)]] [collection ["[0]" list] - ["[0]" set]]] - [macro - ["[0]" template]]]] + ["[0]" set]]]]] [\\library ["[0]" /]] ["[0]" / @@ -25,7 +23,6 @@ ["[1][0]" extension] ["[1][0]" ffi] ["[1][0]" locale] - ["[1][0]" macro] ["[1][0]" math] ["[1][0]" meta] ["[1][0]" program] @@ -357,7 +354,7 @@ \n "It's a special macro meant to be used with 'case'.") [(case (is (List Int) (list +1 +2 +3)) - (pattern (list x y z)) + (list x y z) {#Some (all * x y z)} _ @@ -428,7 +425,7 @@ (macro (_ tokens) (case tokens (^with_template [<tag>] - [(pattern (list [_ {<tag> [module name]}])) + [(list [_ {<tag> [module name]}]) (in (list (` [(, (text$ module)) (, (text$ name))])))]) ([#Symbol]) @@ -712,13 +709,13 @@ [(def my_nat 123) (def my_text "456") (and (case [my_nat my_text] - (pattern (static [..my_nat ..my_text])) + (static [..my_nat ..my_text]) true _ false) (case [my_nat my_text] - (pattern [(static ..my_nat) (static ..my_text)]) + [(static ..my_nat) (static ..my_text)] true _ @@ -898,7 +895,6 @@ /extension.documentation /ffi.documentation /locale.documentation - /macro.documentation /math.documentation /meta.documentation /program.documentation diff --git a/stdlib/source/documentation/lux/control/concatenative.lux b/stdlib/source/documentation/lux/control/concatenative.lux index d300fd7fd..0d5a85f5a 100644 --- a/stdlib/source/documentation/lux/control/concatenative.lux +++ b/stdlib/source/documentation/lux/control/concatenative.lux @@ -5,14 +5,15 @@ [data [text ["%" \\format (.only format)]]] - [macro - ["[0]" template]] [math [number ["n" nat] ["i" int] ["r" rev] - ["f" frac]]]]] + ["f" frac]]] + [meta + [macro + ["[0]" template]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/concurrency/actor.lux b/stdlib/source/documentation/lux/control/concurrency/actor.lux index fd52ab040..16e529ca9 100644 --- a/stdlib/source/documentation/lux/control/concurrency/actor.lux +++ b/stdlib/source/documentation/lux/control/concurrency/actor.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/concurrency/async.lux b/stdlib/source/documentation/lux/control/concurrency/async.lux index 6f43db6f6..655307522 100644 --- a/stdlib/source/documentation/lux/control/concurrency/async.lux +++ b/stdlib/source/documentation/lux/control/concurrency/async.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/concurrency/atom.lux b/stdlib/source/documentation/lux/control/concurrency/atom.lux index 5c39f27d5..77dcba913 100644 --- a/stdlib/source/documentation/lux/control/concurrency/atom.lux +++ b/stdlib/source/documentation/lux/control/concurrency/atom.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/concurrency/frp.lux b/stdlib/source/documentation/lux/control/concurrency/frp.lux index ad35eba37..2f89cf7bd 100644 --- a/stdlib/source/documentation/lux/control/concurrency/frp.lux +++ b/stdlib/source/documentation/lux/control/concurrency/frp.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/concurrency/semaphore.lux b/stdlib/source/documentation/lux/control/concurrency/semaphore.lux index 91397cb83..77d05a40b 100644 --- a/stdlib/source/documentation/lux/control/concurrency/semaphore.lux +++ b/stdlib/source/documentation/lux/control/concurrency/semaphore.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/concurrency/stm.lux b/stdlib/source/documentation/lux/control/concurrency/stm.lux index d3e03d8fd..bd702f964 100644 --- a/stdlib/source/documentation/lux/control/concurrency/stm.lux +++ b/stdlib/source/documentation/lux/control/concurrency/stm.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/concurrency/thread.lux b/stdlib/source/documentation/lux/control/concurrency/thread.lux index b0206bc6c..89e899081 100644 --- a/stdlib/source/documentation/lux/control/concurrency/thread.lux +++ b/stdlib/source/documentation/lux/control/concurrency/thread.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/continuation.lux b/stdlib/source/documentation/lux/control/continuation.lux index 4cadaecc7..ee926dc02 100644 --- a/stdlib/source/documentation/lux/control/continuation.lux +++ b/stdlib/source/documentation/lux/control/continuation.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/exception.lux b/stdlib/source/documentation/lux/control/exception.lux index b74a152fe..01cecf3ea 100644 --- a/stdlib/source/documentation/lux/control/exception.lux +++ b/stdlib/source/documentation/lux/control/exception.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/function.lux b/stdlib/source/documentation/lux/control/function.lux index ed276e3f4..1447b66d1 100644 --- a/stdlib/source/documentation/lux/control/function.lux +++ b/stdlib/source/documentation/lux/control/function.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]] ["[0]" / diff --git a/stdlib/source/documentation/lux/control/function/contract.lux b/stdlib/source/documentation/lux/control/function/contract.lux index d1a24154f..90494e7f0 100644 --- a/stdlib/source/documentation/lux/control/function/contract.lux +++ b/stdlib/source/documentation/lux/control/function/contract.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/function/memo.lux b/stdlib/source/documentation/lux/control/function/memo.lux index 6b78db63e..9fd53f36e 100644 --- a/stdlib/source/documentation/lux/control/function/memo.lux +++ b/stdlib/source/documentation/lux/control/function/memo.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/function/mixin.lux b/stdlib/source/documentation/lux/control/function/mixin.lux index 7f05a4502..7f5399ee0 100644 --- a/stdlib/source/documentation/lux/control/function/mixin.lux +++ b/stdlib/source/documentation/lux/control/function/mixin.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/function/mutual.lux b/stdlib/source/documentation/lux/control/function/mutual.lux index 96208e936..e8ea1d7e2 100644 --- a/stdlib/source/documentation/lux/control/function/mutual.lux +++ b/stdlib/source/documentation/lux/control/function/mutual.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/io.lux b/stdlib/source/documentation/lux/control/io.lux index 495f57023..ceb754ed1 100644 --- a/stdlib/source/documentation/lux/control/io.lux +++ b/stdlib/source/documentation/lux/control/io.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/lazy.lux b/stdlib/source/documentation/lux/control/lazy.lux index ddf543f5d..df45b6cd5 100644 --- a/stdlib/source/documentation/lux/control/lazy.lux +++ b/stdlib/source/documentation/lux/control/lazy.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/maybe.lux b/stdlib/source/documentation/lux/control/maybe.lux index 0c0ff167e..2157e92ba 100644 --- a/stdlib/source/documentation/lux/control/maybe.lux +++ b/stdlib/source/documentation/lux/control/maybe.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/parser.lux b/stdlib/source/documentation/lux/control/parser.lux index 426854632..ac253916e 100644 --- a/stdlib/source/documentation/lux/control/parser.lux +++ b/stdlib/source/documentation/lux/control/parser.lux @@ -4,19 +4,14 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]] ["[0]" / - ["[1][0]" analysis] - ["[1][0]" binary] ["[1][0]" cli] ["[1][0]" code] ["[1][0]" environment] ["[1][0]" json] - ["[1][0]" synthesis] ["[1][0]" text] ["[1][0]" tree] ["[1][0]" type] @@ -138,13 +133,10 @@ ($.documentation /.codec "Decode the output of a parser using a codec." [(codec codec parser)])] - [/analysis.documentation - /binary.documentation - /cli.documentation + [/cli.documentation /code.documentation /environment.documentation /json.documentation - /synthesis.documentation /text.documentation /tree.documentation /type.documentation diff --git a/stdlib/source/documentation/lux/control/parser/analysis.lux b/stdlib/source/documentation/lux/control/parser/analysis.lux deleted file mode 100644 index 14ff24f04..000000000 --- a/stdlib/source/documentation/lux/control/parser/analysis.lux +++ /dev/null @@ -1,71 +0,0 @@ -(.require - [library - [lux (.except nat int rev local) - ["$" documentation (.only documentation:)] - [data - [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] - [\\library - ["[0]" /]]) - -(documentation: (/.Parser it) - "A parser for Lux code analysis nodes.") - -(documentation: /.result - "Executes a parser and makes sure no inputs go unconsumed." - [(result parser input)]) - -(documentation: /.any - "Matches any value, without discrimination.") - -(documentation: /.end - "Ensures there are no more inputs.") - -(documentation: /.end? - "Checks whether there are no more inputs.") - -(with_template [<query> <assertion>] - [(`` (these (`` (documentation: <query> - (format "Queries for a " (,, (template.text [<query>])) " value."))) - (`` (documentation: <assertion> - (format "Assert a specific " (,, (template.text [<query>])) " value.")))))] - - [/.bit /.this_bit] - [/.nat /.this_nat] - [/.int /.this_int] - [/.rev /.this_rev] - [/.frac /.this_frac] - [/.text /.this_text] - [/.local /.this_local] - [/.foreign /.this_foreign] - [/.constant /.this_constant] - ) - -(documentation: /.tuple - "Parses only within the context of a tuple's contents." - [(tuple parser)]) - -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [..Parser - ..result - ..any - ..end - ..end? - ..bit ..this_bit - ..nat ..this_nat - ..int ..this_int - ..rev ..this_rev - ..frac ..this_frac - ..text ..this_text - ..local ..this_local - ..foreign ..this_foreign - ..constant ..this_constant - ..tuple - ($.default /.cannot_parse) - ($.default /.unconsumed_input)] - [])) diff --git a/stdlib/source/documentation/lux/control/parser/binary.lux b/stdlib/source/documentation/lux/control/parser/binary.lux deleted file mode 100644 index 00156613d..000000000 --- a/stdlib/source/documentation/lux/control/parser/binary.lux +++ /dev/null @@ -1,139 +0,0 @@ -(.require - [library - [lux (.except list) - ["$" documentation (.only documentation:)] - [data - [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] - [\\library - ["[0]" /]]) - -(documentation: /.Offset - "An offset for reading within binary data.") - -(documentation: (/.Parser it) - "A parser for raw binary data.") - -(documentation: /.result - "Runs a parser and checks that all the binary data was read by it." - [(result parser input)]) - -(documentation: /.end? - "Checks whether there is no more data to read.") - -(documentation: /.offset - "The current offset (i.e. how much data has been read).") - -(documentation: /.remaining - "How much of the data remains to be read.") - -(documentation: /.Size - "The size of a chunk of data within a binary array.") - -(documentation: /.rec - "Tie the knot for a recursive parser.") - -(documentation: /.any - "Does no parsing, and just returns a dummy value.") - -(documentation: /.segment - "Parses a chunk of data of a given size." - [(segment size)]) - -(with_template [<size> <name>] - [(documentation: <name> - (format "Parses a block of data prefixed with a size that is " (%.nat <size>) " bytes long."))] - - [08 /.binary_8] - [16 /.binary_16] - [32 /.binary_32] - [64 /.binary_64] - ) - -(with_template [<size> <name>] - [(documentation: <name> - (format "Parses a block of (UTF-8 encoded) text prefixed with a size that is " (%.nat <size>) " bytes long."))] - - [08 /.utf8_8] - [16 /.utf8_16] - [32 /.utf8_32] - [64 /.utf8_64] - ) - -(with_template [<size> <name>] - [(documentation: <name> - (format "Parses a sequence of values prefixed with a size that is " (%.nat <size>) " bytes long."))] - - [08 /.sequence_8] - [16 /.sequence_16] - [32 /.sequence_32] - [64 /.sequence_64] - ) - -(documentation: /.list - "Parses an arbitrarily long list of values." - [(list value)]) - -(documentation: /.set - "" - [(set hash value)]) - -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [..Offset - ..Parser - ..result - ..end? - ..offset - ..remaining - ..Size - ..rec - ..any - ..segment - - ..binary_8 - ..binary_16 - ..binary_32 - ..binary_64 - - ..utf8_8 - ..utf8_16 - ..utf8_32 - ..utf8_64 - - ..sequence_8 - ..sequence_16 - ..sequence_32 - ..sequence_64 - - ..list - ..set - ($.default /.binary_was_not_fully_read) - ($.default /.size_8) - ($.default /.size_16) - ($.default /.size_32) - ($.default /.size_64) - ($.default /.bits_8) - ($.default /.bits_16) - ($.default /.bits_32) - ($.default /.bits_64) - ($.default /.nat) - ($.default /.int) - ($.default /.rev) - ($.default /.frac) - ($.default /.invalid_tag) - ($.default /.or) - ($.default /.not_a_bit) - ($.default /.bit) - ($.default /.text) - ($.default /.maybe) - ($.default /.set_elements_are_not_unique) - ($.default /.symbol) - ($.default /.type) - ($.default /.location) - ($.default /.code)] - [])) diff --git a/stdlib/source/documentation/lux/control/parser/cli.lux b/stdlib/source/documentation/lux/control/parser/cli.lux index 27104cf2e..f76bb6e1a 100644 --- a/stdlib/source/documentation/lux/control/parser/cli.lux +++ b/stdlib/source/documentation/lux/control/parser/cli.lux @@ -4,9 +4,7 @@ ["$" documentation (.only documentation:)] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/parser/code.lux b/stdlib/source/documentation/lux/control/parser/code.lux index 0840fd16d..9347075dd 100644 --- a/stdlib/source/documentation/lux/control/parser/code.lux +++ b/stdlib/source/documentation/lux/control/parser/code.lux @@ -5,8 +5,9 @@ [data [text (.only \n) ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + [meta + [macro + ["[0]" template]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/parser/environment.lux b/stdlib/source/documentation/lux/control/parser/environment.lux index 4888b4367..345d4aaa3 100644 --- a/stdlib/source/documentation/lux/control/parser/environment.lux +++ b/stdlib/source/documentation/lux/control/parser/environment.lux @@ -4,9 +4,7 @@ ["$" documentation (.only documentation:)] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/parser/json.lux b/stdlib/source/documentation/lux/control/parser/json.lux index ed4068800..89ab7f9f1 100644 --- a/stdlib/source/documentation/lux/control/parser/json.lux +++ b/stdlib/source/documentation/lux/control/parser/json.lux @@ -5,8 +5,9 @@ [data [text (.only \n) ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + [meta + [macro + ["[0]" template]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/parser/synthesis.lux b/stdlib/source/documentation/lux/control/parser/synthesis.lux deleted file mode 100644 index b55bb6061..000000000 --- a/stdlib/source/documentation/lux/control/parser/synthesis.lux +++ /dev/null @@ -1,83 +0,0 @@ -(.require - [library - [lux (.except i64 local function loop) - ["$" documentation (.only documentation:)] - [data - [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] - [\\library - ["[0]" /]]) - -(documentation: (/.Parser it) - "A parser for the Lux compiler's synthesis nodes using during optimization.") - -(documentation: /.result - (format "Executes the parser against the inputs." - \n "Ensures all inputs are consumed by the parser.") - [(result parser input)]) - -(documentation: /.any - "Yields a synthesis node without subjecting it to any analysis.") - -(documentation: /.end - "Ensures there are no more inputs.") - -(documentation: /.end? - "Checks whether there are no more inputs.") - -(with_template [<query> <assertion>] - [(`` (documentation: <query> - (format "Queries for a " (,, (template.text [<query>])) " synthesis node."))) - (`` (documentation: <assertion> - (format "Checks for a specific " (,, (template.text [<query>])) " synthesis node.")))] - - [/.bit /.this_bit] - [/.i64 /.this_i64] - [/.f64 /.this_f64] - [/.text /.this_text] - [/.local /.this_local] - [/.foreign /.this_foreign] - [/.constant /.this_constant] - ) - -(documentation: /.tuple - "Parses the contents of a tuple." - [(tuple parser)]) - -(documentation: /.function - "Parses the body of a function with the 'expected' arity." - [(function expected parser)]) - -(documentation: /.loop - "Parses the initial values and the body of a loop." - [(loop init_parsers iteration_parser)]) - -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [..Parser - ..result - ..any - ..end - ..end? - - ..bit ..this_bit - ..i64 ..this_i64 - ..f64 ..this_f64 - ..text ..this_text - ..local ..this_local - ..foreign ..this_foreign - ..constant ..this_constant - - ..tuple - ..function - ..loop - ($.default /.cannot_parse) - ($.default /.unconsumed_input) - ($.default /.expected_empty_input) - ($.default /.wrong_arity) - ($.default /.empty_input)] - [])) diff --git a/stdlib/source/documentation/lux/control/parser/text.lux b/stdlib/source/documentation/lux/control/parser/text.lux index 4b35bc626..aa0641d5b 100644 --- a/stdlib/source/documentation/lux/control/parser/text.lux +++ b/stdlib/source/documentation/lux/control/parser/text.lux @@ -5,8 +5,9 @@ [data [text (.only \n) ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + [meta + [macro + ["[0]" template]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/parser/tree.lux b/stdlib/source/documentation/lux/control/parser/tree.lux index e6e13b2b5..e9c4cd289 100644 --- a/stdlib/source/documentation/lux/control/parser/tree.lux +++ b/stdlib/source/documentation/lux/control/parser/tree.lux @@ -4,9 +4,7 @@ ["$" documentation (.only documentation:)] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/parser/type.lux b/stdlib/source/documentation/lux/control/parser/type.lux index 171db7456..2ecedfe39 100644 --- a/stdlib/source/documentation/lux/control/parser/type.lux +++ b/stdlib/source/documentation/lux/control/parser/type.lux @@ -5,8 +5,9 @@ [data [text (.only \n) ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + [meta + [macro + ["[0]" template]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/parser/xml.lux b/stdlib/source/documentation/lux/control/parser/xml.lux index 620b97dc6..c5ca5af74 100644 --- a/stdlib/source/documentation/lux/control/parser/xml.lux +++ b/stdlib/source/documentation/lux/control/parser/xml.lux @@ -4,9 +4,7 @@ ["$" documentation (.only documentation:)] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/pipe.lux b/stdlib/source/documentation/lux/control/pipe.lux index 614e8f5c4..0f2fd01ce 100644 --- a/stdlib/source/documentation/lux/control/pipe.lux +++ b/stdlib/source/documentation/lux/control/pipe.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/reader.lux b/stdlib/source/documentation/lux/control/reader.lux index c411c6f32..eaac93dc5 100644 --- a/stdlib/source/documentation/lux/control/reader.lux +++ b/stdlib/source/documentation/lux/control/reader.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/region.lux b/stdlib/source/documentation/lux/control/region.lux index c0da27237..5432ab07f 100644 --- a/stdlib/source/documentation/lux/control/region.lux +++ b/stdlib/source/documentation/lux/control/region.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/remember.lux b/stdlib/source/documentation/lux/control/remember.lux index 3d40127a4..5c6b1bc2a 100644 --- a/stdlib/source/documentation/lux/control/remember.lux +++ b/stdlib/source/documentation/lux/control/remember.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/security/capability.lux b/stdlib/source/documentation/lux/control/security/capability.lux index 920f9c439..de8b33889 100644 --- a/stdlib/source/documentation/lux/control/security/capability.lux +++ b/stdlib/source/documentation/lux/control/security/capability.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/security/policy.lux b/stdlib/source/documentation/lux/control/security/policy.lux index d693c8c50..07d0ebc8d 100644 --- a/stdlib/source/documentation/lux/control/security/policy.lux +++ b/stdlib/source/documentation/lux/control/security/policy.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/state.lux b/stdlib/source/documentation/lux/control/state.lux index fa5a0ee5f..9f975818e 100644 --- a/stdlib/source/documentation/lux/control/state.lux +++ b/stdlib/source/documentation/lux/control/state.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/thread.lux b/stdlib/source/documentation/lux/control/thread.lux index 587c165a8..85945fb00 100644 --- a/stdlib/source/documentation/lux/control/thread.lux +++ b/stdlib/source/documentation/lux/control/thread.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/try.lux b/stdlib/source/documentation/lux/control/try.lux index 0283736a3..9ff894fa0 100644 --- a/stdlib/source/documentation/lux/control/try.lux +++ b/stdlib/source/documentation/lux/control/try.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/control/writer.lux b/stdlib/source/documentation/lux/control/writer.lux index b824174ec..58650b8f0 100644 --- a/stdlib/source/documentation/lux/control/writer.lux +++ b/stdlib/source/documentation/lux/control/writer.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/data/binary.lux b/stdlib/source/documentation/lux/data/binary.lux index 61395234c..09f2b8b87 100644 --- a/stdlib/source/documentation/lux/data/binary.lux +++ b/stdlib/source/documentation/lux/data/binary.lux @@ -4,13 +4,112 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] ["[0]" \\format] + ["[0]" \\parser] [\\library ["[0]" /]]) +(`` (.def \\parser + (.List $.Module) + ($.module \\parser._ + "" + [($.default \\parser.binary_was_not_fully_read) + ($.default \\parser.size_8) + ($.default \\parser.size_16) + ($.default \\parser.size_32) + ($.default \\parser.size_64) + ($.default \\parser.bits_8) + ($.default \\parser.bits_16) + ($.default \\parser.bits_32) + ($.default \\parser.bits_64) + ($.default \\parser.nat) + ($.default \\parser.int) + ($.default \\parser.rev) + ($.default \\parser.frac) + ($.default \\parser.invalid_tag) + ($.default \\parser.or) + ($.default \\parser.not_a_bit) + ($.default \\parser.bit) + ($.default \\parser.text) + ($.default \\parser.maybe) + ($.default \\parser.set_elements_are_not_unique) + ($.default \\parser.symbol) + ($.default \\parser.type) + ($.default \\parser.location) + ($.default \\parser.code) + + ($.documentation \\parser.Offset + "An offset for reading within binary data.") + + ($.documentation (\\parser.Parser it) + "A parser for raw binary data.") + + ($.documentation \\parser.result + "Runs a parser and checks that all the binary data was read by it." + [(result parser input)]) + + ($.documentation \\parser.end? + "Checks whether there is no more data to read.") + + ($.documentation \\parser.offset + "The current offset (i.e. how much data has been read).") + + ($.documentation \\parser.remaining + "How much of the data remains to be read.") + + ($.documentation \\parser.Size + "The size of a chunk of data within a binary array.") + + ($.documentation \\parser.rec + "Tie the knot for a recursive parser.") + + ($.documentation \\parser.any + "Does no parsing, and just returns a dummy value.") + + ($.documentation \\parser.segment + "Parses a chunk of data of a given size." + [(segment size)]) + + (,, (with_template [<size> <name>] + [($.documentation <name> + (format "Parses a block of data prefixed with a size that is " (%.nat <size>) " bytes long."))] + + [08 \\parser.binary_8] + [16 \\parser.binary_16] + [32 \\parser.binary_32] + [64 \\parser.binary_64] + )) + + (,, (with_template [<size> <name>] + [($.documentation <name> + (format "Parses a block of (UTF-8 encoded) text prefixed with a size that is " (%.nat <size>) " bytes long."))] + + [08 \\parser.utf8_8] + [16 \\parser.utf8_16] + [32 \\parser.utf8_32] + [64 \\parser.utf8_64] + )) + + (,, (with_template [<size> <name>] + [($.documentation <name> + (format "Parses a sequence of values prefixed with a size that is " (%.nat <size>) " bytes long."))] + + [08 \\parser.sequence_8] + [16 \\parser.sequence_16] + [32 \\parser.sequence_32] + [64 \\parser.sequence_64] + )) + + ($.documentation \\parser.list + "Parses an arbitrarily long list of values." + [(list value)]) + + ($.documentation \\parser.set + "" + [(set hash value)])] + []))) + (.def \\format (.List $.Module) ($.module \\format._ @@ -147,4 +246,5 @@ ($.documentation /.after "Yields a binary BLOB with at most the specified number of bytes removed." [(after bytes binary)])] - [..\\format])) + [..\\format + ..\\parser])) diff --git a/stdlib/source/documentation/lux/data/bit.lux b/stdlib/source/documentation/lux/data/bit.lux index 43d64ae46..25b1262d2 100644 --- a/stdlib/source/documentation/lux/data/bit.lux +++ b/stdlib/source/documentation/lux/data/bit.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/data/collection/array.lux b/stdlib/source/documentation/lux/data/collection/array.lux index 29416d649..c4ce92a7a 100644 --- a/stdlib/source/documentation/lux/data/collection/array.lux +++ b/stdlib/source/documentation/lux/data/collection/array.lux @@ -5,8 +5,6 @@ [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] - [macro - ["[0]" template]] [meta ["[0]" code]]]] [\\library diff --git a/stdlib/source/documentation/lux/data/collection/dictionary/ordered.lux b/stdlib/source/documentation/lux/data/collection/dictionary/ordered.lux index 74381c580..64f18f260 100644 --- a/stdlib/source/documentation/lux/data/collection/dictionary/ordered.lux +++ b/stdlib/source/documentation/lux/data/collection/dictionary/ordered.lux @@ -5,8 +5,9 @@ [data [text ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + [meta + [macro + ["[0]" template]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/data/collection/set.lux b/stdlib/source/documentation/lux/data/collection/set.lux index b3a16c70c..37024e63b 100644 --- a/stdlib/source/documentation/lux/data/collection/set.lux +++ b/stdlib/source/documentation/lux/data/collection/set.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]] ["[0]" / diff --git a/stdlib/source/documentation/lux/data/collection/set/multi.lux b/stdlib/source/documentation/lux/data/collection/set/multi.lux index 8c494a583..d6d0947dc 100644 --- a/stdlib/source/documentation/lux/data/collection/set/multi.lux +++ b/stdlib/source/documentation/lux/data/collection/set/multi.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/data/collection/set/ordered.lux b/stdlib/source/documentation/lux/data/collection/set/ordered.lux index ac34d2f5d..0b8dba28e 100644 --- a/stdlib/source/documentation/lux/data/collection/set/ordered.lux +++ b/stdlib/source/documentation/lux/data/collection/set/ordered.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/data/collection/stack.lux b/stdlib/source/documentation/lux/data/collection/stack.lux index e05e774c2..defa3f836 100644 --- a/stdlib/source/documentation/lux/data/collection/stack.lux +++ b/stdlib/source/documentation/lux/data/collection/stack.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/data/collection/tree.lux b/stdlib/source/documentation/lux/data/collection/tree.lux index 91324bbcf..f0d165a5b 100644 --- a/stdlib/source/documentation/lux/data/collection/tree.lux +++ b/stdlib/source/documentation/lux/data/collection/tree.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]] ["[0]" / diff --git a/stdlib/source/documentation/lux/data/collection/tree/finger.lux b/stdlib/source/documentation/lux/data/collection/tree/finger.lux index 7386f313e..fe0488db4 100644 --- a/stdlib/source/documentation/lux/data/collection/tree/finger.lux +++ b/stdlib/source/documentation/lux/data/collection/tree/finger.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/data/collection/tree/zipper.lux b/stdlib/source/documentation/lux/data/collection/tree/zipper.lux index 76fb1602c..317fd95ac 100644 --- a/stdlib/source/documentation/lux/data/collection/tree/zipper.lux +++ b/stdlib/source/documentation/lux/data/collection/tree/zipper.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/data/color.lux b/stdlib/source/documentation/lux/data/color.lux index c76cf4c45..20ef0c572 100644 --- a/stdlib/source/documentation/lux/data/color.lux +++ b/stdlib/source/documentation/lux/data/color.lux @@ -5,12 +5,12 @@ [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] - [macro - [syntax (.only syntax)] - ["[0]" template]] [meta ["[0]" code (.only) - ["<[1]>" \\parser]]]]] + ["<[1]>" \\parser]] + [macro + [syntax (.only syntax)] + ["[0]" template]]]]] [\\library ["[0]" /]] ["[0]" / diff --git a/stdlib/source/documentation/lux/data/format/json.lux b/stdlib/source/documentation/lux/data/format/json.lux index ccf18365e..25026ef6f 100644 --- a/stdlib/source/documentation/lux/data/format/json.lux +++ b/stdlib/source/documentation/lux/data/format/json.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/data/format/tar.lux b/stdlib/source/documentation/lux/data/format/tar.lux index 353d83876..f31c3dc68 100644 --- a/stdlib/source/documentation/lux/data/format/tar.lux +++ b/stdlib/source/documentation/lux/data/format/tar.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/data/format/xml.lux b/stdlib/source/documentation/lux/data/format/xml.lux index 002f24eff..d49299af6 100644 --- a/stdlib/source/documentation/lux/data/format/xml.lux +++ b/stdlib/source/documentation/lux/data/format/xml.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/data/identity.lux b/stdlib/source/documentation/lux/data/identity.lux index efb6520f5..e1d42389e 100644 --- a/stdlib/source/documentation/lux/data/identity.lux +++ b/stdlib/source/documentation/lux/data/identity.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/data/product.lux b/stdlib/source/documentation/lux/data/product.lux index 6a2921eab..7275ad4ee 100644 --- a/stdlib/source/documentation/lux/data/product.lux +++ b/stdlib/source/documentation/lux/data/product.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/data/sum.lux b/stdlib/source/documentation/lux/data/sum.lux index cf4df8be5..2bd740509 100644 --- a/stdlib/source/documentation/lux/data/sum.lux +++ b/stdlib/source/documentation/lux/data/sum.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/data/text/buffer.lux b/stdlib/source/documentation/lux/data/text/buffer.lux index a510bebab..9f64dd787 100644 --- a/stdlib/source/documentation/lux/data/text/buffer.lux +++ b/stdlib/source/documentation/lux/data/text/buffer.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/data/text/encoding.lux b/stdlib/source/documentation/lux/data/text/encoding.lux index 42b3ff87e..471b5970e 100644 --- a/stdlib/source/documentation/lux/data/text/encoding.lux +++ b/stdlib/source/documentation/lux/data/text/encoding.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]] ["[0]" / diff --git a/stdlib/source/documentation/lux/data/text/encoding/utf8.lux b/stdlib/source/documentation/lux/data/text/encoding/utf8.lux index 0ad760263..eaa712caf 100644 --- a/stdlib/source/documentation/lux/data/text/encoding/utf8.lux +++ b/stdlib/source/documentation/lux/data/text/encoding/utf8.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/data/text/escape.lux b/stdlib/source/documentation/lux/data/text/escape.lux index 3a62c1349..aa0ec4015 100644 --- a/stdlib/source/documentation/lux/data/text/escape.lux +++ b/stdlib/source/documentation/lux/data/text/escape.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/data/text/regex.lux b/stdlib/source/documentation/lux/data/text/regex.lux index 540acb1fe..fef504012 100644 --- a/stdlib/source/documentation/lux/data/text/regex.lux +++ b/stdlib/source/documentation/lux/data/text/regex.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/data/text/unicode/block.lux b/stdlib/source/documentation/lux/data/text/unicode/block.lux index 2021ce0d1..d23c6815d 100644 --- a/stdlib/source/documentation/lux/data/text/unicode/block.lux +++ b/stdlib/source/documentation/lux/data/text/unicode/block.lux @@ -5,8 +5,6 @@ [data ["[0]" text (.only) ["%" \\format (.only format)]]] - [macro - ["[0]" template]] [math [number ["[0]" nat (.use "hex#[0]" hex)]]]]] diff --git a/stdlib/source/documentation/lux/data/text/unicode/set.lux b/stdlib/source/documentation/lux/data/text/unicode/set.lux index 80f96be50..1e637cf5e 100644 --- a/stdlib/source/documentation/lux/data/text/unicode/set.lux +++ b/stdlib/source/documentation/lux/data/text/unicode/set.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/debug.lux b/stdlib/source/documentation/lux/debug.lux index b560b35fe..33cb48573 100644 --- a/stdlib/source/documentation/lux/debug.lux +++ b/stdlib/source/documentation/lux/debug.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/documentation.lux b/stdlib/source/documentation/lux/documentation.lux index bdebfab7e..a7ab8bd82 100644 --- a/stdlib/source/documentation/lux/documentation.lux +++ b/stdlib/source/documentation/lux/documentation.lux @@ -3,9 +3,7 @@ [lux (.except) [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/extension.lux b/stdlib/source/documentation/lux/extension.lux index 35b5fbd72..1ca48bc21 100644 --- a/stdlib/source/documentation/lux/extension.lux +++ b/stdlib/source/documentation/lux/extension.lux @@ -8,11 +8,11 @@ ["%" \\format (.only format)]] [collection ["[0]" sequence]]] - [macro - ["[0]" template]] [meta ["[0]" code - ["<[1]>" \\parser]]] + ["<[1]>" \\parser]] + [macro + ["[0]" template]]] [tool [compiler ["[0]" phase] diff --git a/stdlib/source/documentation/lux/ffi.js.lux b/stdlib/source/documentation/lux/ffi.js.lux index 71bf8062d..07c5e5759 100644 --- a/stdlib/source/documentation/lux/ffi.js.lux +++ b/stdlib/source/documentation/lux/ffi.js.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/ffi.jvm.lux b/stdlib/source/documentation/lux/ffi.jvm.lux index 760a625f0..bc804020f 100644 --- a/stdlib/source/documentation/lux/ffi.jvm.lux +++ b/stdlib/source/documentation/lux/ffi.jvm.lux @@ -5,8 +5,9 @@ [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + [meta + [macro + ["[0]" template]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/ffi.lua.lux b/stdlib/source/documentation/lux/ffi.lua.lux index 4b5e478de..db5e78eb1 100644 --- a/stdlib/source/documentation/lux/ffi.lua.lux +++ b/stdlib/source/documentation/lux/ffi.lua.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/ffi.old.lux b/stdlib/source/documentation/lux/ffi.old.lux index ce7eb423e..5bc8cd6cc 100644 --- a/stdlib/source/documentation/lux/ffi.old.lux +++ b/stdlib/source/documentation/lux/ffi.old.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/ffi.py.lux b/stdlib/source/documentation/lux/ffi.py.lux index 0d5a5771f..734e6c0ab 100644 --- a/stdlib/source/documentation/lux/ffi.py.lux +++ b/stdlib/source/documentation/lux/ffi.py.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/ffi.rb.lux b/stdlib/source/documentation/lux/ffi.rb.lux index 3ea02446e..3eec0ed72 100644 --- a/stdlib/source/documentation/lux/ffi.rb.lux +++ b/stdlib/source/documentation/lux/ffi.rb.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/math/infix.lux b/stdlib/source/documentation/lux/math/infix.lux index 2e7b35559..f9b284e44 100644 --- a/stdlib/source/documentation/lux/math/infix.lux +++ b/stdlib/source/documentation/lux/math/infix.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/math/logic/continuous.lux b/stdlib/source/documentation/lux/math/logic/continuous.lux index b97474b28..d526d2414 100644 --- a/stdlib/source/documentation/lux/math/logic/continuous.lux +++ b/stdlib/source/documentation/lux/math/logic/continuous.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/math/logic/fuzzy.lux b/stdlib/source/documentation/lux/math/logic/fuzzy.lux index 47b5c235d..9e3cb5df1 100644 --- a/stdlib/source/documentation/lux/math/logic/fuzzy.lux +++ b/stdlib/source/documentation/lux/math/logic/fuzzy.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/math/modular.lux b/stdlib/source/documentation/lux/math/modular.lux index fe39e1b40..76c93b01b 100644 --- a/stdlib/source/documentation/lux/math/modular.lux +++ b/stdlib/source/documentation/lux/math/modular.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/math/modulus.lux b/stdlib/source/documentation/lux/math/modulus.lux index 4f0d17564..bc0fb952d 100644 --- a/stdlib/source/documentation/lux/math/modulus.lux +++ b/stdlib/source/documentation/lux/math/modulus.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/math/number.lux b/stdlib/source/documentation/lux/math/number.lux index 2420d347a..7fd74e5a0 100644 --- a/stdlib/source/documentation/lux/math/number.lux +++ b/stdlib/source/documentation/lux/math/number.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]] ["[0]" / diff --git a/stdlib/source/documentation/lux/math/number/complex.lux b/stdlib/source/documentation/lux/math/number/complex.lux index cf5f3b33f..c615842f2 100644 --- a/stdlib/source/documentation/lux/math/number/complex.lux +++ b/stdlib/source/documentation/lux/math/number/complex.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/math/number/frac.lux b/stdlib/source/documentation/lux/math/number/frac.lux index 8ae35ef2e..0b27d0b0f 100644 --- a/stdlib/source/documentation/lux/math/number/frac.lux +++ b/stdlib/source/documentation/lux/math/number/frac.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/math/number/i16.lux b/stdlib/source/documentation/lux/math/number/i16.lux index 20c6ac061..8f0caf9b7 100644 --- a/stdlib/source/documentation/lux/math/number/i16.lux +++ b/stdlib/source/documentation/lux/math/number/i16.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/math/number/i32.lux b/stdlib/source/documentation/lux/math/number/i32.lux index f092d9aa9..726301ba6 100644 --- a/stdlib/source/documentation/lux/math/number/i32.lux +++ b/stdlib/source/documentation/lux/math/number/i32.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/math/number/i64.lux b/stdlib/source/documentation/lux/math/number/i64.lux index 0a6cef889..1481ef25b 100644 --- a/stdlib/source/documentation/lux/math/number/i64.lux +++ b/stdlib/source/documentation/lux/math/number/i64.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/math/number/i8.lux b/stdlib/source/documentation/lux/math/number/i8.lux index f7893d393..5e8e3c870 100644 --- a/stdlib/source/documentation/lux/math/number/i8.lux +++ b/stdlib/source/documentation/lux/math/number/i8.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/math/number/int.lux b/stdlib/source/documentation/lux/math/number/int.lux index 70cec4be4..e1494b9ba 100644 --- a/stdlib/source/documentation/lux/math/number/int.lux +++ b/stdlib/source/documentation/lux/math/number/int.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/math/number/nat.lux b/stdlib/source/documentation/lux/math/number/nat.lux index 62c72b8b8..ac7c6aa10 100644 --- a/stdlib/source/documentation/lux/math/number/nat.lux +++ b/stdlib/source/documentation/lux/math/number/nat.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/math/number/ratio.lux b/stdlib/source/documentation/lux/math/number/ratio.lux index 3bd835a57..7cc00373b 100644 --- a/stdlib/source/documentation/lux/math/number/ratio.lux +++ b/stdlib/source/documentation/lux/math/number/ratio.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/math/number/rev.lux b/stdlib/source/documentation/lux/math/number/rev.lux index d93c8e3c5..1d4c746d6 100644 --- a/stdlib/source/documentation/lux/math/number/rev.lux +++ b/stdlib/source/documentation/lux/math/number/rev.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/math/random.lux b/stdlib/source/documentation/lux/math/random.lux index 0e0d88ec9..5f1a41f7d 100644 --- a/stdlib/source/documentation/lux/math/random.lux +++ b/stdlib/source/documentation/lux/math/random.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/meta.lux b/stdlib/source/documentation/lux/meta.lux index 72315f3d2..7a0ab78d6 100644 --- a/stdlib/source/documentation/lux/meta.lux +++ b/stdlib/source/documentation/lux/meta.lux @@ -4,16 +4,15 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]] ["[0]" / ["[1][0]" code] ["[1][0]" location] ["[1][0]" symbol] - ["[1][0]" type]]) + ["[1][0]" type] + ["[1][0]" macro]]) (.def .public documentation (.List $.Module) @@ -167,4 +166,5 @@ [/code.documentation /location.documentation /symbol.documentation - /type.documentation])) + /type.documentation + /macro.documentation])) diff --git a/stdlib/source/documentation/lux/meta/location.lux b/stdlib/source/documentation/lux/meta/location.lux index 0d3bcaf84..44e7af75b 100644 --- a/stdlib/source/documentation/lux/meta/location.lux +++ b/stdlib/source/documentation/lux/meta/location.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/meta/symbol.lux b/stdlib/source/documentation/lux/meta/symbol.lux index 8189cdf71..2011a508c 100644 --- a/stdlib/source/documentation/lux/meta/symbol.lux +++ b/stdlib/source/documentation/lux/meta/symbol.lux @@ -4,9 +4,7 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/meta/type.lux b/stdlib/source/documentation/lux/meta/type.lux index e4b93f034..541e3978c 100644 --- a/stdlib/source/documentation/lux/meta/type.lux +++ b/stdlib/source/documentation/lux/meta/type.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format]]] - [macro - ["[0]" template]]]] + ["%" \\format]]]]] [\\library ["[0]" /]] ["[0]" / diff --git a/stdlib/source/documentation/lux/meta/type/check.lux b/stdlib/source/documentation/lux/meta/type/check.lux index e5a7130cf..f9d19f78b 100644 --- a/stdlib/source/documentation/lux/meta/type/check.lux +++ b/stdlib/source/documentation/lux/meta/type/check.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/meta/type/dynamic.lux b/stdlib/source/documentation/lux/meta/type/dynamic.lux index 861d7143f..8340126cd 100644 --- a/stdlib/source/documentation/lux/meta/type/dynamic.lux +++ b/stdlib/source/documentation/lux/meta/type/dynamic.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/meta/type/implicit.lux b/stdlib/source/documentation/lux/meta/type/implicit.lux index 9490d4aee..d3ee56899 100644 --- a/stdlib/source/documentation/lux/meta/type/implicit.lux +++ b/stdlib/source/documentation/lux/meta/type/implicit.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/meta/type/poly.lux b/stdlib/source/documentation/lux/meta/type/poly.lux index 979ae2899..e5317320a 100644 --- a/stdlib/source/documentation/lux/meta/type/poly.lux +++ b/stdlib/source/documentation/lux/meta/type/poly.lux @@ -8,9 +8,7 @@ ["$[0]" codec]]] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/meta/type/primitive.lux b/stdlib/source/documentation/lux/meta/type/primitive.lux index d531ffb98..9e1cf4f4f 100644 --- a/stdlib/source/documentation/lux/meta/type/primitive.lux +++ b/stdlib/source/documentation/lux/meta/type/primitive.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/meta/type/quotient.lux b/stdlib/source/documentation/lux/meta/type/quotient.lux index 1451674e6..c68949188 100644 --- a/stdlib/source/documentation/lux/meta/type/quotient.lux +++ b/stdlib/source/documentation/lux/meta/type/quotient.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/meta/type/refinement.lux b/stdlib/source/documentation/lux/meta/type/refinement.lux index 304b4b266..cc9019d71 100644 --- a/stdlib/source/documentation/lux/meta/type/refinement.lux +++ b/stdlib/source/documentation/lux/meta/type/refinement.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/meta/type/resource.lux b/stdlib/source/documentation/lux/meta/type/resource.lux index b4dcfdd6f..da7f24173 100644 --- a/stdlib/source/documentation/lux/meta/type/resource.lux +++ b/stdlib/source/documentation/lux/meta/type/resource.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/meta/type/unit.lux b/stdlib/source/documentation/lux/meta/type/unit.lux index 1f2f6918e..79e2ce918 100644 --- a/stdlib/source/documentation/lux/meta/type/unit.lux +++ b/stdlib/source/documentation/lux/meta/type/unit.lux @@ -5,11 +5,12 @@ [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] - [macro - ["[0]" template]] [math [number - ["[0]" ratio]]]]] + ["[0]" ratio]]] + [meta + [macro + ["[0]" template]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/meta/type/variance.lux b/stdlib/source/documentation/lux/meta/type/variance.lux index e3b377fea..5d0845693 100644 --- a/stdlib/source/documentation/lux/meta/type/variance.lux +++ b/stdlib/source/documentation/lux/meta/type/variance.lux @@ -5,8 +5,9 @@ [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + [meta + [macro + ["[0]" template]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/program.lux b/stdlib/source/documentation/lux/program.lux index fc830b881..87e9b607a 100644 --- a/stdlib/source/documentation/lux/program.lux +++ b/stdlib/source/documentation/lux/program.lux @@ -6,9 +6,7 @@ ["[0]" io]] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/test.lux b/stdlib/source/documentation/lux/test.lux index f15eacf9d..4c76f2278 100644 --- a/stdlib/source/documentation/lux/test.lux +++ b/stdlib/source/documentation/lux/test.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/time.lux b/stdlib/source/documentation/lux/time.lux index 59f609b05..f327e942a 100644 --- a/stdlib/source/documentation/lux/time.lux +++ b/stdlib/source/documentation/lux/time.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]] ["[0]" / diff --git a/stdlib/source/documentation/lux/time/date.lux b/stdlib/source/documentation/lux/time/date.lux index 15bfdafbb..17fd0143b 100644 --- a/stdlib/source/documentation/lux/time/date.lux +++ b/stdlib/source/documentation/lux/time/date.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/time/day.lux b/stdlib/source/documentation/lux/time/day.lux index 29db3b570..e7923dfe0 100644 --- a/stdlib/source/documentation/lux/time/day.lux +++ b/stdlib/source/documentation/lux/time/day.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/time/duration.lux b/stdlib/source/documentation/lux/time/duration.lux index 1340f3460..0b9ddaa0b 100644 --- a/stdlib/source/documentation/lux/time/duration.lux +++ b/stdlib/source/documentation/lux/time/duration.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/time/instant.lux b/stdlib/source/documentation/lux/time/instant.lux index b40489b5c..c5fbe2b01 100644 --- a/stdlib/source/documentation/lux/time/instant.lux +++ b/stdlib/source/documentation/lux/time/instant.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/time/month.lux b/stdlib/source/documentation/lux/time/month.lux index 05103ec1f..9e9d4dc28 100644 --- a/stdlib/source/documentation/lux/time/month.lux +++ b/stdlib/source/documentation/lux/time/month.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/time/year.lux b/stdlib/source/documentation/lux/time/year.lux index 85341eb24..1ac6a11ca 100644 --- a/stdlib/source/documentation/lux/time/year.lux +++ b/stdlib/source/documentation/lux/time/year.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/tool/compiler/language/lux/analysis.lux b/stdlib/source/documentation/lux/tool/compiler/language/lux/analysis.lux index 83a47a0b1..7daade0e8 100644 --- a/stdlib/source/documentation/lux/tool/compiler/language/lux/analysis.lux +++ b/stdlib/source/documentation/lux/tool/compiler/language/lux/analysis.lux @@ -6,10 +6,59 @@ [text (.only \n) ["%" \\format (.only format)]] [collection - ["[0]" list]]]]] + ["[0]" list]]] + [meta + [macro + ["[0]" template]]]]] + ["[0]" \\parser] [\\library ["[0]" /]]) +(`` (.def \\parser + (.List $.Module) + ($.module \\parser._ + "" + [($.default \\parser.cannot_parse) + ($.default \\parser.unconsumed_input) + + ($.documentation (\\parser.Parser it) + "A parser for Lux code analysis nodes.") + + ($.documentation \\parser.result + "Executes a parser and makes sure no inputs go unconsumed." + [(result parser input)]) + + ($.documentation \\parser.any + "Matches any value, without discrimination.") + + ($.documentation \\parser.end + "Ensures there are no more inputs.") + + ($.documentation \\parser.end? + "Checks whether there are no more inputs.") + + (,, (with_template [<query> <assertion>] + [($.documentation <query> + (format "Queries for a " (template.text [<query>]) " value.")) + ($.documentation <assertion> + (format "Assert a specific " (template.text [<query>]) " value."))] + + [\\parser.bit \\parser.this_bit] + [\\parser.nat \\parser.this_nat] + [\\parser.int \\parser.this_int] + [\\parser.rev \\parser.this_rev] + [\\parser.frac \\parser.this_frac] + [\\parser.text \\parser.this_text] + [\\parser.local \\parser.this_local] + [\\parser.foreign \\parser.this_foreign] + [\\parser.constant \\parser.this_constant] + )) + + ($.documentation \\parser.tuple + "Parses only within the context of a tuple's contents." + [(tuple parser)])] + []))) + (.def .public documentation (.List $.Module) ($.module /._ @@ -57,4 +106,4 @@ ($.default /.source) ($.default /.info) ($.default /.state)] - [])) + [..\\parser])) diff --git a/stdlib/source/documentation/lux/tool/compiler/language/lux/synthesis.lux b/stdlib/source/documentation/lux/tool/compiler/language/lux/synthesis.lux index ed0a4e27b..dcfe3ce0a 100644 --- a/stdlib/source/documentation/lux/tool/compiler/language/lux/synthesis.lux +++ b/stdlib/source/documentation/lux/tool/compiler/language/lux/synthesis.lux @@ -6,10 +6,69 @@ [text (.only \n) ["%" \\format (.only format)]] [collection - ["[0]" list]]]]] + ["[0]" list]]] + [meta + [macro + ["[0]" template]]]]] + ["[0]" \\parser] [\\library ["[0]" /]]) +(`` (.def \\parser + (.List $.Module) + ($.module \\parser._ + "" + [($.default \\parser.cannot_parse) + ($.default \\parser.unconsumed_input) + ($.default \\parser.expected_empty_input) + ($.default \\parser.wrong_arity) + ($.default \\parser.empty_input) + + ($.documentation (\\parser.Parser it) + "A parser for the Lux compiler's synthesis nodes using during optimization.") + + ($.documentation \\parser.result + (format "Executes the parser against the inputs." + \n "Ensures all inputs are consumed by the parser.") + [(result parser input)]) + + ($.documentation \\parser.any + "Yields a synthesis node without subjecting it to any analysis.") + + ($.documentation \\parser.end + "Ensures there are no more inputs.") + + ($.documentation \\parser.end? + "Checks whether there are no more inputs.") + + (,, (with_template [<query> <assertion>] + [($.documentation <query> + (format "Queries for a " (template.text [<query>]) " synthesis node.")) + ($.documentation <assertion> + (format "Checks for a specific " (template.text [<query>]) " synthesis node."))] + + [\\parser.bit \\parser.this_bit] + [\\parser.i64 \\parser.this_i64] + [\\parser.f64 \\parser.this_f64] + [\\parser.text \\parser.this_text] + [\\parser.local \\parser.this_local] + [\\parser.foreign \\parser.this_foreign] + [\\parser.constant \\parser.this_constant] + )) + + ($.documentation \\parser.tuple + "Parses the contents of a tuple." + [(tuple parser)]) + + ($.documentation \\parser.function + "Parses the body of a function with the 'expected' arity." + [(function expected parser)]) + + ($.documentation \\parser.loop + "Parses the initial values and the body of a loop." + [(loop init_parsers iteration_parser)])] + []))) + (.def .public documentation (.List $.Module) ($.module /._ @@ -80,4 +139,4 @@ ($.default /.!multi_pop) ($.default /.simple_left_side) ($.default /.simple_right_side)] - [])) + [..\\parser])) diff --git a/stdlib/source/documentation/lux/world/console.lux b/stdlib/source/documentation/lux/world/console.lux index f20cac8ef..ecda5918d 100644 --- a/stdlib/source/documentation/lux/world/console.lux +++ b/stdlib/source/documentation/lux/world/console.lux @@ -5,9 +5,7 @@ ["@" target] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/world/environment.lux b/stdlib/source/documentation/lux/world/environment.lux index b8663936b..6f842b4b9 100644 --- a/stdlib/source/documentation/lux/world/environment.lux +++ b/stdlib/source/documentation/lux/world/environment.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/world/file.lux b/stdlib/source/documentation/lux/world/file.lux index 1e99499e9..61ed8c379 100644 --- a/stdlib/source/documentation/lux/world/file.lux +++ b/stdlib/source/documentation/lux/world/file.lux @@ -5,9 +5,7 @@ ["@" target] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]] ["[0]" / diff --git a/stdlib/source/documentation/lux/world/file/watch.lux b/stdlib/source/documentation/lux/world/file/watch.lux index cc7dbdea9..5f7e7d311 100644 --- a/stdlib/source/documentation/lux/world/file/watch.lux +++ b/stdlib/source/documentation/lux/world/file/watch.lux @@ -5,9 +5,7 @@ ["@" target] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/world/input/keyboard.lux b/stdlib/source/documentation/lux/world/input/keyboard.lux index 33e98ac17..148cb708b 100644 --- a/stdlib/source/documentation/lux/world/input/keyboard.lux +++ b/stdlib/source/documentation/lux/world/input/keyboard.lux @@ -4,9 +4,7 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/world/net/http/client.lux b/stdlib/source/documentation/lux/world/net/http/client.lux index fb6e83727..3a98dd668 100644 --- a/stdlib/source/documentation/lux/world/net/http/client.lux +++ b/stdlib/source/documentation/lux/world/net/http/client.lux @@ -6,8 +6,9 @@ [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + [meta + [macro + ["[0]" template]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/world/net/http/status.lux b/stdlib/source/documentation/lux/world/net/http/status.lux index 81003a4b0..0e38a3e54 100644 --- a/stdlib/source/documentation/lux/world/net/http/status.lux +++ b/stdlib/source/documentation/lux/world/net/http/status.lux @@ -5,8 +5,9 @@ [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + [meta + [macro + ["[0]" template]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/world/output/video/resolution.lux b/stdlib/source/documentation/lux/world/output/video/resolution.lux index a0b2e9aaa..1a3652c74 100644 --- a/stdlib/source/documentation/lux/world/output/video/resolution.lux +++ b/stdlib/source/documentation/lux/world/output/video/resolution.lux @@ -5,8 +5,9 @@ [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + [meta + [macro + ["[0]" template]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/documentation/lux/world/shell.lux b/stdlib/source/documentation/lux/world/shell.lux index 4ff4e37c0..851d4009e 100644 --- a/stdlib/source/documentation/lux/world/shell.lux +++ b/stdlib/source/documentation/lux/world/shell.lux @@ -5,9 +5,7 @@ ["@" target] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] - [macro - ["[0]" template]]]] + ["%" \\format (.only format)]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/library/lux.lux b/stdlib/source/library/lux.lux index 2e875d426..c13ce6ab0 100644 --- a/stdlib/source/library/lux.lux +++ b/stdlib/source/library/lux.lux @@ -1205,14 +1205,14 @@ (meta#in {#Item (list#mix |#Item| |#End| (list#reversed xs)) {#End}}))) -(def' .private partial_list +(def' .private list#partial Macro (macro (_ xs) ({{#Item last init} (meta#in (list (list#mix |#Item| last init))) _ - (failure "Wrong syntax for partial_list")} + (failure "Wrong syntax for list#partial")} (list#reversed xs)))) (def' .public Union @@ -1547,8 +1547,8 @@ (-> Text a ($' Property_List a) ($' Property_List a))) ({{#Item [k' v'] property_list'} (if (text#= k k') - (partial_list [k v] property_list') - (partial_list [k' v'] (property#with k v property_list'))) + (list#partial [k v] property_list') + (list#partial [k' v'] (property#with k v property_list'))) {#End} (list [k v])} @@ -1757,7 +1757,7 @@ (-> ($' List a) ($' List b) ($' List (Tuple a b)))) ({{#Item x xs'} ({{#Item y ys'} - (partial_list [x y] (zipped_2 xs' ys')) + (list#partial [x y] (zipped_2 xs' ys')) _ (list)} @@ -2426,7 +2426,7 @@ xs {#Item [x xs']} - (partial_list x sep (list#interposed sep xs'))} + (list#partial x sep (list#interposed sep xs'))} xs)) (def' .private (single_expansion token) @@ -2716,7 +2716,7 @@ ..#source source/pre ..#current_module current_module/pre ..#modules modules/pre - ..#scopes (partial_list [#name (list) + ..#scopes (list#partial [#name (list) #inner 0 #locals [#counter 0 #mappings (list [..quantification_level [.Nat ("lux type as" Nat -1)]])] @@ -2830,30 +2830,52 @@ (failure "Wrong syntax for exec")} (list#reversed tokens)))) +(def' .public Pattern + Type + {#Primitive "#Macro/Pattern" {#End}}) + +(def' .public (pattern it) + (-> Macro Pattern) + ("lux type as" Pattern it)) + +(def' .public (pattern_macro it) + (-> Pattern Macro') + ("lux type as" Macro' it)) + +(def' .private (case_expansion#macro case_expansion pattern body branches) + (type_literal (-> (-> (List Code) (Meta (List Code))) + Code Code (List Code) + (Meta (List Code)))) + (do meta#monad + [pattern (one_expansion (full_expansion #1 pattern)) + branches (case_expansion branches)] + (in (list#partial pattern body branches)))) + (def' .private (case_expansion branches) (type_literal (-> (List Code) (Meta (List Code)))) - ({{#Item [_ {#Form {#Item [_ {#Symbol name}] args}}] + ({{#Item [@composite {#Form {#Item [@symbol {#Symbol global}] parameters}}] {#Item body branches'}} (do meta#monad - [??? (macro? name)] - (if ??? - (do meta#monad - [init_expansion (single_expansion (form$ (partial_list (symbol$ name) (form$ args) body branches')))] - (case_expansion init_expansion)) - (do meta#monad - [sub_expansion (case_expansion branches')] - (in (partial_list (form$ (partial_list (symbol$ name) args)) - body - sub_expansion))))) + [|global| (..normal global) + ?type,value (global_value |global|)] + ({{#Some [type value]} + (if (type#= Pattern type) + (do meta#monad + [branches'' ((pattern_macro ("lux type as" Pattern value)) + (list#partial (form$ parameters) body branches'))] + (case_expansion branches'')) + (case_expansion#macro case_expansion [@composite {#Form {#Item [@symbol {#Symbol global}] parameters}}] body branches')) + + {#None} + (case_expansion#macro case_expansion [@composite {#Form {#Item [@symbol {#Symbol global}] parameters}}] body branches')} + ?type,value)) {#Item pattern {#Item body branches'}} - (do meta#monad - [sub_expansion (case_expansion branches')] - (in (partial_list pattern body sub_expansion))) + (case_expansion#macro case_expansion pattern body branches') {#End} - (do meta#monad [] (in (list))) + (meta#in (list)) _ (failure (all text#composite "'lux.case' expects an even number of tokens: " (|> branches @@ -2875,45 +2897,29 @@ (failure "Wrong syntax for case")} tokens))) -(def' .public pattern - Macro - (macro (_ tokens) - (case tokens - {#Item [_ {#Form {#Item pattern {#End}}}] {#Item body branches}} - (do meta#monad - [pattern+ (full_expansion #1 pattern)] - (case pattern+ - {#Item pattern' {#End}} - (in (partial_list pattern' body branches)) - - _ - (failure "`pattern` can only expand to 1 pattern."))) - - _ - (failure "Wrong syntax for `pattern` macro")))) - (def' .private pattern#or - Macro - (macro (_ tokens) - (case tokens - (pattern (partial_list [_ {#Form patterns}] body branches)) - (case patterns - {#End} - (failure "pattern#or cannot have 0 patterns") - - _ - (let' [pairs (|> patterns - (list#each (function' [pattern] (list pattern body))) - (list#conjoint))] - (meta#in (list#composite pairs branches)))) - _ - (failure "Wrong syntax for pattern#or")))) + Pattern + (pattern + (macro (_ tokens) + (case tokens + (list#partial [_ {#Form patterns}] body branches) + (case patterns + {#End} + (failure "pattern#or cannot have 0 patterns") + + _ + (let' [pairs (|> patterns + (list#each (function' [pattern] (list pattern body))) + (list#conjoint))] + (meta#in (list#composite pairs branches)))) + _ + (failure "Wrong syntax for pattern#or"))))) (def' .public symbol Macro (macro (_ tokens) (case tokens - (pattern (list [_ {#Symbol [module name]}])) + (list [_ {#Symbol [module name]}]) (meta#in (list (` [(, (text$ module)) (, (text$ name))]))) _ @@ -2932,7 +2938,7 @@ Macro (macro (_ tokens) (case tokens - (pattern (list [_ {#Tuple bindings}] body)) + (list [_ {#Tuple bindings}] body) (case (..pairs bindings) {#Some bindings} (|> bindings @@ -2958,7 +2964,7 @@ (macro (_ tokens) (case (is (Maybe [Text Code (List Code) Code]) (case tokens - (pattern (list [_ {#Form (partial_list [_ {#Symbol ["" name]}] head tail)}] body)) + (list [_ {#Form (list#partial [_ {#Symbol ["" name]}] head tail)}] body) {#Some name head tail body} _ @@ -2987,7 +2993,7 @@ (def' .private (parsed parser tokens) (type_literal (All (_ a) (-> (Parser a) (List Code) (Maybe a)))) (case (parser tokens) - (pattern {#Some [(list) it]}) + {#Some [(list) it]} {#Some it} _ @@ -3064,7 +3070,7 @@ (do maybe#monad [it (someP itP tokens) .let [[tokens tail] it]] - (in [tokens (partial_list head tail)])) + (in [tokens (list#partial head tail)])) {#None} {#Some [tokens (list)]})) @@ -3079,7 +3085,7 @@ .let [[tokens head] it] it (someP itP tokens) .let [[tokens tail] it]] - (in [tokens (partial_list head tail)]))) + (in [tokens (list#partial head tail)]))) (def' .private (maybeP itP tokens) (type_literal @@ -3098,7 +3104,7 @@ (All (_ a) (-> (Parser a) (Parser a)))) (case tokens - (pattern (partial_list [_ {#Tuple input}] tokens')) + (list#partial [_ {#Tuple input}] tokens') (do maybe#monad [it (parsed itP input)] (in [tokens' it])) @@ -3111,7 +3117,7 @@ (All (_ a) (-> (Parser a) (Parser a)))) (case tokens - (pattern (partial_list [_ {#Form input}] tokens')) + (list#partial [_ {#Form input}] tokens') (do maybe#monad [it (parsed itP input)] (in [tokens' it])) @@ -3122,7 +3128,7 @@ (def' .private (bindingP tokens) (type_literal (Parser [Text Code])) (case tokens - (pattern (partial_list [_ {#Symbol ["" name]}] value &rest)) + (list#partial [_ {#Symbol ["" name]}] value &rest) {#Some [&rest [name value]]} _ @@ -3131,7 +3137,7 @@ (def' .private (endP tokens) (type_literal (Parser Any)) (case tokens - (pattern (list)) + (list) {#Some [tokens []]} _ @@ -3140,7 +3146,7 @@ (def' .private (anyP tokens) (type_literal (Parser Code)) (case tokens - (pattern (partial_list code tokens')) + (list#partial code tokens') {#Some [tokens' code]} _ @@ -3149,7 +3155,7 @@ (def' .private (localP tokens) (type_literal (-> (List Code) (Maybe [(List Code) Text]))) (case tokens - (pattern (partial_list [_ {#Symbol ["" local]}] tokens')) + (list#partial [_ {#Symbol ["" local]}] tokens') {#Some [tokens' local]} _ @@ -3158,7 +3164,7 @@ (def' .private (symbolP tokens) (type_literal (-> (List Code) (Maybe [(List Code) Symbol]))) (case tokens - (pattern (partial_list [_ {#Symbol it}] tokens')) + (list#partial [_ {#Symbol it}] tokens') {#Some [tokens' it]} _ @@ -3186,7 +3192,7 @@ [(def' .private (<parser> tokens) (type_literal (Parser [Text (List <parameter_type>)])) (case tokens - (pattern (partial_list [_ {#Form local_declaration}] tokens')) + (list#partial [_ {#Form local_declaration}] tokens') (do maybe#monad [% (localP local_declaration) .let' [[local_declaration name] %] @@ -3206,7 +3212,7 @@ (def' .private (export_policyP tokens) (type_literal (-> (List Code) [(List Code) Code])) (case tokens - (pattern (partial_list candidate tokens')) + (list#partial candidate tokens') (case candidate [_ {#Bit it}] [tokens' candidate] @@ -3240,11 +3246,11 @@ (type_literal (-> (List Code) (Maybe [(List Code) [(Maybe Code) Code]]))) (case tokens ... TB - (pattern (partial_list type body tokens')) + (list#partial type body tokens') {#Some [tokens' [{#Some type} body]]} ... B - (pattern (partial_list body tokens')) + (list#partial body tokens') {#Some [tokens' [{#None} body]]} _ @@ -3290,7 +3296,7 @@ [(def .public <name> (macro (_ tokens) (case (list#reversed tokens) - (pattern (partial_list last init)) + (list#partial last init) (meta#in (list (list#mix (is (-> Code Code Code) (function (_ pre post) (` <form>))) last @@ -3313,7 +3319,7 @@ (def maybe#else (macro (_ tokens state) (case tokens - (pattern (list else maybe)) + (list else maybe) (let [g!temp (is Code [dummy_location {#Symbol ["" ""]}]) code (` (case (, maybe) {.#Some (, g!temp)} @@ -3333,7 +3339,7 @@ (list input) {#Some idx} - (partial_list ("lux text clip" 0 idx input) + (list#partial ("lux text clip" 0 idx input) (text#all_split_by splitter (let [after_offset ("lux i64 +" 1 idx) after_length ("lux i64 -" @@ -3404,10 +3410,10 @@ (-> Type Type (Maybe Type)) (case type_fn {#UnivQ env body} - {#Some (reduced (partial_list type_fn param env) body)} + {#Some (reduced (list#partial type_fn param env) body)} {#ExQ env body} - {#Some (reduced (partial_list type_fn param env) body)} + {#Some (reduced (list#partial type_fn param env) body)} {#Apply A F} (do maybe#monad @@ -3425,7 +3431,7 @@ (-> Type (List Type)) (case type {<tag> left right} - (partial_list left (<name> right)) + (list#partial left (<name> right)) _ (list type)))] @@ -3607,8 +3613,8 @@ (macro (_ tokens) (do meta#monad [tokens' (monad#each meta#monad expansion tokens) - struct_type ..expected_type - tags+type (record_slots struct_type) + implementation_type ..expected_type + tags+type (record_slots implementation_type) tags (is (Meta (List Symbol)) (case tags+type {#Some [tags _]} @@ -3617,7 +3623,7 @@ _ (failure (all text#composite "No tags available for type: " - (type#encoded struct_type))))) + (type#encoded implementation_type))))) .let [tag_mappings (is (List [Text Code]) (list#each (function (_ tag) [(product#right tag) @@ -3627,7 +3633,7 @@ (is (-> Code (Meta (List Code))) (function (_ token) (case token - (pattern [_ {#Form (list [_ {#Text "lux def"}] [_ {#Symbol ["" slot_name]}] value export_policy)}]) + [_ {#Form (list [_ {#Text "lux def"}] [_ {#Symbol ["" slot_name]}] value export_policy)}] (case (property#value slot_name tag_mappings) {#Some tag} (in (list tag value)) @@ -3672,7 +3678,7 @@ {#End} (in (list)))] - (in (partial_list head tail))) + (in (list#partial head tail))) {#End} {#Some (list)})) @@ -3680,10 +3686,10 @@ (def (caseP tokens) (-> (List Code) (Maybe [(List Code) [Text Code]])) (case tokens - (pattern (partial_list [_ {#Variant (list [_ {#Symbol ["" niladic]}])}] tokens')) + (list#partial [_ {#Variant (list [_ {#Symbol ["" niladic]}])}] tokens') {#Some [tokens' [niladic (` .Any)]]} - (pattern (partial_list [_ {#Variant (partial_list [_ {#Symbol ["" polyadic]}] caseT)}] tokens')) + (list#partial [_ {#Variant (list#partial [_ {#Symbol ["" polyadic]}] caseT)}] tokens') {#Some [tokens' [polyadic (` (..Tuple (,* caseT)))]]} _ @@ -3704,7 +3710,7 @@ (def (slotP tokens) (-> (List Code) (Maybe [(List Code) [Text Code]])) (case tokens - (pattern (partial_list [_ {#Symbol ["" slot]}] type tokens')) + (list#partial [_ {#Symbol ["" slot]}] type tokens') {#Some [tokens' [slot type]]} _ @@ -3713,7 +3719,7 @@ (def .public Record (macro (_ tokens) (case tokens - (pattern (list [_ {#Tuple record}])) + (list [_ {#Tuple record}]) (case (everyP slotP record) {#Some slots} (meta#in (list (` (..Tuple (,* (list#each product#right slots)))) @@ -3740,7 +3746,7 @@ (def (textP tokens) (-> (List Code) (Maybe [(List Code) Text])) (case tokens - (pattern (partial_list [_ {#Text it}] tokens')) + (list#partial [_ {#Text it}] tokens') {#Some [tokens' it]} _ @@ -3750,9 +3756,9 @@ (-> Code (Meta (Tuple Code (Maybe (Either (List Text) (List Text)))))) ({[_ {#Form {#Item [_ {#Symbol declarer}] parameters}}] (do meta#monad - [declaration (single_expansion (form$ (partial_list (symbol$ declarer) parameters)))] + [declaration (single_expansion (form$ (list#partial (symbol$ declarer) parameters)))] (case declaration - (pattern (list type [_ {#Variant tags}])) + (list type [_ {#Variant tags}]) (case (everyP textP tags) {#Some tags} (meta#in [type {#Some {#Left tags}}]) @@ -3760,7 +3766,7 @@ {#None} (failure "Improper type-definition syntax")) - (pattern (list type [_ {#Tuple slots}])) + (list type [_ {#Tuple slots}]) (case (everyP textP slots) {#Some slots} (meta#in [type {#Some {#Right slots}}]) @@ -3768,7 +3774,7 @@ {#None} (failure "Improper type-definition syntax")) - (pattern (list type)) + (list type) (meta#in [it {#None}]) _ @@ -3927,7 +3933,8 @@ (def (list#after amount list) (All (_ a) (-> Nat (List a) (List a))) (case [amount list] - (pattern#or [0 _] [_ {#End}]) + (pattern#or [0 _] + [_ {#End}]) list [_ {#Item _ tail}] @@ -3968,7 +3975,7 @@ (function (_ token) (case token ... Nested - (pattern [_ {#Tuple (partial_list [_ {#Symbol ["" module_name]}] extra)}]) + [_ {#Tuple (list#partial [_ {#Symbol ["" module_name]}] extra)}] (do meta#monad [absolute_module_name (case (normal_parallel_path relative_root module_name) {#Some parallel_path} @@ -3989,12 +3996,12 @@ sub_imports _ - (partial_list [#import_name absolute_module_name + (list#partial [#import_name absolute_module_name #import_alias {#None} #import_referrals referral] sub_imports)))) - (pattern [_ {#Tuple (partial_list [_ {#Text alias}] [_ {#Symbol ["" module_name]}] extra)}]) + [_ {#Tuple (list#partial [_ {#Text alias}] [_ {#Symbol ["" module_name]}] extra)}] (do meta#monad [absolute_module_name (case (normal_parallel_path relative_root module_name) {#Some parallel_path} @@ -4016,7 +4023,7 @@ sub_imports _ - (partial_list [#import_name absolute_module_name + (list#partial [#import_name absolute_module_name #import_alias {#Some module_alias} #import_referrals referral] sub_imports)))) @@ -4225,19 +4232,19 @@ (let [temp (is (Either Text [Lux Type]) (if (text#= "" module) (case (in_env name compiler) - {#Some struct_type} - {#Right [compiler struct_type]} + {#Some implementation_type} + {#Right [compiler implementation_type]} _ (case (definition_type [current_module name] compiler) - {#Some struct_type} - {#Right [compiler struct_type]} + {#Some implementation_type} + {#Right [compiler implementation_type]} _ {#Left (all text#composite "Unknown var: " (symbol#encoded full_name))})) (case (definition_type full_name compiler) - {#Some struct_type} - {#Right [compiler struct_type]} + {#Some implementation_type} + {#Right [compiler implementation_type]} _ {#Left (all text#composite "Unknown var: " (symbol#encoded full_name))})))] @@ -4259,67 +4266,103 @@ temp)) ))) -(def .public open - (macro (_ tokens) - (case tokens - (pattern (partial_list [_ {#Form (list [_ {#Text alias}])}] body branches)) - (do meta#monad - [g!temp (..generated_symbol "temp")] - (in (partial_list g!temp (` (..open (, g!temp) (, (text$ alias)) (, body))) branches))) +(def (list#all choice items) + (All (_ a b) (-> (-> a (Maybe b)) (List a) (List b))) + (case items + {#Item head tail} + (case (choice head) + {#Some head} + {#Item head (list#all choice tail)} + + {#None} + (list#all choice tail)) + + {#End} + {#End})) - (pattern (list [_ {#Symbol name}] [_ {#Text alias}] body)) - (do meta#monad - [init_type (type_definition name) - struct_evidence (record_slots init_type)] - (case struct_evidence - {#None} - (failure (text#composite "Can only 'open' structs: " (type#encoded init_type))) +(type Implementation_Interface + [(List Symbol) (List Type)]) - {#Some tags&members} - (do meta#monad - [full_body ((is (-> Symbol [(List Symbol) (List Type)] Code (Meta Code)) - (function (again source [tags members] target) - (let [locals (list#each (function (_ [t_module t_name]) - [[t_module t_name] - ["" (..module_alias (list t_name) alias)]]) - tags) - pattern (case locals - (pattern (list [slot binding])) - (symbol$ binding) - - _ - (|> locals - (list#each (function (_ [slot binding]) - (list (symbol$ slot) - (symbol$ binding)))) - list#conjoint - tuple$))] - (do meta#monad - [enhanced_target (monad#mix meta#monad - (function (_ [[_ m_local] m_type] enhanced_target) - (do meta#monad - [m_implementation (record_slots m_type)] - (case m_implementation - {#Some m_tags&members} - (again m_local - m_tags&members - enhanced_target) - - {#None} - (in enhanced_target)))) - target - (zipped_2 locals members))] - (in (` ({(, pattern) (, enhanced_target)} (, (symbol$ source))))))))) - name tags&members body)] - (in (list full_body))))) +(def (open_layer alias [tags members]) + (-> Text Implementation_Interface (Meta [Code (List [Symbol Implementation_Interface])])) + (do meta#monad + [pattern (monad#each meta#monad + (function (_ [slot slot_type]) + (do meta#monad + [.let [[_ slot_name] slot + local ["" (..module_alias (list slot_name) alias)]] + implementation (record_slots slot_type)] + (in [(list (symbol$ slot) + (symbol$ local)) + [local implementation]]))) + (zipped_2 tags members))] + (in [(|> pattern + (list#each product#left) + list#conjoint + tuple$) + (list#all (function (_ [_ [sub_binding sub_implementation]]) + (do maybe#monad + [sub_implementation sub_implementation] + (in [sub_binding sub_implementation]))) + pattern)]))) + +(def (open_layers alias interfaces body) + (-> Text (List Implementation_Interface) Code (Meta [Code Code])) + (do meta#monad + [layer (monad#each meta#monad (open_layer alias) interfaces) + .let [pattern (tuple$ (list#each product#left layer)) + next (|> layer + (list#each product#right) + list#conjoint)]] + (case next + {#End} + (in [pattern body]) _ - (failure (..wrong_syntax_error (symbol ..open)))))) + (do meta#monad + [.let [sub_value (tuple$ (list#each (|>> product#left symbol$) next))] + sub_pattern,sub_body (open_layers alias (list#each product#right next) body) + .let [[sub_pattern sub_body] sub_pattern,sub_body]] + (in [pattern (` (case (, sub_value) + (, sub_pattern) + (, sub_body)))]))))) + +(def .public open + (pattern + (macro (_ tokens) + (case tokens + (list#partial [_ {#Form (list [_ {#Text alias}])}] body branches) + (do meta#monad + [g!temp (..generated_symbol "temp")] + (in (list#partial g!temp + (` (..case (, g!temp) + (..open (, g!temp) (, (text$ alias))) + (, body))) + branches))) + + (list#partial [_ {#Form (list [@temp_var {#Symbol name}] [_ {#Text alias}])}] + body + branches) + (do meta#monad + [init_type (type_definition name) + implementation_evidence (record_slots init_type)] + (case implementation_evidence + {#None} + (failure (text#composite "Can only 'open' implementations: " (type#encoded init_type))) + + {#Some tags,members} + (do meta#monad + [pattern,body (open_layers alias (list tags,members) body) + .let [[pattern body] pattern,body]] + (in (list#partial pattern body branches))))) + + _ + (failure (..wrong_syntax_error (symbol ..open))))))) (def .public cond (macro (_ tokens) (case (list#reversed tokens) - (pattern (partial_list else branches')) + (list#partial else branches') (case (pairs branches') {#Some branches'} (meta#in (list (list#mix (is (-> [Code Code] Code Code) @@ -4353,7 +4396,7 @@ (def .public the (macro (_ tokens) (case tokens - (pattern (list [_ {#Symbol slot'}] record)) + (list [_ {#Symbol slot'}] record) (do meta#monad [slot (normal slot') output (..type_slot slot) @@ -4376,14 +4419,14 @@ _ (failure "the can only use records."))) - (pattern (list [_ {#Tuple slots}] record)) + (list [_ {#Tuple slots}] record) (meta#in (list (list#mix (is (-> Code Code Code) (function (_ slot inner) (` (..the (, slot) (, inner))))) record slots))) - (pattern (list selector)) + (list selector) (do meta#monad [g!_ (..generated_symbol "_") g!record (..generated_symbol "record")] @@ -4438,7 +4481,7 @@ _ (failure (all text#composite - "Can only 'use' structs: " (symbol#encoded implementation) + "Can only 'use' implementations: " (symbol#encoded implementation) " : " (type#encoded interface)))))) (def (localized module global) @@ -4540,7 +4583,7 @@ (def refer (macro (_ tokens) (case tokens - (pattern (partial_list [_ {#Text imported_module}] [_ {#Text alias}] options)) + (list#partial [_ {#Text imported_module}] [_ {#Text alias}] options) (do meta#monad [referrals (..referrals imported_module options) current_module ..current_module_name] @@ -4569,11 +4612,11 @@ (def .public at (macro (_ tokens) (case tokens - (pattern (list implementation [_ {#Symbol member}])) + (list implementation [_ {#Symbol member}]) (meta#in (list (` (..with (, implementation) (, (symbol$ member)))))) - (pattern (partial_list struct member args)) - (meta#in (list (` ((..at (, struct) (, member)) (,* args))))) + (list#partial implementation member args) + (meta#in (list (` ((..at (, implementation) (, member)) (,* args))))) _ (failure (..wrong_syntax_error (symbol ..at)))))) @@ -4581,7 +4624,7 @@ (def .public has (macro (_ tokens) (case tokens - (pattern (list [_ {#Symbol slot'}] value record)) + (list [_ {#Symbol slot'}] value record) (do meta#monad [slot (normal slot') output (..type_slot slot) @@ -4617,7 +4660,7 @@ _ (failure "has can only use records."))) - (pattern (list [_ {#Tuple slots}] value record)) + (list [_ {#Tuple slots}] value record) (case slots {#End} (failure (..wrong_syntax_error (symbol ..has))) @@ -4644,14 +4687,14 @@ (in (list (` (let [(,* accesses)] (, update_expr))))))) - (pattern (list selector value)) + (list selector value) (do meta#monad [g!_ (..generated_symbol "_") g!record (..generated_symbol "record")] (in (list (` (function ((, g!_) (, g!record)) (..has (, selector) (, value) (, g!record))))))) - (pattern (list selector)) + (list selector) (do meta#monad [g!_ (..generated_symbol "_") g!value (..generated_symbol "value") @@ -4665,7 +4708,7 @@ (def .public revised (macro (_ tokens) (case tokens - (pattern (list [_ {#Symbol slot'}] fun record)) + (list [_ {#Symbol slot'}] fun record) (do meta#monad [slot (normal slot') output (..type_slot slot) @@ -4701,7 +4744,7 @@ _ (failure "revised can only use records."))) - (pattern (list [_ {#Tuple slots}] fun record)) + (list [_ {#Tuple slots}] fun record) (case slots {#End} (failure (..wrong_syntax_error (symbol ..revised))) @@ -4714,14 +4757,14 @@ (, g!temp) (the [(,* slots)] (, g!record))] (has [(,* slots)] ((, fun) (, g!temp)) (, g!record)))))))) - (pattern (list selector fun)) + (list selector fun) (do meta#monad [g!_ (..generated_symbol "_") g!record (..generated_symbol "record")] (in (list (` (function ((, g!_) (, g!record)) (..revised (, selector) (, fun) (, g!record))))))) - (pattern (list selector)) + (list selector) (do meta#monad [g!_ (..generated_symbol "_") g!fun (..generated_symbol "fun") @@ -4733,34 +4776,35 @@ (failure (..wrong_syntax_error (symbol ..revised)))))) (def .private with_template#pattern - (macro (_ tokens) - (case tokens - (pattern (partial_list [_ {#Form (list [_ {#Tuple bindings}] - [_ {#Tuple templates}])}] - [_ {#Form data}] - branches)) - (case (is (Maybe (List Code)) - (do maybe#monad - [bindings' (monad#each maybe#monad symbol_short bindings) - data' (monad#each maybe#monad tuple_list data)] - (let [num_bindings (list#size bindings')] - (if (every? (|>> ("lux i64 =" num_bindings)) - (list#each list#size data')) - (let [apply (is (-> Replacement_Environment (List Code)) - (function (_ env) (list#each (realized_template env) templates)))] - (|> data' - (list#each (function#composite apply (replacement_environment bindings'))) - list#conjoint - in)) - {#None})))) - {#Some output} - (meta#in (list#composite output branches)) - - {#None} - (failure (..wrong_syntax_error (symbol ..with_template#pattern)))) - - _ - (failure (..wrong_syntax_error (symbol ..with_template#pattern)))))) + (pattern + (macro (_ tokens) + (case tokens + (list#partial [_ {#Form (list [_ {#Tuple bindings}] + [_ {#Tuple templates}])}] + [_ {#Form data}] + branches) + (case (is (Maybe (List Code)) + (do maybe#monad + [bindings' (monad#each maybe#monad symbol_short bindings) + data' (monad#each maybe#monad tuple_list data)] + (let [num_bindings (list#size bindings')] + (if (every? (|>> ("lux i64 =" num_bindings)) + (list#each list#size data')) + (let [apply (is (-> Replacement_Environment (List Code)) + (function (_ env) (list#each (realized_template env) templates)))] + (|> data' + (list#each (function#composite apply (replacement_environment bindings'))) + list#conjoint + in)) + {#None})))) + {#Some output} + (meta#in (list#composite output branches)) + + {#None} + (failure (..wrong_syntax_error (symbol ..with_template#pattern)))) + + _ + (failure (..wrong_syntax_error (symbol ..with_template#pattern))))))) (with_template [<name> <extension>] [(def .public <name> @@ -4785,7 +4829,7 @@ {#End} {#Item y ys'} - (partial_list x y (interleaved xs' ys'))))) + (list#partial x y (interleaved xs' ys'))))) (def (type_code type) (-> Type Code) @@ -4821,7 +4865,7 @@ (def .public loop (macro (_ tokens) (let [?params (case tokens - (pattern (list [_ {#Form (list name [_ {#Tuple bindings}])}] body)) + (list [_ {#Form (list name [_ {#Tuple bindings}])}] body) {#Some [name bindings body]} _ @@ -4864,7 +4908,12 @@ (def (with_expansions' label tokens target) (-> Text (List Code) Code (List Code)) (case target - (pattern#or [_ {#Bit _}] [_ {#Nat _}] [_ {#Int _}] [_ {#Rev _}] [_ {#Frac _}] [_ {#Text _}]) + (pattern#or [_ {#Bit _}] + [_ {#Nat _}] + [_ {#Int _}] + [_ {#Rev _}] + [_ {#Frac _}] + [_ {#Text _}]) (list target) [_ {#Symbol [module name]}] @@ -4897,7 +4946,7 @@ {#Item [var_name expr] &rest} (do meta#monad [expansion (case (normal expr) - (pattern (list expr)) + (list expr) (single_expansion expr) _ @@ -4979,7 +5028,7 @@ (def .public static (macro (_ tokens) (case tokens - (pattern (list pattern)) + (list pattern) (do meta#monad [pattern' (static_literal pattern)] (in (list pattern'))) @@ -4992,13 +5041,12 @@ (def (case_level^ level) (-> Code (Meta [Code Code])) - (case level - (pattern [_ {#Tuple (list expr binding)}]) - (meta#in [expr binding]) + (meta#in (case level + [_ {#Tuple (list expr binding)}] + [expr binding] - _ - (meta#in [level (` #1)]) - )) + _ + [level (` #1)]))) (def (multi_level_case^ levels) (-> (List Code) (Meta Multi_Level_Case)) @@ -5032,36 +5080,37 @@ (list init_pattern inner_pattern_body))) (def pattern#multi - (macro (_ tokens) - (case tokens - (pattern (partial_list [_meta {#Form levels}] body next_branches)) - (do meta#monad - [mlc (multi_level_case^ levels) - .let [initial_bind? (case mlc - [[_ {#Symbol _}] _] - #1 - - _ - #0)] - expected ..expected_type - g!temp (..generated_symbol "temp")] - (in (list g!temp - (` ({{.#Some (, g!temp)} - (, g!temp) - - {.#None} - (case (, g!temp) - (,* next_branches))} - ("lux type check" {.#Apply (, (type_code expected)) Maybe} - (case (, g!temp) - (,* (multi_level_case$ g!temp [mlc body])) - - (,* (if initial_bind? - (list) - (list g!temp (` {.#None}))))))))))) - - _ - (failure (..wrong_syntax_error (symbol ..pattern#multi)))))) + (pattern + (macro (_ tokens) + (case tokens + (list#partial [_meta {#Form levels}] body next_branches) + (do meta#monad + [mlc (multi_level_case^ levels) + .let [initial_bind? (case mlc + [[_ {#Symbol _}] _] + #1 + + _ + #0)] + expected ..expected_type + g!temp (..generated_symbol "temp")] + (in (list g!temp + (` ({{.#Some (, g!temp)} + (, g!temp) + + {.#None} + (case (, g!temp) + (,* next_branches))} + ("lux type check" {.#Apply (, (type_code expected)) Maybe} + (case (, g!temp) + (,* (multi_level_case$ g!temp [mlc body])) + + (,* (if initial_bind? + (list) + (list g!temp (` {.#None}))))))))))) + + _ + (failure (..wrong_syntax_error (symbol ..pattern#multi))))))) (def .public (same? reference sample) (All (_ a) @@ -5071,7 +5120,7 @@ (def .public as_expected (macro (_ tokens) (case tokens - (pattern (list expr)) + (list expr) (do meta#monad [type ..expected_type] (in (list (` ("lux type as" (, (type_code type)) (, expr)))))) @@ -5101,12 +5150,12 @@ (def .public type_of (macro (_ tokens) (case tokens - (pattern (list [_ {#Symbol var_name}])) + (list [_ {#Symbol var_name}]) (do meta#monad [var_type (type_definition var_name)] (in (list (type_code var_type)))) - (pattern (list expression)) + (list expression) (do meta#monad [g!temp (..generated_symbol "g!temp")] (in (list (` (let [(, g!temp) (, expression)] @@ -5139,7 +5188,7 @@ this_module current_module_name] (in (list (` (..macro ((, (local$ name)) (, g!tokens) (, g!compiler)) (case (, g!tokens) - (pattern (list (,* (list#each local$ args)))) + (list (,* (list#each local$ args))) {.#Right [(, g!compiler) (list (,* (list#each (function (_ template) (` (`' (, (with_replacements rep_env @@ -5170,7 +5219,7 @@ (def .public char (macro (_ tokens compiler) (case tokens - (pattern#multi (pattern (list [_ {#Text input}])) + (pattern#multi (list [_ {#Text input}]) (|> input "lux text size" ("lux i64 =" 1))) (|> input ("lux text char" 0) nat$ list @@ -5254,7 +5303,7 @@ (def .public parameter (macro (_ tokens) (case tokens - (pattern (list [_ {#Nat idx}])) + (list [_ {#Nat idx}]) (do meta#monad [stvs ..scope_type_vars] (case (..item idx (list#reversed stvs)) @@ -5300,7 +5349,7 @@ ... {library/lux/tool/compiler/language/lux/generation.no_buffer_for_saving_code} ... Artifact ID: 0 ... Which only ever happens for the Python compiler. - (partial_list (` ("lux def" (, g!_) [] #0)) + (list#partial (` ("lux def" (, g!_) [] #0)) =refers) =refers)})))) @@ -5319,7 +5368,7 @@ (..immediate_unquote (macro (_ it) (case it - (pattern (list it)) + (list it) (meta#in (list it)) _ @@ -5348,8 +5397,8 @@ (def (embedded_expansions code) (-> Code (Meta [(List Code) Code])) (case code - (pattern [@ {#Form (partial_list [@symbol {#Symbol original_symbol}] parameters)}]) - (with_expansions [<failure> (aggregate_embedded_expansions embedded_expansions @ #Form (partial_list [@symbol {#Symbol original_symbol}] parameters))] + [@ {#Form (list#partial [@symbol {#Symbol original_symbol}] parameters)}] + (with_expansions [<failure> (aggregate_embedded_expansions embedded_expansions @ #Form (list#partial [@symbol {#Symbol original_symbol}] parameters))] (do meta#monad [resolved_symbol (..normal original_symbol) ?resolved_symbol (meta#try (..global_symbol resolved_symbol))] @@ -5386,7 +5435,7 @@ (def .public `` (macro (_ tokens) (case tokens - (pattern (list raw)) + (list raw) (do meta#monad [=raw (..embedded_expansions raw) .let [[labels labelled] =raw]] @@ -5406,7 +5455,7 @@ (def .public try (macro (_ tokens) (case tokens - (pattern (list expression)) + (list expression) (do meta#monad [g!_ (..generated_symbol "g!_")] (in (list (` ("lux try" @@ -5419,10 +5468,10 @@ (def (methodP tokens) (-> (List Code) (Maybe [(List Code) [Text Code]])) (case tokens - (pattern (partial_list [_ {#Form (list [_ {#Text "lux type check"}] - type - [_ {#Symbol ["" name]}])}] - tokens')) + (list#partial [_ {#Form (list [_ {#Text "lux type check"}] + type + [_ {#Symbol ["" name]}])}] + tokens') {#Some [tokens' [name type]]} _ @@ -5450,16 +5499,16 @@ (def .public Rec (macro (_ tokens) (case tokens - (pattern (list [_ {#Symbol "" name}] body)) + (list [_ {#Symbol "" name}] body) (do meta#monad [body' (expansion body) g!self (generated_symbol "g!self") g!dummy (generated_symbol "g!dummy")] (case body' - (pattern (list body' labels)) + (list body' labels) (in (list (..recursive_type g!self g!dummy name body') labels)) - (pattern (list body')) + (list body') (in (list (..recursive_type g!self g!dummy name body'))) _ diff --git a/stdlib/source/library/lux/abstract/comonad.lux b/stdlib/source/library/lux/abstract/comonad.lux index fbe61f780..15a1e96d3 100644 --- a/stdlib/source/library/lux/abstract/comonad.lux +++ b/stdlib/source/library/lux/abstract/comonad.lux @@ -27,10 +27,10 @@ (macro (_ tokens state) (case (is (Maybe [(Maybe Text) Code (List Code) Code]) (case tokens - (pattern (list [_ {.#Tuple (list [_ {.#Symbol ["" name]}] comonad)}] [_ {.#Tuple bindings}] body)) + (list [_ {.#Tuple (list [_ {.#Symbol ["" name]}] comonad)}] [_ {.#Tuple bindings}] body) {.#Some [{.#Some name} comonad bindings body]} - (pattern (list comonad [_ {.#Tuple bindings}] body)) + (list comonad [_ {.#Tuple bindings}] body) {.#Some [{.#None} comonad bindings body]} _ diff --git a/stdlib/source/library/lux/abstract/monad.lux b/stdlib/source/library/lux/abstract/monad.lux index 33faf1290..71f981b3e 100644 --- a/stdlib/source/library/lux/abstract/monad.lux +++ b/stdlib/source/library/lux/abstract/monad.lux @@ -58,10 +58,10 @@ (macro (_ tokens state) (case (is (Maybe [(Maybe Text) Code (List Code) Code]) (case tokens - (pattern (list [_ {.#Tuple (list [_ {.#Symbol ["" name]}] monad)}] [_ {.#Tuple bindings}] body)) + (list [_ {.#Tuple (list [_ {.#Symbol ["" name]}] monad)}] [_ {.#Tuple bindings}] body) {.#Some [{.#Some name} monad bindings body]} - (pattern (list monad [_ {.#Tuple bindings}] body)) + (list monad [_ {.#Tuple bindings}] body) {.#Some [{.#None} monad bindings body]} _ diff --git a/stdlib/source/library/lux/control/maybe.lux b/stdlib/source/library/lux/control/maybe.lux index 15daadb8b..a48e3661e 100644 --- a/stdlib/source/library/lux/control/maybe.lux +++ b/stdlib/source/library/lux/control/maybe.lux @@ -128,7 +128,7 @@ (def .public else (macro (_ tokens state) (case tokens - (pattern (.list else maybe)) + (.list else maybe) (let [g!temp (is Code [location.dummy {.#Symbol ["" ""]}])] {.#Right [state (.list (` (.case (, maybe) {.#Some (, g!temp)} @@ -158,7 +158,7 @@ (def .public when (macro (_ tokens state) (case tokens - (pattern (.list test then)) + (.list test then) {.#Right [state (.list (` (.if (, test) (, then) {.#None})))]} diff --git a/stdlib/source/library/lux/control/pipe.lux b/stdlib/source/library/lux/control/pipe.lux index 23990201d..2198abe8a 100644 --- a/stdlib/source/library/lux/control/pipe.lux +++ b/stdlib/source/library/lux/control/pipe.lux @@ -89,7 +89,7 @@ prev <code>.any]) (with_symbols [g!temp] (.case (list.reversed steps) - (pattern (list.partial last_step prev_steps)) + (list.partial last_step prev_steps) (.let [step_bindings (monad.do list.monad [step (list.reversed prev_steps)] (list g!temp (` (|> (, g!temp) (,* step)))))] diff --git a/stdlib/source/library/lux/control/try.lux b/stdlib/source/library/lux/control/try.lux index 2e86903c7..fe17409a2 100644 --- a/stdlib/source/library/lux/control/try.lux +++ b/stdlib/source/library/lux/control/try.lux @@ -141,7 +141,7 @@ (def .public else (macro (_ tokens compiler) (case tokens - (pattern (list else try)) + (list else try) {#Success [compiler (list (` (case (, try) {..#Success (,' g!temp)} (,' g!temp) @@ -156,7 +156,7 @@ (def .public when (macro (_ tokens state) (case tokens - (pattern (.list test then)) + (.list test then) (let [code#encoded ("lux in-module" "library/lux" .code#encoded) text$ ("lux in-module" "library/lux" .text$)] {.#Right [state (.list (` (.if (, test) diff --git a/stdlib/source/library/lux/data/collection/list.lux b/stdlib/source/library/lux/data/collection/list.lux index 176b9d9b4..c6e0f8587 100644 --- a/stdlib/source/library/lux/data/collection/list.lux +++ b/stdlib/source/library/lux/data/collection/list.lux @@ -97,7 +97,7 @@ (def .public (pairs xs) (All (_ a) (-> (List a) (Maybe (List [a a])))) (case xs - (pattern (partial x1 x2 xs')) + (partial x1 x2 xs') (case (pairs xs') {.#Some tail} {.#Some (partial [x1 x2] tail)} @@ -105,7 +105,7 @@ {.#None} {.#None}) - (pattern (list)) + (list) {.#Some (list)} _ @@ -476,7 +476,7 @@ (def .public zipped (macro (_ tokens state) (case tokens - (pattern (list [_ {.#Nat num_lists}])) + (list [_ {.#Nat num_lists}]) (if (n.> 0 num_lists) (let [(open "[0]") ..functor indices (..indices num_lists) @@ -517,7 +517,7 @@ (def .public zipped_with (macro (_ tokens state) (case tokens - (pattern (list [_ {.#Nat num_lists}])) + (list [_ {.#Nat num_lists}]) (if (n.> 0 num_lists) (let [(open "[0]") ..functor indices (..indices num_lists) @@ -630,7 +630,7 @@ (def .public when (macro (_ tokens state) (case tokens - (pattern (.list test then)) + (list test then) {.#Right [state (.list (` (.if (, test) (, then) (.list))))]} diff --git a/stdlib/source/library/lux/data/collection/queue.lux b/stdlib/source/library/lux/data/collection/queue.lux index 361690fd7..0420c1954 100644 --- a/stdlib/source/library/lux/data/collection/queue.lux +++ b/stdlib/source/library/lux/data/collection/queue.lux @@ -55,17 +55,17 @@ (All (_ a) (-> (Queue a) (Queue a))) (case (the #front queue) ... Empty... - (pattern (.list)) + (.list) queue ... Front has dried up... - (pattern (.list _)) + (.list _) (|> queue (has #front (list.reversed (the #rear queue))) (has #rear (.list))) ... Consume front! - (pattern (list.partial _ front')) + (list.partial _ front') (|> queue (has #front front')))) diff --git a/stdlib/source/library/lux/data/collection/stream.lux b/stdlib/source/library/lux/data/collection/stream.lux index e0b2088ee..6d9d358e3 100644 --- a/stdlib/source/library/lux/data/collection/stream.lux +++ b/stdlib/source/library/lux/data/collection/stream.lux @@ -129,14 +129,15 @@ (//.pending [wa (disjoint tail)]))))) (def .public pattern - (syntax (_ [patterns (<code>.form (<>.many <code>.any)) - body <code>.any - branches (<>.some <code>.any)]) - (with_symbols [g!stream] - (let [body+ (` (let [(,* (|> patterns - (list#each (function (_ pattern) - (list (` [(, pattern) (, g!stream)]) - (` ((,! //.result) (, g!stream)))))) - list#conjoint))] - (, body)))] - (in (list.partial g!stream body+ branches)))))) + (.pattern + (syntax (_ [patterns (<code>.form (<>.many <code>.any)) + body <code>.any + branches (<>.some <code>.any)]) + (with_symbols [g!stream] + (let [body+ (` (let [(,* (|> patterns + (list#each (function (_ pattern) + (list (` [(, pattern) (, g!stream)]) + (` ((,! //.result) (, g!stream)))))) + list#conjoint))] + (, body)))] + (in (list.partial g!stream body+ branches))))))) diff --git a/stdlib/source/library/lux/data/format/tar.lux b/stdlib/source/library/lux/data/format/tar.lux index 32ec4bdaa..e5924fa6e 100644 --- a/stdlib/source/library/lux/data/format/tar.lux +++ b/stdlib/source/library/lux/data/format/tar.lux @@ -243,7 +243,7 @@ 0 (at utf8.codec encoded "") _ (let [last_char (binary!.bits_8 end string)] (`` (case (.nat last_char) - (pattern (char (,, (static ..null)))) + (char (,, (static ..null))) (again (-- end)) _ @@ -433,7 +433,7 @@ [it <binary>.bits_8] (case (.nat it) (^.with_template [<value> <link_flag>] - [(pattern <value>) + [<value> (in <link_flag>)]) (<options>) diff --git a/stdlib/source/library/lux/data/format/xml.lux b/stdlib/source/library/lux/data/format/xml.lux index 2f1c9b910..3635c56f3 100644 --- a/stdlib/source/library/lux/data/format/xml.lux +++ b/stdlib/source/library/lux/data/format/xml.lux @@ -252,7 +252,7 @@ {#Text value} (sanitize_value value) - (pattern {#Node xml_tag xml_attrs (list {#Text value})}) + {#Node xml_tag xml_attrs (list {#Text value})} (let [tag (..tag xml_tag) attrs (if (dictionary.empty? xml_attrs) "" diff --git a/stdlib/source/library/lux/data/text.lux b/stdlib/source/library/lux/data/text.lux index b9e6d0d07..826afbb44 100644 --- a/stdlib/source/library/lux/data/text.lux +++ b/stdlib/source/library/lux/data/text.lux @@ -188,7 +188,7 @@ (for @.js (these (def defined? (macro (_ tokens lux) (case tokens - (pattern (list it)) + (list it) {.#Right [lux (list (` (.case ("js type-of" ("js constant" (, it))) "undefined" .false @@ -201,7 +201,7 @@ (def if_nashorn (macro (_ tokens lux) (case tokens - (pattern (list then else)) + (list then else) {.#Right [lux (list (if (and (..defined? "java") (..defined? "java.lang") (..defined? "java.lang.Object")) @@ -339,7 +339,7 @@ (def .public (space? char) (-> Char Bit) (with_expansions [<options> (with_template [<char>] - [(pattern (.char (,, (static <char>))))] + [(.char (,, (static <char>)))] [..tab] [..vertical_tab] diff --git a/stdlib/source/library/lux/data/text/escape.lux b/stdlib/source/library/lux/data/text/escape.lux index 6dc9c137f..6041931ff 100644 --- a/stdlib/source/library/lux/data/text/escape.lux +++ b/stdlib/source/library/lux/data/text/escape.lux @@ -74,7 +74,7 @@ (n.> ..ascii_top char) (case char (^.with_template [<char>] - [(pattern (static <char>)) + [(static <char>) true]) ([..\0] [..\a] [..\b] [..\t] [..\n] [..\v] [..\f] [..\r] @@ -119,7 +119,7 @@ (if (n.< limit offset) (case ("lux text char" offset current) (^.with_template [<char> <replacement>] - [(pattern (static <char>)) + [(static <char>) (let [[previous' current' limit'] (ascii_escaped <replacement> offset limit previous current)] (again 0 previous' current' limit'))]) ([..\0 ..escaped_\0] @@ -202,12 +202,12 @@ limit ("lux text size" text)]) (if (n.< limit offset) (case ("lux text char" offset current) - (pattern (static ..sigil_char)) + (static ..sigil_char) (let [@sigil (++ offset)] (if (n.< limit @sigil) (case ("lux text char" @sigil current) (^.with_template [<sigil> <un_escaped>] - [(pattern (static <sigil>)) + [(static <sigil>) (let [[previous' current' limit'] (..ascii_un_escaped <un_escaped> offset previous current limit)] (again 0 previous' current' limit'))]) ([..\0_sigil //.\0] @@ -221,7 +221,7 @@ [..\''_sigil //.\''] [..\\_sigil ..sigil]) - (pattern (static ..\u_sigil)) + (static ..\u_sigil) (let [@unicode (n.+ code_size @sigil)] (if (n.< limit @unicode) (do try.monad diff --git a/stdlib/source/library/lux/data/text/regex.lux b/stdlib/source/library/lux/data/text/regex.lux index c78edc826..9492101c6 100644 --- a/stdlib/source/library/lux/data/text/regex.lux +++ b/stdlib/source/library/lux/data/text/regex.lux @@ -429,12 +429,13 @@ (in (list regex)))))) (def .public pattern - (syntax (_ [[pattern bindings] (<code>.form (<>.and <code>.text (<>.maybe <code>.any))) - body <code>.any - branches (<>.many <code>.any)]) - (with_symbols [g!temp] - (in (list.partial (` (^.multi (, g!temp) - [((,! <text>.result) (..regex (, (code.text pattern))) (, g!temp)) - {try.#Success (, (maybe.else g!temp bindings))}])) - body - branches))))) + (.pattern + (syntax (_ [[pattern bindings] (<code>.form (<>.and <code>.text (<>.maybe <code>.any))) + body <code>.any + branches (<>.many <code>.any)]) + (with_symbols [g!temp] + (in (list.partial (` (^.multi (, g!temp) + [((,! <text>.result) (..regex (, (code.text pattern))) (, g!temp)) + {try.#Success (, (maybe.else g!temp bindings))}])) + body + branches)))))) diff --git a/stdlib/source/library/lux/documentation.lux b/stdlib/source/library/lux/documentation.lux index eb030edec..8159c5ed4 100644 --- a/stdlib/source/library/lux/documentation.lux +++ b/stdlib/source/library/lux/documentation.lux @@ -271,10 +271,10 @@ ([.#UnivQ "All" type.flat_univ_q] [.#ExQ "Ex" type.flat_ex_q]) - (pattern {.#Apply (|recursion_dummy|) {.#Parameter 0}}) + {.#Apply (|recursion_dummy|) {.#Parameter 0}} type_function_name - (pattern {.#Apply (|recursion_dummy|) {.#UnivQ _ body}}) + {.#Apply (|recursion_dummy|) {.#UnivQ _ body}} (format "(Rec " type_function_name \n (nested " " (%type' level type_function_name nestable? module body)) ")") @@ -316,7 +316,7 @@ (def (type_definition' nestable? level arity type_function_info tags module type) (-> Bit Nat Nat [Text (List Text)] (List Text) Text Type Text) (case tags - (pattern (list single_tag)) + (list single_tag) (format "(Record" \n " [#" single_tag " " (type_definition' false level arity type_function_info {.#None} module type) "])") @@ -406,10 +406,10 @@ [.#ExQ "Ex" type.flat_ex_q]) ... Recursive call - (pattern {.#Apply (|recursion_dummy|) {.#Parameter 0}}) + {.#Apply (|recursion_dummy|) {.#Parameter 0}} (product.left type_function_info) - (pattern {.#Apply (|recursion_dummy|) {.#UnivQ _ body}}) + {.#Apply (|recursion_dummy|) {.#UnivQ _ body}} (|> (type_definition' nestable? level arity type_function_info tags module body) (text.all_split_by \n) (list#each (text.prefix " ")) diff --git a/stdlib/source/library/lux/ffi.lux b/stdlib/source/library/lux/ffi.lux index e204a0a4c..f145b56cb 100644 --- a/stdlib/source/library/lux/ffi.lux +++ b/stdlib/source/library/lux/ffi.lux @@ -722,7 +722,7 @@ (.function (_ state) (let [<bindings> [name phase archive state]] (case inputs - (pattern <inputs>) + <inputs> <body> _ @@ -782,10 +782,10 @@ (def (pairs it) (All (_ a) (-> (List a) (List [a a]))) (case it - (pattern (list.partial left right tail)) + (list.partial left right tail) (list.partial [left right] (pairs tail)) - (pattern (list)) + (list) (list) _ @@ -798,7 +798,7 @@ [[state output] (monad.mix ! (.function (_ [key value] [state output]) (case key - (pattern (text_synthesis key)) + (text_synthesis key) (do try.monad [[state value] (phase archive value state)] (in [state (list.partial [key value] output)])) diff --git a/stdlib/source/library/lux/ffi.old.lux b/stdlib/source/library/lux/ffi.old.lux index 802c3ba9a..99158d8a9 100644 --- a/stdlib/source/library/lux/ffi.old.lux +++ b/stdlib/source/library/lux/ffi.old.lux @@ -1644,7 +1644,7 @@ size <code>.any]) (case type (^.with_template [<type> <array_op>] - [(pattern {#GenericClass <type> (list)}) + [{#GenericClass <type> (list)} (in (list (` (<array_op> (, size)))))]) (["boolean" "jvm znewarray"] ["byte" "jvm bnewarray"] diff --git a/stdlib/source/library/lux/math.lux b/stdlib/source/library/lux/math.lux index 2bda65168..eac02fe80 100644 --- a/stdlib/source/library/lux/math.lux +++ b/stdlib/source/library/lux/math.lux @@ -83,10 +83,10 @@ _ (type.inference :it:) :it: (type.check (check.identity (list) $it))] (case (list.reversed operands) - (pattern (list single)) + (list single) (in single) - (pattern (list)) + (list) (`` (cond (check.subsumes? .I64 :it:) (phase.except ..no_arithmetic_for [:it:]) @@ -99,7 +99,7 @@ ... else (phase.except ..no_arithmetic_for [:it:]))) - (pattern (list.partial last prevs)) + (list.partial last prevs) (`` (cond (check.subsumes? .I64 :it:) (phase.except ..no_arithmetic_for [:it:]) diff --git a/stdlib/source/library/lux/math/number/frac.lux b/stdlib/source/library/lux/math/number/frac.lux index f4048ebc8..4601d9ffa 100644 --- a/stdlib/source/library/lux/math/number/frac.lux +++ b/stdlib/source/library/lux/math/number/frac.lux @@ -720,13 +720,13 @@ (case [(is Nat (..exponent it)) (is Nat (..mantissa it)) (is Nat (..sign it))] - (pattern [(static ..special_exponent_bits) 0 0]) + [(static ..special_exponent_bits) 0 0] ..positive_infinity - (pattern [(static ..special_exponent_bits) 0 1]) + [(static ..special_exponent_bits) 0 1] ..negative_infinity - (pattern [(static ..special_exponent_bits) _ _]) + [(static ..special_exponent_bits) _ _] ..not_a_number ... Positive zero diff --git a/stdlib/source/library/lux/math/number/int.lux b/stdlib/source/library/lux/math/number/int.lux index 33c82109e..3eb21d465 100644 --- a/stdlib/source/library/lux/math/number/int.lux +++ b/stdlib/source/library/lux/math/number/int.lux @@ -221,13 +221,13 @@ (let [input_size ("lux text size" repr)] (if (//nat.> 1 input_size) (case ("lux text clip" 0 1 repr) - (pattern (static ..+sign)) + (static ..+sign) (|> repr ("lux text clip" 1 (-- input_size)) (at <codec> decoded) (at try.functor each (|>> .int))) - (pattern (static ..-sign)) + (static ..-sign) (|> repr ("lux text clip" 1 (-- input_size)) (at <codec> decoded) diff --git a/stdlib/source/library/lux/math/number/nat.lux b/stdlib/source/library/lux/math/number/nat.lux index 5f63ffb78..75bf0fe2b 100644 --- a/stdlib/source/library/lux/math/number/nat.lux +++ b/stdlib/source/library/lux/math/number/nat.lux @@ -191,8 +191,8 @@ (def (binary_value digit) (-> Nat (Maybe Nat)) (case digit - (pattern (char "0")) {.#Some 0} - (pattern (char "1")) {.#Some 1} + (char "0") {.#Some 0} + (char "1") {.#Some 1} _ {.#None})) (def (octal_character value) @@ -211,14 +211,14 @@ (def (octal_value digit) (-> Nat (Maybe Nat)) (case digit - (pattern (char "0")) {.#Some 0} - (pattern (char "1")) {.#Some 1} - (pattern (char "2")) {.#Some 2} - (pattern (char "3")) {.#Some 3} - (pattern (char "4")) {.#Some 4} - (pattern (char "5")) {.#Some 5} - (pattern (char "6")) {.#Some 6} - (pattern (char "7")) {.#Some 7} + (char "0") {.#Some 0} + (char "1") {.#Some 1} + (char "2") {.#Some 2} + (char "3") {.#Some 3} + (char "4") {.#Some 4} + (char "5") {.#Some 5} + (char "6") {.#Some 6} + (char "7") {.#Some 7} _ {.#None})) (def (decimal_character value) @@ -239,16 +239,16 @@ (def (decimal_value digit) (-> Nat (Maybe Nat)) (case digit - (pattern (char "0")) {.#Some 0} - (pattern (char "1")) {.#Some 1} - (pattern (char "2")) {.#Some 2} - (pattern (char "3")) {.#Some 3} - (pattern (char "4")) {.#Some 4} - (pattern (char "5")) {.#Some 5} - (pattern (char "6")) {.#Some 6} - (pattern (char "7")) {.#Some 7} - (pattern (char "8")) {.#Some 8} - (pattern (char "9")) {.#Some 9} + (char "0") {.#Some 0} + (char "1") {.#Some 1} + (char "2") {.#Some 2} + (char "3") {.#Some 3} + (char "4") {.#Some 4} + (char "5") {.#Some 5} + (char "6") {.#Some 6} + (char "7") {.#Some 7} + (char "8") {.#Some 8} + (char "9") {.#Some 9} _ {.#None})) (def (hexadecimal_character value) @@ -276,12 +276,15 @@ (-> Nat (Maybe Nat)) (case digit (^.with_template [<character> <number>] - [(pattern (char <character>)) {.#Some <number>}]) + [(char <character>) + {.#Some <number>}]) (["0" 0] ["1" 1] ["2" 2] ["3" 3] ["4" 4] ["5" 5] ["6" 6] ["7" 7] ["8" 8] ["9" 9]) (^.with_template [<lower> <upper> <number>] - [(^.or (pattern (char <lower>)) (pattern (char <upper>))) {.#Some <number>}]) + [(^.or (char <lower>) + (char <upper>)) + {.#Some <number>}]) (["a" "A" 10] ["b" "B" 11] ["c" "C" 12] ["d" "D" 13] ["e" "E" 14] ["f" "F" 15]) _ {.#None})) diff --git a/stdlib/source/library/lux/math/number/rev.lux b/stdlib/source/library/lux/math/number/rev.lux index 03e8e9684..1d164f539 100644 --- a/stdlib/source/library/lux/math/number/rev.lux +++ b/stdlib/source/library/lux/math/number/rev.lux @@ -249,7 +249,7 @@ (let [repr_size ("lux text size" repr)] (if (//nat.> 1 repr_size) (case ("lux text char" 0 repr) - (pattern (char ".")) + (char ".") (case (at <codec> decoded (..decimals repr)) {try.#Success output} {try.#Success (.rev output)} diff --git a/stdlib/source/library/lux/meta/macro.lux b/stdlib/source/library/lux/meta/macro.lux index 86e9fe57d..464329a25 100644 --- a/stdlib/source/library/lux/meta/macro.lux +++ b/stdlib/source/library/lux/meta/macro.lux @@ -116,7 +116,7 @@ (def .public with_symbols (.macro (_ tokens) (case tokens - (pattern (list [_ {.#Tuple symbols}] body)) + (list [_ {.#Tuple symbols}] body) (do [! //.monad] [symbol_names (monad.each ! ..local symbols) .let [symbol_defs (list#conjoint (list#each (is (-> Text (List Code)) @@ -134,7 +134,7 @@ (do //.monad [token+ (..expansion token)] (case token+ - (pattern (list token')) + (list token') (in token') _ @@ -148,11 +148,11 @@ macro_name [module short]] (case (is (Maybe [Bit Code]) (case tokens - (pattern (list [_ {.#Text "omit"}] - token)) + (list [_ {.#Text "omit"}] + token) {.#Some [#1 token]} - (pattern (list token)) + (list token) {.#Some [#0 token]} _ @@ -180,7 +180,7 @@ (def .public times (.macro (_ tokens) (case tokens - (pattern (list.partial [_ {.#Nat times}] terms)) + (list.partial [_ {.#Nat times}] terms) (loop (again [times times before terms]) (case times diff --git a/stdlib/source/library/lux/meta/macro/pattern.lux b/stdlib/source/library/lux/meta/macro/pattern.lux index affa8273a..7e3b30d9d 100644 --- a/stdlib/source/library/lux/meta/macro/pattern.lux +++ b/stdlib/source/library/lux/meta/macro/pattern.lux @@ -2,14 +2,14 @@ [library [lux (.except or let with_template |> `)]]) -(def partial_list - (`` ("lux in-module" (,, (static .prelude)) .partial_list))) +(def list#partial + (`` ("lux in-module" (,, (static .prelude)) .list#partial))) (def locally (macro (_ tokens lux) (.let [[prelude _] (symbol ._)] (case tokens - (pattern (list [@ {.#Symbol ["" name]}])) + (list [@ {.#Symbol ["" name]}]) {.#Right [lux (list (.` ("lux in-module" (, [@ {.#Text prelude}]) (, [@ {.#Symbol [prelude name]}]))))]} @@ -73,107 +73,112 @@ ) (def .public or - (macro (_ tokens) - (case tokens - (pattern (partial_list [_ {.#Form patterns}] body branches)) - (case patterns - {.#End} - (failure (..wrong_syntax_error (symbol ..or))) - - _ - (.let [pairs (.|> patterns - (list#each (function (_ pattern) (list pattern body))) - list#conjoint)] - (meta#in (list#composite pairs branches)))) - _ - (failure (..wrong_syntax_error (symbol ..or)))))) + (pattern + (macro (_ tokens) + (case tokens + (list#partial [_ {.#Form patterns}] body branches) + (case patterns + {.#End} + (failure (..wrong_syntax_error (symbol ..or))) + + _ + (.let [pairs (.|> patterns + (list#each (function (_ pattern) (list pattern body))) + list#conjoint)] + (meta#in (list#composite pairs branches)))) + _ + (failure (..wrong_syntax_error (symbol ..or))))))) (def .public with_template - (macro (_ tokens) - (case tokens - (pattern (partial_list [_ {.#Form (list [_ {.#Tuple bindings}] - [_ {.#Tuple templates}])}] - [_ {.#Form data}] - branches)) - (case (is (Maybe (List Code)) - (do maybe#monad - [bindings' (monad#each maybe#monad symbol_short bindings) - data' (monad#each maybe#monad tuple_list data)] - (.let [num_bindings (list#size bindings')] - (if (every? (|>> ("lux i64 =" num_bindings)) - (list#each list#size data')) - (.let [apply (is (-> Replacement_Environment (List Code)) - (function (_ env) (list#each (realized_template env) templates)))] - (.|> data' - (list#each (function#composite apply (replacement_environment bindings'))) - list#conjoint - in)) - {.#None})))) - {.#Some output} - (meta#in (list#composite output branches)) - - {.#None} - (failure (..wrong_syntax_error (symbol ..with_template)))) - - _ - (failure (..wrong_syntax_error (symbol ..with_template)))))) + (pattern + (macro (_ tokens) + (case tokens + (list#partial [_ {.#Form (list [_ {.#Tuple bindings}] + [_ {.#Tuple templates}])}] + [_ {.#Form data}] + branches) + (case (is (Maybe (List Code)) + (do maybe#monad + [bindings' (monad#each maybe#monad symbol_short bindings) + data' (monad#each maybe#monad tuple_list data)] + (.let [num_bindings (list#size bindings')] + (if (every? (|>> ("lux i64 =" num_bindings)) + (list#each list#size data')) + (.let [apply (is (-> Replacement_Environment (List Code)) + (function (_ env) (list#each (realized_template env) templates)))] + (.|> data' + (list#each (function#composite apply (replacement_environment bindings'))) + list#conjoint + in)) + {.#None})))) + {.#Some output} + (meta#in (list#composite output branches)) + + {.#None} + (failure (..wrong_syntax_error (symbol ..with_template)))) + + _ + (failure (..wrong_syntax_error (symbol ..with_template))))))) (def .public multi - (macro (_ tokens) - (case tokens - (pattern (partial_list [_meta {.#Form levels}] body next_branches)) - (do meta#monad - [mlc (multi_level_case^ levels) - .let [initial_bind? (case mlc - [[_ {.#Symbol _}] _] - #1 - - _ - #0)] - expected ..expected_type - g!temp (..generated_symbol "temp")] - (in (list g!temp - (.` ({{.#Some (, g!temp)} - (, g!temp) - - {.#None} - (.case (, g!temp) - (,* next_branches))} - ("lux type check" {.#Apply (, (type_code expected)) Maybe} - (.case (, g!temp) - (,* (multi_level_case$ g!temp [mlc body])) - - (,* (if initial_bind? - (list) - (list g!temp (.` {.#None}))))))))))) - - _ - (failure (..wrong_syntax_error (symbol ..multi)))))) + (pattern + (macro (_ tokens) + (case tokens + (list#partial [_meta {.#Form levels}] body next_branches) + (do meta#monad + [mlc (multi_level_case^ levels) + .let [initial_bind? (case mlc + [[_ {.#Symbol _}] _] + #1 + + _ + #0)] + expected ..expected_type + g!temp (..generated_symbol "temp")] + (in (list g!temp + (.` ({{.#Some (, g!temp)} + (, g!temp) + + {.#None} + (.case (, g!temp) + (,* next_branches))} + ("lux type check" {.#Apply (, (type_code expected)) Maybe} + (.case (, g!temp) + (,* (multi_level_case$ g!temp [mlc body])) + + (,* (if initial_bind? + (list) + (list g!temp (.` {.#None}))))))))))) + + _ + (failure (..wrong_syntax_error (symbol ..multi))))))) (def .public let - (macro (_ tokens) - (case tokens - (pattern (partial_list [_meta {.#Form (list [_ {.#Symbol ["" name]}] pattern)}] body branches)) - (.let [g!whole (local$ name)] - (meta#in (partial_list g!whole - (.` (case (, g!whole) (, pattern) (, body))) - branches))) - - _ - (failure (..wrong_syntax_error (symbol ..let)))))) + (pattern + (macro (_ tokens) + (case tokens + (list#partial [_meta {.#Form (list [_ {.#Symbol ["" name]}] pattern)}] body branches) + (.let [g!whole (local$ name)] + (meta#in (list#partial g!whole + (.` (case (, g!whole) (, pattern) (, body))) + branches))) + + _ + (failure (..wrong_syntax_error (symbol ..let))))))) (def .public |> - (macro (_ tokens) - (case tokens - (pattern (partial_list [_meta {.#Form (list [_ {.#Symbol ["" name]}] [_ {.#Tuple steps}])}] body branches)) - (.let [g!name (local$ name)] - (meta#in (partial_list g!name - (.` (.let [(, g!name) (.|> (, g!name) (,* steps))] - (, body))) - branches))) - - _ - (failure (..wrong_syntax_error (symbol ..|>)))))) + (pattern + (macro (_ tokens) + (case tokens + (list#partial [_meta {.#Form (list [_ {.#Symbol ["" name]}] [_ {.#Tuple steps}])}] body branches) + (.let [g!name (local$ name)] + (meta#in (list#partial g!name + (.` (.let [(, g!name) (.|> (, g!name) (,* steps))] + (, body))) + branches))) + + _ + (failure (..wrong_syntax_error (symbol ..|>))))))) (def (name$ [module name]) (-> Symbol Code) @@ -240,17 +245,18 @@ ))) (def .public ` - (macro (_ tokens) - (case tokens - (pattern (partial_list [_meta {.#Form (list template)}] body branches)) - (do meta#monad - [pattern (untemplated_pattern template)] - (in (partial_list pattern body branches))) - - (pattern (list template)) - (do meta#monad - [pattern (untemplated_pattern template)] - (in (list pattern))) - - _ - (failure (..wrong_syntax_error (symbol ..`)))))) + (pattern + (macro (_ tokens) + (case tokens + (list#partial [_meta {.#Form (list template)}] body branches) + (do meta#monad + [pattern (untemplated_pattern template)] + (in (list#partial pattern body branches))) + + (list template) + (do meta#monad + [pattern (untemplated_pattern template)] + (in (list pattern))) + + _ + (failure (..wrong_syntax_error (symbol ..`))))))) diff --git a/stdlib/source/library/lux/meta/symbol.lux b/stdlib/source/library/lux/meta/symbol.lux index cea58ae51..e46516bb9 100644 --- a/stdlib/source/library/lux/meta/symbol.lux +++ b/stdlib/source/library/lux/meta/symbol.lux @@ -52,10 +52,10 @@ (def (decoded input) (case (text.all_split_by ..separator input) - (pattern (list short)) + (list short) {.#Right ["" short]} - (pattern (list module short)) + (list module short) {.#Right [module short]} _ diff --git a/stdlib/source/library/lux/meta/type.lux b/stdlib/source/library/lux/meta/type.lux index 1664ce98a..e71bafc42 100644 --- a/stdlib/source/library/lux/meta/type.lux +++ b/stdlib/source/library/lux/meta/type.lux @@ -367,7 +367,7 @@ (def .public (flat_array type) (-> Type [Nat Type]) (case type - (^.multi (pattern {.#Primitive name (list element_type)}) + (^.multi {.#Primitive name (list element_type)} (text#= array.type_name name)) (.let [[depth element_type] (flat_array element_type)] [(++ depth) element_type]) diff --git a/stdlib/source/library/lux/meta/type/check.lux b/stdlib/source/library/lux/meta/type/check.lux index 60c1f0e5c..a08d36625 100644 --- a/stdlib/source/library/lux/meta/type/check.lux +++ b/stdlib/source/library/lux/meta/type/check.lux @@ -388,20 +388,20 @@ (do [! ..monad] [ring (..ring' @)] (case ring - (pattern (list)) + (list) (in []) - (pattern (list @me)) + (list @me) (erase! @me) - (pattern (list @other @me)) + (list @other @me) (do ! [_ (re_bind' {.#None} @other)] (erase! @me)) - (pattern (list.partial @prev _)) + (list.partial @prev _) (case (list.reversed ring) - (pattern (list.partial @me @next _)) + (list.partial @me @next _) (do ! [_ (re_bind {.#Var @next} @prev) _ (re_bind {.#Var @prev} @next)] @@ -795,7 +795,7 @@ {.#Var @it} (case aliases - (pattern (list)) + (list) (do ..monad [?actualT (..peek @it)] (case ?actualT diff --git a/stdlib/source/library/lux/target/jvm/reflection.lux b/stdlib/source/library/lux/target/jvm/reflection.lux index 45a33bb52..2f7ca93ae 100644 --- a/stdlib/source/library/lux/target/jvm/reflection.lux +++ b/stdlib/source/library/lux/target/jvm/reflection.lux @@ -290,7 +290,7 @@ (def .public (correspond class type) (-> (java/lang/Class java/lang/Object) Type (Try Mapping)) (case type - (pattern {.#Primitive (static array.type_name) (list :member:)}) + {.#Primitive (static array.type_name) (list :member:)} (if (java/lang/Class::isArray class) (correspond (java/lang/Class::getComponentType class) :member:) diff --git a/stdlib/source/library/lux/time/day.lux b/stdlib/source/library/lux/time/day.lux index f50c79af1..10c0a6498 100644 --- a/stdlib/source/library/lux/time/day.lux +++ b/stdlib/source/library/lux/time/day.lux @@ -115,7 +115,7 @@ (def (decoded value) (case (text#composite "#" value) (^.with_template [<tag>] - [(pattern (template.text [<tag>])) + [(template.text [<tag>]) {try.#Success {<tag>}}]) ([..#Monday] [..#Tuesday] diff --git a/stdlib/source/library/lux/time/month.lux b/stdlib/source/library/lux/time/month.lux index 385106ea5..85f40252c 100644 --- a/stdlib/source/library/lux/time/month.lux +++ b/stdlib/source/library/lux/time/month.lux @@ -235,7 +235,7 @@ (def (decoded value) (case (text#composite "#" value) (^.with_template [<tag>] - [(pattern (template.text [<tag>])) + [(template.text [<tag>]) {try.#Success {<tag>}}]) ([..#January] [..#February] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/analysis.lux b/stdlib/source/library/lux/tool/compiler/language/lux/analysis.lux index 2442874a0..b975614df 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/analysis.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/analysis.lux @@ -1,6 +1,6 @@ (.require [library - [lux (.except Tuple Variant nat int rev case local except) + [lux (.except Tuple Variant Pattern nat int rev case local except) [abstract [equivalence (.only Equivalence)] [hash (.only Hash)] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/coverage.lux b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/coverage.lux index aefb5abc7..dd5fde4f2 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/coverage.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/coverage.lux @@ -1,6 +1,6 @@ (.require [library - [lux (.except Variant) + [lux (.except Variant Pattern) [abstract [equivalence (.except)] ["[0]" monad (.only do)]] @@ -191,7 +191,8 @@ ... their sub-patterns. {//pattern.#Complex {//complex.#Tuple membersP+}} (case (list.reversed membersP+) - (^.or (pattern (list)) (pattern (list _))) + (^.or (list) + (list _)) (exception.except ..invalid_tuple [(list.size membersP+)]) {.#Item lastP prevsP+} diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/inference.lux b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/inference.lux index d25fb1f8a..f91c4a145 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/inference.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/inference.lux @@ -161,7 +161,7 @@ [[just_before vars :inference: terms] (general' (list) archive analyse inferT args)] (in [:inference: terms]) ... (case vars - ... (pattern (list)) + ... (list) ... (in [:inference: terms]) ... _ 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 2e2982214..9a5de364f 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 @@ -49,7 +49,7 @@ (do meta.monad [expansion (..expansion expander name macro inputs)] (case expansion - (pattern (list single)) + (list single) (in single) _ diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/pattern.lux b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/pattern.lux index 52c5de8fc..daf608222 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/pattern.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/pattern.lux @@ -1,6 +1,6 @@ (.require [library - [lux (.except nat int rev) + [lux (.except Pattern nat int rev) [abstract [equivalence (.only Equivalence)]] [data 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 594626581..30e4a1360 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 @@ -44,7 +44,7 @@ (template (_ analysis archive tag values) ... (-> Phase Archive Symbol (List Code) (Operation Analysis)) [(case values - (pattern (list value)) + (list value) (/complex.variant analysis tag archive value) _ @@ -54,7 +54,7 @@ (template (_ analysis archive lefts right? values) ... (-> Phase Archive Nat Bit (List Code) (Operation Analysis)) [(case values - (pattern (list value)) + (list value) (/complex.sum analysis lefts right? archive value) _ @@ -77,7 +77,7 @@ [[functionT functionA] (/type.inferring (analysis archive functionC))] (case functionA - (pattern (/.constant def_name)) + (/.constant def_name) (do ! [?macro (//extension.lifted (meta.macro def_name))] (case ?macro 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 65d951e0a..6356d32c5 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 @@ -1,6 +1,6 @@ (.require [library - [lux (.except case) + [lux (.except Pattern case) [abstract ["[0]" monad (.only do)]] [control @@ -246,7 +246,7 @@ [Text {.#Text pattern_value} {/simple.#Text pattern_value}] [Any {.#Tuple {.#End}} {/simple.#Unit}]) - (pattern [location {.#Tuple (list singleton)}]) + [location {.#Tuple (list singleton)}] (pattern_analysis {.#None} :input: singleton next) [location {.#Tuple sub_patterns}] @@ -274,7 +274,7 @@ _ (in []))] (.case members - (pattern (list singleton)) + (list singleton) (pattern_analysis {.#None} :input: singleton next) _ @@ -283,7 +283,7 @@ {.#None} (..tuple_pattern_analysis pattern_analysis :input: sub_patterns next)))) - (pattern [location {.#Variant (list.partial [_ {.#Nat lefts}] [_ {.#Bit right?}] values)}]) + [location {.#Variant (list.partial [_ {.#Nat lefts}] [_ {.#Bit right?}] values)}] (/.with_location location (do ///.monad [[@ex_var+ :input:'] (/type.check (..tuple :input:))] @@ -324,7 +324,7 @@ _ (/.except ..mismatch [:input:' pattern])))) - (pattern [location {.#Variant (list.partial [_ {.#Symbol tag}] values)}]) + [location {.#Variant (list.partial [_ {.#Symbol tag}] values)}] (/.with_location location (do ///.monad [tag (///extension.lifted (meta.normal tag)) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/complex.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/complex.lux index 2ee8cae7d..d7b26aa8f 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/complex.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/complex.lux @@ -294,14 +294,14 @@ output (is (List [Symbol Code]) {.#End})]) (case input - (pattern (list.partial [_ {.#Symbol ["" slotH]}] valueH tail)) + (list.partial [_ {.#Symbol ["" slotH]}] valueH tail) (if pattern_matching? (///#in {.#None}) (do ///.monad [slotH (///extension.lifted (meta.normal ["" slotH]))] (again tail {.#Item [slotH valueH] output}))) - (pattern (list.partial [_ {.#Symbol slotH}] valueH tail)) + (list.partial [_ {.#Symbol slotH}] valueH tail) (do ///.monad [slotH (///extension.lifted (meta.normal slotH))] (again tail {.#Item [slotH valueH] output})) @@ -386,13 +386,13 @@ (def .public (record analyse archive members) (-> Phase Archive (List Code) (Operation Analysis)) (case members - (pattern (list)) + (list) //simple.unit - (pattern (list singletonC)) + (list singletonC) (analyse archive singletonC) - (pattern (list [_ {.#Symbol pseudo_slot}] singletonC)) + (list [_ {.#Symbol pseudo_slot}] singletonC) (do [! ///.monad] [head_k (///extension.lifted (meta.normal pseudo_slot)) slot (///extension.lifted (meta.try (meta.slot head_k)))] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/declaration.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/declaration.lux index 806308519..86602280e 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/declaration.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/declaration.lux @@ -90,17 +90,17 @@ extension_eval (as Eval (wrapper (as_expected compiler_eval)))] _ (//.with (has [//extension.#state /.#analysis /.#state //extension.#state .#eval] extension_eval state))] (case code - (pattern [_ {.#Form (list.partial [_ {.#Text name}] inputs)}]) + [_ {.#Form (list.partial [_ {.#Text name}] inputs)}] (//extension.apply archive again [name inputs]) - (pattern [_ {.#Form (list.partial macro inputs)}]) + [_ {.#Form (list.partial macro inputs)}] (do ! [expansion (/.lifted_analysis (do ! [macroA (<| (///analysis/type.expecting Macro) (analysis archive macro))] (case macroA - (pattern (///analysis.constant macro_name)) + (///analysis.constant macro_name) (do ! [?macro (//extension.lifted (meta.macro macro_name)) macro (case ?macro @@ -114,7 +114,7 @@ _ (//.except ..invalid_macro_call code))))] (case expansion - (pattern (list.partial <lux_def_module> referrals)) + (list.partial <lux_def_module> referrals) (|> (again archive <lux_def_module>) (at ! each (revised /.#referrals (list#composite referrals)))) 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 39dc0ac97..eb88d937f 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 @@ -410,7 +410,7 @@ {.#None} (/////analysis.except ..non_jvm_type luxT)) - (pattern (lux_array_type elemT _)) + (lux_array_type elemT _) (phase#each jvm.array (jvm_type elemT)) {.#Primitive class parametersT} @@ -461,7 +461,7 @@ (-> (Type Primitive) Handler) (function (_ extension_name analyse archive args) (case args - (pattern (list arrayC)) + (list arrayC) (do phase.monad [_ (typeA.inference ..int) arrayA (<| (typeA.expecting {.#Primitive (|> (jvm.array primitive_type) @@ -477,7 +477,7 @@ Handler (function (_ extension_name analyse archive args) (case args - (pattern (list arrayC)) + (list arrayC) (<| typeA.with_var (function (_ [@read :read:])) typeA.with_var @@ -499,7 +499,7 @@ (-> (Type Primitive) Handler) (function (_ extension_name analyse archive args) (case args - (pattern (list lengthC)) + (list lengthC) (do phase.monad [lengthA (<| (typeA.expecting ..int) (analyse archive lengthC)) @@ -514,7 +514,7 @@ Handler (function (_ extension_name analyse archive args) (case args - (pattern (list lengthC)) + (list lengthC) (do phase.monad [lengthA (<| (typeA.expecting ..int) (analyse archive lengthC)) @@ -535,7 +535,7 @@ (def (check_parameter objectT) (-> .Type (Operation (Type Parameter))) (case objectT - (pattern (lux_array_type elementT _)) + (lux_array_type elementT _) (/////analysis.except ..non_parameter objectT) {.#Primitive name parameters} @@ -631,7 +631,7 @@ ... else (phase#in (jvm.class name (list))))) - (pattern (lux_array_type elementT _)) + (lux_array_type elementT _) (|> elementT check_jvm (phase#each jvm.array)) @@ -698,7 +698,7 @@ (-> .Type (Type Primitive) Handler) (function (_ extension_name analyse archive args) (case args - (pattern (list idxC arrayC)) + (list idxC arrayC) (do phase.monad [_ (typeA.inference lux_type) idxA (<| (typeA.expecting ..int) @@ -715,7 +715,7 @@ Handler (function (_ extension_name analyse archive args) (case args - (pattern (list idxC arrayC)) + (list idxC arrayC) (<| typeA.with_var (function (_ [@read :read:])) typeA.with_var @@ -742,7 +742,7 @@ (list)}] (function (_ extension_name analyse archive args) (case args - (pattern (list idxC valueC arrayC)) + (list idxC valueC arrayC) (do phase.monad [_ (typeA.inference array_type) idxA (<| (typeA.expecting ..int) @@ -762,7 +762,7 @@ Handler (function (_ extension_name analyse archive args) (case args - (pattern (list idxC valueC arrayC)) + (list idxC valueC arrayC) (<| typeA.with_var (function (_ [@read :read:])) typeA.with_var @@ -840,7 +840,7 @@ Handler (function (_ extension_name analyse archive args) (case args - (pattern (list)) + (list) (do phase.monad [expectedT (///.lifted meta.expected_type) [_ :object:] (check_object expectedT) @@ -854,7 +854,7 @@ Handler (function (_ extension_name analyse archive args) (case args - (pattern (list objectC)) + (list objectC) (do phase.monad [_ (typeA.inference .Bit) [objectT objectA] (typeA.inferring @@ -869,7 +869,7 @@ Handler (function (_ extension_name analyse archive args) (case args - (pattern (list monitorC exprC)) + (list monitorC exprC) (do phase.monad [[monitorT monitorA] (typeA.inferring (analyse archive monitorC)) @@ -884,7 +884,7 @@ (-> java/lang/ClassLoader Handler) (function (_ extension_name analyse archive args) (case args - (pattern (list exceptionC)) + (list exceptionC) (do phase.monad [_ (typeA.inference Nothing) [exceptionT exceptionA] (typeA.inferring @@ -904,7 +904,7 @@ (-> java/lang/ClassLoader Handler) (function (_ extension_name analyse archive args) (case args - (pattern (list classC)) + (list classC) (case classC [_ {.#Text class}] (do phase.monad @@ -961,7 +961,7 @@ (def (inheritance_candidate_parents class_loader fromT target_class toT fromC) (-> java/lang/ClassLoader .Type (java/lang/Class java/lang/Object) .Type Code (Operation (List [[Text .Type] Bit]))) (case fromT - (pattern {.#Primitive _ (list.partial self_classT super_classT super_interfacesT+)}) + {.#Primitive _ (list.partial self_classT super_classT super_interfacesT+)} (monad.each phase.monad (function (_ superT) (do [! phase.monad] @@ -978,7 +978,7 @@ (-> java/lang/ClassLoader Handler) (function (_ extension_name analyse archive args) (case args - (pattern (list fromC)) + (list fromC) (do [! phase.monad] [toT (///.lifted meta.expected_type) target_name (at ! each ..reflection (check_jvm toT)) 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 367240a34..005ecde81 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 @@ -139,7 +139,7 @@ Handler (function (_ extension_name analyse archive args) (case args - (pattern (list opC)) + (list opC) (<| typeA.with_var (function (_ [@var :var:])) (do [! ////.monad] @@ -156,7 +156,7 @@ Handler (function (_ extension_name analyse archive argsC+) (case argsC+ - (pattern (list [_ {.#Text module_name}] exprC)) + (list [_ {.#Text module_name}] exprC) (////analysis.with_current_module module_name (analyse archive exprC)) @@ -167,7 +167,7 @@ (-> Eval Handler) (function (_ extension_name analyse archive args) (case args - (pattern (list typeC valueC)) + (list typeC valueC) (do [! ////.monad] [actualT (at ! each (|>> (as Type)) (eval archive Type typeC)) @@ -182,7 +182,7 @@ (-> Eval Handler) (function (_ extension_name analyse archive args) (case args - (pattern (list typeC valueC)) + (list typeC valueC) (do [! ////.monad] [actualT (at ! each (|>> (as Type)) (eval archive Type typeC)) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/declaration/lux.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/declaration/lux.lux index 8c5f5dbc8..c992c73a8 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/declaration/lux.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/declaration/lux.lux @@ -127,7 +127,7 @@ [interim_artifacts codeG] (/////generation.with_interim_artifacts archive (generate archive codeS)) .let [@abstraction (case codeS - (pattern (/////synthesis.function/abstraction [env arity body])) + (/////synthesis.function/abstraction [env arity body]) (|> interim_artifacts list.last (maybe#each (|>> [arity]))) @@ -246,7 +246,7 @@ (-> Expander /////analysis.Bundle Handler) (function (_ extension_name phase archive inputsC+) (case inputsC+ - (pattern (list [_ {.#Symbol ["" short_name]}] valueC exported?C)) + (list [_ {.#Symbol ["" short_name]}] valueC exported?C) (do phase.monad [current_module (/////declaration.lifted_analysis (///.lifted meta.current_module_name)) @@ -426,7 +426,7 @@ (Handler anchor expression declaration))) (function (handler extension_name phase archive inputsC+) (case inputsC+ - (pattern (list nameC valueC)) + (list nameC valueC) (do phase.monad [target_platform (/////declaration.lifted_analysis (///.lifted meta.target)) @@ -434,11 +434,11 @@ [_ handlerV] (<definer> archive (as Text name) (let [raw_type (type_literal <def_type>)] (case target_platform - (^.or (pattern (static @.jvm)) - (pattern (static @.js))) + (^.or (static @.jvm) + (static @.js)) raw_type - (pattern (static @.python)) + (static @.python) (swapped binary.Binary Binary|Python raw_type) _ @@ -519,7 +519,7 @@ (-> (Program expression declaration) (Handler anchor expression declaration))) (function (handler extension_name phase archive inputsC+) (case inputsC+ - (pattern (list programC)) + (list programC) (do phase.monad [state (///.lifted phase.state) .let [analyse (the [/////declaration.#analysis /////declaration.#phase] state) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/common.lux index 3205b9933..582107b3c 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/common.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/common.lux @@ -109,7 +109,7 @@ (in (as Statement body))) (^.with_template [<tag>] - [(pattern (<tag> value)) + [(<tag> value) (/////#each _.return (expression archive synthesis))]) ([synthesis.bit] [synthesis.i64] @@ -121,30 +121,30 @@ [synthesis.function/apply]) (^.with_template [<tag>] - [(pattern {<tag> value}) + [{<tag> value} (/////#each _.return (expression archive synthesis))]) ([synthesis.#Reference] [synthesis.#Extension]) - (pattern (synthesis.branch/case case)) + (synthesis.branch/case case) (//case.case! statement expression archive case) - (pattern (synthesis.branch/exec it)) + (synthesis.branch/exec it) (//case.exec! statement expression archive it) - (pattern (synthesis.branch/let let)) + (synthesis.branch/let let) (//case.let! statement expression archive let) - (pattern (synthesis.branch/if if)) + (synthesis.branch/if if) (//case.if! statement expression archive if) - (pattern (synthesis.loop/scope scope)) + (synthesis.loop/scope scope) (//loop.scope! statement expression archive scope) - (pattern (synthesis.loop/again updates)) + (synthesis.loop/again updates) (//loop.again! statement expression archive updates) - (pattern (synthesis.function/abstraction abstraction)) + (synthesis.function/abstraction abstraction) (/////#each _.return (//function.function statement expression archive abstraction)) )) 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 b72b69b2c..0d0a38730 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 @@ -830,7 +830,7 @@ [1 _]) body - (pattern [2 {synthesis.#Control {synthesis.#Branch {synthesis.#Let _ 2 (synthesis.tuple (list _ hidden))}}}]) + [2 {synthesis.#Control {synthesis.#Branch {synthesis.#Let _ 2 (synthesis.tuple (list _ hidden))}}}] hidden [_ {synthesis.#Control {synthesis.#Branch {synthesis.#Case _ path}}}] @@ -839,7 +839,7 @@ {synthesis.#Seq _ next} (again next) - (pattern {synthesis.#Then (synthesis.tuple (list _ hidden))}) + {synthesis.#Then (synthesis.tuple (list _ hidden))} hidden _ @@ -1004,11 +1004,11 @@ (-> Path Path)) (function (again path) (case path - (pattern (synthesis.path/then bodyS)) + (synthesis.path/then bodyS) (synthesis.path/then (normalize bodyS)) (^.with_template [<tag>] - [(pattern {<tag> leftP rightP}) + [{<tag> leftP rightP} {<tag> (again leftP) (again rightP)}]) ([synthesis.#Alt] [synthesis.#Seq]) @@ -1041,48 +1041,48 @@ (function (again body) (case body (^.with_template [<tag>] - [(pattern <tag>) + [<tag> body]) ([{synthesis.#Simple _}] [(synthesis.constant _)]) - (pattern (synthesis.variant [lefts right? sub])) + (synthesis.variant [lefts right? sub]) (synthesis.variant [lefts right? (again sub)]) - (pattern (synthesis.tuple members)) + (synthesis.tuple members) (synthesis.tuple (list#each again members)) - (pattern (synthesis.variable var)) + (synthesis.variable var) (|> mapping (dictionary.value body) (maybe.else var) synthesis.variable) - (pattern (synthesis.branch/case [inputS pathS])) + (synthesis.branch/case [inputS pathS]) (synthesis.branch/case [(again inputS) (normalize_path again pathS)]) - (pattern (synthesis.branch/exec [this that])) + (synthesis.branch/exec [this that]) (synthesis.branch/exec [(again this) (again that)]) - (pattern (synthesis.branch/let [inputS register outputS])) + (synthesis.branch/let [inputS register outputS]) (synthesis.branch/let [(again inputS) register (again outputS)]) - (pattern (synthesis.branch/if [testS thenS elseS])) + (synthesis.branch/if [testS thenS elseS]) (synthesis.branch/if [(again testS) (again thenS) (again elseS)]) - (pattern (synthesis.branch/get [path recordS])) + (synthesis.branch/get [path recordS]) (synthesis.branch/get [path (again recordS)]) - (pattern (synthesis.loop/scope [offset initsS+ bodyS])) + (synthesis.loop/scope [offset initsS+ bodyS]) (synthesis.loop/scope [offset (list#each again initsS+) (again bodyS)]) - (pattern (synthesis.loop/again updatesS+)) + (synthesis.loop/again updatesS+) (synthesis.loop/again (list#each again updatesS+)) - (pattern (synthesis.function/abstraction [environment arity bodyS])) + (synthesis.function/abstraction [environment arity bodyS]) (synthesis.function/abstraction [(list#each (function (_ captured) (case captured - (pattern (synthesis.variable var)) + (synthesis.variable var) (|> mapping (dictionary.value captured) (maybe.else var) @@ -1094,7 +1094,7 @@ arity bodyS]) - (pattern (synthesis.function/apply [functionS inputsS+])) + (synthesis.function/apply [functionS inputsS+]) (synthesis.function/apply [(again functionS) (list#each again inputsS+)]) {synthesis.#Extension [name inputsS+]} diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux index abaf8d32f..00cd16e75 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux @@ -71,7 +71,7 @@ (in (as Statement body))) (^.with_template [<tag>] - [(pattern (<tag> value)) + [(<tag> value) (/////#each _.return (expression archive synthesis))]) ([synthesis.bit] [synthesis.i64] @@ -83,32 +83,32 @@ [synthesis.function/apply]) (^.with_template [<tag>] - [(pattern {<tag> value}) + [{<tag> value} (/////#each _.return (expression archive synthesis))]) ([synthesis.#Reference] [synthesis.#Extension]) - (pattern (synthesis.branch/case case)) + (synthesis.branch/case case) (//case.case! statement expression archive case) - (pattern (synthesis.branch/exec it)) + (synthesis.branch/exec it) (//case.exec! statement expression archive it) - (pattern (synthesis.branch/let let)) + (synthesis.branch/let let) (//case.let! statement expression archive let) - (pattern (synthesis.branch/if if)) + (synthesis.branch/if if) (//case.if! statement expression archive if) - (pattern (synthesis.loop/scope scope)) + (synthesis.loop/scope scope) (do /////.monad [[inits scope!] (//loop.scope! statement expression archive false scope)] (in scope!)) - (pattern (synthesis.loop/again updates)) + (synthesis.loop/again updates) (//loop.again! statement expression archive updates) - (pattern (synthesis.function/abstraction abstraction)) + (synthesis.function/abstraction abstraction) (/////#each _.return (//function.function statement expression archive abstraction)) )) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/common.lux index 37ac2d627..6d42c51e7 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/common.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/common.lux @@ -56,7 +56,7 @@ (in (as (Statement Any) body))) (^.with_template [<tag>] - [(pattern (<tag> value)) + [(<tag> value) (/////#each _.return (expression archive synthesis))]) ([synthesis.bit] [synthesis.i64] @@ -68,16 +68,16 @@ [synthesis.function/apply]) (^.with_template [<tag>] - [(pattern {<tag> value}) + [{<tag> value} (/////#each _.return (expression archive synthesis))]) ([synthesis.#Reference] [synthesis.#Extension]) - (pattern (synthesis.branch/case case)) + (synthesis.branch/case case) (//case.case! false statement expression archive case) (^.with_template [<tag> <generator>] - [(pattern (<tag> value)) + [(<tag> value) (<generator> statement expression archive value)]) ([synthesis.branch/exec //case.exec!] [synthesis.branch/let //case.let!] @@ -85,7 +85,7 @@ [synthesis.loop/scope //loop.scope!] [synthesis.loop/again //loop.again!]) - (pattern (synthesis.function/abstraction abstraction)) + (synthesis.function/abstraction abstraction) (/////#each _.return (//function.function statement expression archive abstraction)) )) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/ruby/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/ruby/common.lux index 95b08bf3c..944bcec7c 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/ruby/common.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/ruby/common.lux @@ -68,7 +68,7 @@ body))) (^.with_template [<tag>] - [(pattern (<tag> value)) + [(<tag> value) (/////#each _.return (expression archive synthesis))]) ([synthesis.bit] [synthesis.i64] @@ -80,16 +80,16 @@ [synthesis.function/apply]) (^.with_template [<tag>] - [(pattern {<tag> value}) + [{<tag> value} (/////#each _.return (expression archive synthesis))]) ([synthesis.#Reference] [synthesis.#Extension]) - (pattern (synthesis.branch/case case)) + (synthesis.branch/case case) (//case.case! false statement expression archive case) (^.with_template [<tag> <generator>] - [(pattern (<tag> value)) + [(<tag> value) (<generator> statement expression archive value)]) ([synthesis.branch/exec //case.exec!] [synthesis.branch/let //case.let!] @@ -97,7 +97,7 @@ [synthesis.loop/scope //loop.scope!] [synthesis.loop/again //loop.again!]) - (pattern (synthesis.function/abstraction abstraction)) + (synthesis.function/abstraction abstraction) (/////#each _.return (//function.function statement expression archive abstraction)) )) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp.lux index 8af11bb77..1168d5b8b 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp.lux @@ -30,7 +30,7 @@ Phase (case synthesis (^.with_template [<tag> <generator>] - [(pattern (<tag> value)) + [(<tag> value) (//////phase#in (<generator> value))]) ([////synthesis.bit /primitive.bit] [////synthesis.i64 /primitive.i64] @@ -41,7 +41,7 @@ (//reference.reference /reference.system archive value) (^.with_template [<tag> <generator>] - [(pattern (<tag> value)) + [(<tag> value) (<generator> generate archive value)]) ([////synthesis.variant /structure.variant] [////synthesis.tuple /structure.tuple] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/case.lux index 6059eddc2..c00fab798 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/case.lux @@ -141,7 +141,7 @@ (Generator [Var/1 _.Tag _.Tag Path]) (function (again [$output @done @fail pathP]) (.case pathP - (pattern (/////synthesis.path/then bodyS)) + (/////synthesis.path/then bodyS) (at ///////phase.monad each (function (_ outputV) (_.progn (list (_.setq $output outputV) @@ -190,40 +190,40 @@ [/////synthesis.#Text_Fork //primitive.text _.string=/2]) (^.with_template [<complex> <simple> <choice>] - [(pattern (<complex> idx)) + [(<complex> idx) (///////phase#in (<choice> @fail false idx {.#None})) - (pattern (<simple> idx nextP)) + (<simple> idx nextP) (|> nextP [$output @done @fail] again (at ///////phase.monad each (|>> {.#Some} (<choice> @fail true idx))))]) ([/////synthesis.side/left /////synthesis.simple_left_side ..left_choice] [/////synthesis.side/right /////synthesis.simple_right_side ..right_choice]) - (pattern (/////synthesis.member/left 0)) + (/////synthesis.member/left 0) (///////phase#in (..push! (_.elt/2 [..peek (_.int +0)]))) (^.with_template [<pm> <getter>] - [(pattern (<pm> lefts)) + [(<pm> lefts) (///////phase#in (|> ..peek (<getter> (_.int (.int lefts))) ..push!))]) ([/////synthesis.member/left //runtime.tuple//left] [/////synthesis.member/right //runtime.tuple//right]) - (pattern (/////synthesis.!multi_pop nextP)) + (/////synthesis.!multi_pop nextP) (.let [[extra_pops nextP'] (////synthesis/case.count_pops nextP)] (do ///////phase.monad [next! (again [$output @done @fail nextP'])] (///////phase#in (_.progn (list (..multi_pop! (n.+ 2 extra_pops)) next!))))) - (pattern (/////synthesis.path/alt preP postP)) + (/////synthesis.path/alt preP postP) (do [! ///////phase.monad] [@otherwise (at ! each (|>> %.nat (format "lux_case_otherwise") _.tag) /////generation.next) pre! (again [$output @done @otherwise preP]) post! (again [$output @done @fail postP])] (in (..alternation @otherwise pre! post!))) - (pattern (/////synthesis.path/seq preP postP)) + (/////synthesis.path/seq preP postP) (do ///////phase.monad [pre! (again [$output @done @fail preP]) post! (again [$output @done @fail postP])] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/extension.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/extension.lux index 9ab55a0a6..9d2c7e1db 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/extension.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/extension.lux @@ -40,7 +40,7 @@ (function ((, g!_) (, g!extension)) (function ((, g!_) (, g!name) (, g!phase) (, g!archive) (, g!inputs)) (case (, g!inputs) - (pattern (list (,* g!input+))) + (list (,* g!input+)) (do ///.monad [(,* (|> g!input+ (list#each (function (_ g!input) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js.lux index 907159f8a..bf12be34e 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js.lux @@ -39,47 +39,47 @@ Phase (case synthesis (^.with_template [<tag> <generator>] - [(pattern (<tag> value)) + [(<tag> value) (//////phase#in (<generator> value))]) ([synthesis.bit /primitive.bit] [synthesis.i64 /primitive.i64] [synthesis.f64 /primitive.f64] [synthesis.text /primitive.text]) - (pattern (synthesis.variant variantS)) + (synthesis.variant variantS) (/structure.variant expression archive variantS) - (pattern (synthesis.tuple members)) + (synthesis.tuple members) (/structure.tuple expression archive members) {synthesis.#Reference value} (//reference.reference /reference.system archive value) - (pattern (synthesis.branch/case case)) + (synthesis.branch/case case) (/case.case ///extension/common.statement expression archive case) - (pattern (synthesis.branch/exec it)) + (synthesis.branch/exec it) (/case.exec expression archive it) - (pattern (synthesis.branch/let let)) + (synthesis.branch/let let) (/case.let expression archive let) - (pattern (synthesis.branch/if if)) + (synthesis.branch/if if) (/case.if expression archive if) - (pattern (synthesis.branch/get get)) + (synthesis.branch/get get) (/case.get expression archive get) - (pattern (synthesis.loop/scope scope)) + (synthesis.loop/scope scope) (/loop.scope ///extension/common.statement expression archive scope) - (pattern (synthesis.loop/again updates)) + (synthesis.loop/again updates) (//////phase.except ..cannot_recur_as_an_expression []) - (pattern (synthesis.function/abstraction abstraction)) + (synthesis.function/abstraction abstraction) (/function.function ///extension/common.statement expression archive abstraction) - (pattern (synthesis.function/apply application)) + (synthesis.function/apply application) (/function.apply expression archive application) {synthesis.#Extension extension} diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/case.lux index 24e27bd78..e93ef8b99 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/case.lux @@ -183,20 +183,20 @@ (-> Path (Operation (Maybe Statement)))) (.case pathP (^.with_template [<simple> <choice>] - [(pattern (<simple> idx nextP)) + [(<simple> idx nextP) (|> nextP again (at ///////phase.monad each (|>> (_.then (<choice> true idx)) {.#Some})))]) ([/////synthesis.simple_left_side ..left_choice] [/////synthesis.simple_right_side ..right_choice]) - (pattern (/////synthesis.member/left 0)) + (/////synthesis.member/left 0) (///////phase#in {.#Some (push_cursor! (_.at (_.i32 +0) ..peek_cursor))}) ... Extra optimization - (pattern (/////synthesis.path/seq - (/////synthesis.member/left 0) - (/////synthesis.!bind_top register thenP))) + (/////synthesis.path/seq + (/////synthesis.member/left 0) + (/////synthesis.!bind_top register thenP)) (do ///////phase.monad [then! (again thenP)] (in {.#Some (all _.then @@ -205,9 +205,9 @@ ... Extra optimization (^.with_template [<pm> <getter>] - [(pattern (/////synthesis.path/seq - (<pm> lefts) - (/////synthesis.!bind_top register thenP))) + [(/////synthesis.path/seq + (<pm> lefts) + (/////synthesis.!bind_top register thenP)) (do ///////phase.monad [then! (again thenP)] (in {.#Some (all _.then @@ -216,14 +216,14 @@ ([/////synthesis.member/left //runtime.tuple//left] [/////synthesis.member/right //runtime.tuple//right]) - (pattern (/////synthesis.!bind_top register thenP)) + (/////synthesis.!bind_top register thenP) (do ///////phase.monad [then! (again thenP)] (in {.#Some (all _.then (_.define (..register register) ..peek_and_pop_cursor) then!)})) - (pattern (/////synthesis.!multi_pop nextP)) + (/////synthesis.!multi_pop nextP) (.let [[extra_pops nextP'] (////synthesis/case.count_pops nextP)] (do ///////phase.monad [next! (again nextP')] @@ -299,19 +299,19 @@ [/////synthesis.#Text_Fork //primitive.text]) (^.with_template [<complex> <choice>] - [(pattern (<complex> idx)) + [(<complex> idx) (///////phase#in (<choice> false idx))]) ([/////synthesis.side/left ..left_choice] [/////synthesis.side/right ..right_choice]) (^.with_template [<pm> <getter>] - [(pattern (<pm> lefts)) + [(<pm> lefts) (///////phase#in (push_cursor! (<getter> (_.i32 (.int lefts)) ..peek_cursor)))]) ([/////synthesis.member/left //runtime.tuple//left] [/////synthesis.member/right //runtime.tuple//right]) (^.with_template [<tag> <combinator>] - [(pattern (<tag> leftP rightP)) + [(<tag> leftP rightP) (do ///////phase.monad [left! (again leftP) right! (again rightP)] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/loop.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/loop.lux index 98411011a..124c94a02 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/loop.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/loop.lux @@ -36,10 +36,10 @@ (def (setup $iteration initial? offset bindings body) (-> Var Bit Register (List Expression) Statement Statement) (case bindings - (pattern (list)) + (list) body - (pattern (list binding)) + (list binding) (let [$binding (//case.register offset)] (all _.then (if initial? diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm.lux index 8b5ee06f9..b1fa42f27 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm.lux @@ -26,17 +26,17 @@ Phase (case synthesis (^.with_template [<tag> <generator>] - [(pattern (<tag> value)) + [(<tag> value) (///#in (<generator> value))]) ([synthesis.bit /primitive.bit] [synthesis.i64 /primitive.i64] [synthesis.f64 /primitive.f64] [synthesis.text /primitive.text]) - (pattern (synthesis.variant variantS)) + (synthesis.variant variantS) (/structure.variant generate archive variantS) - (pattern (synthesis.tuple members)) + (synthesis.tuple members) (/structure.tuple generate archive members) {synthesis.#Reference reference} @@ -47,31 +47,31 @@ {reference.#Constant constant} (/reference.constant archive constant)) - (pattern (synthesis.branch/case [valueS pathS])) + (synthesis.branch/case [valueS pathS]) (/case.case generate archive [valueS pathS]) - (pattern (synthesis.branch/exec [this that])) + (synthesis.branch/exec [this that]) (/case.exec generate archive [this that]) - (pattern (synthesis.branch/let [inputS register bodyS])) + (synthesis.branch/let [inputS register bodyS]) (/case.let generate archive [inputS register bodyS]) - (pattern (synthesis.branch/if [conditionS thenS elseS])) + (synthesis.branch/if [conditionS thenS elseS]) (/case.if generate archive [conditionS thenS elseS]) - (pattern (synthesis.branch/get [path recordS])) + (synthesis.branch/get [path recordS]) (/case.get generate archive [path recordS]) - (pattern (synthesis.loop/scope scope)) + (synthesis.loop/scope scope) (/loop.scope generate archive scope) - (pattern (synthesis.loop/again updates)) + (synthesis.loop/again updates) (/loop.again generate archive updates) - (pattern (synthesis.function/abstraction abstraction)) + (synthesis.function/abstraction abstraction) (/function.abstraction generate archive abstraction) - (pattern (synthesis.function/apply application)) + (synthesis.function/apply application) (/function.apply generate archive application) {synthesis.#Extension extension} diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/case.lux index bc03aae26..2903069f8 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/case.lux @@ -184,7 +184,7 @@ body! (_.when_continuous (_.goto @end))))) - (pattern (synthesis.side lefts right?)) + (synthesis.side lefts right?) (operation#in (do _.monad [@success _.new_label] @@ -202,16 +202,16 @@ //runtime.push))) (^.with_template [<pattern> <projection>] - [(pattern (<pattern> lefts)) + [(<pattern> lefts) (operation#in (all _.composite ..peek (<projection> lefts) //runtime.push)) ... Extra optimization - (pattern (synthesis.path/seq - (<pattern> lefts) - (synthesis.!bind_top register thenP))) + (synthesis.path/seq + (<pattern> lefts) + (synthesis.!bind_top register thenP)) (do phase.monad [then! (path' stack_depth @else @end phase archive thenP)] (in (all _.composite diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux index 200b4db2e..13d5eb827 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux @@ -171,7 +171,7 @@ (def .public (apply generate archive [abstractionS inputsS]) (Generator Apply) (case abstractionS - (pattern (synthesis.constant $abstraction)) + (synthesis.constant $abstraction) (do [! phase.monad] [[@definition |abstraction|] (generation.definition archive $abstraction) .let [actual_arity (list.size inputsS)]] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/loop.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/loop.lux index f95ac11cc..8758e7b06 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/loop.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/loop.lux @@ -29,7 +29,7 @@ (def (invariant? register changeS) (-> Register Synthesis Bit) (case changeS - (pattern (synthesis.variable/local var)) + (synthesis.variable/local var) (n.= register var) _ diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua.lux index 6971e4cfa..fbfb53b71 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua.lux @@ -39,47 +39,47 @@ Phase (case synthesis (^.with_template [<tag> <generator>] - [(pattern (<tag> value)) + [(<tag> value) (//////phase#in (<generator> value))]) ([synthesis.bit /primitive.bit] [synthesis.i64 /primitive.i64] [synthesis.f64 /primitive.f64] [synthesis.text /primitive.text]) - (pattern (synthesis.variant variantS)) + (synthesis.variant variantS) (/structure.variant expression archive variantS) - (pattern (synthesis.tuple members)) + (synthesis.tuple members) (/structure.tuple expression archive members) {synthesis.#Reference value} (//reference.reference /reference.system archive value) - (pattern (synthesis.branch/case case)) + (synthesis.branch/case case) (/case.case ///extension/common.statement expression archive case) - (pattern (synthesis.branch/exec it)) + (synthesis.branch/exec it) (/case.exec expression archive it) - (pattern (synthesis.branch/let let)) + (synthesis.branch/let let) (/case.let expression archive let) - (pattern (synthesis.branch/if if)) + (synthesis.branch/if if) (/case.if expression archive if) - (pattern (synthesis.branch/get get)) + (synthesis.branch/get get) (/case.get expression archive get) - (pattern (synthesis.loop/scope scope)) + (synthesis.loop/scope scope) (/loop.scope ///extension/common.statement expression archive scope) - (pattern (synthesis.loop/again updates)) + (synthesis.loop/again updates) (//////phase.except ..cannot_recur_as_an_expression []) - (pattern (synthesis.function/abstraction abstraction)) + (synthesis.function/abstraction abstraction) (/function.function ///extension/common.statement expression archive abstraction) - (pattern (synthesis.function/apply application)) + (synthesis.function/apply application) (/function.apply expression archive application) {synthesis.#Extension extension} diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/case.lux index ea8ca09f0..9e0103911 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/case.lux @@ -229,24 +229,24 @@ [/////synthesis.#Text_Fork _.string]) (^.with_template [<complex> <simple> <choice>] - [(pattern (<complex> idx)) + [(<complex> idx) (///////phase#in (<choice> false idx)) - (pattern (<simple> idx nextP)) + (<simple> idx nextP) (///////phase#each (_.then (<choice> true idx)) (again nextP))]) ([/////synthesis.side/left /////synthesis.simple_left_side ..left_choice] [/////synthesis.side/right /////synthesis.simple_right_side ..right_choice]) - (pattern (/////synthesis.member/left 0)) + (/////synthesis.member/left 0) (///////phase#in (|> ..peek (_.item (_.int +1)) ..push!)) (^.with_template [<pm> <getter>] - [(pattern (<pm> lefts)) + [(<pm> lefts) (///////phase#in (|> ..peek (<getter> (_.int (.int lefts))) ..push!))]) ([/////synthesis.member/left //runtime.tuple//left] [/////synthesis.member/right //runtime.tuple//right]) - (pattern (/////synthesis.!bind_top register thenP)) + (/////synthesis.!bind_top register thenP) (do ///////phase.monad [then! (again thenP)] (///////phase#in (all _.then @@ -254,7 +254,7 @@ then!))) (^.with_template [<tag> <combinator>] - [(pattern (<tag> preP postP)) + [(<tag> preP postP) (do ///////phase.monad [pre! (again preP) post! (again postP)] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php.lux index e96ac884a..55c495cee 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php.lux @@ -34,7 +34,7 @@ Phase! (case synthesis (^.with_template [<tag>] - [(pattern (<tag> value)) + [(<tag> value) (//////phase#each _.return (expression archive synthesis))]) ([////synthesis.bit] [////synthesis.i64] @@ -46,23 +46,23 @@ [////synthesis.function/apply]) (^.with_template [<tag>] - [(pattern {<tag> value}) + [{<tag> value} (//////phase#each _.return (expression archive synthesis))]) ([////synthesis.#Reference] [////synthesis.#Extension]) - (pattern (////synthesis.branch/case case)) + (////synthesis.branch/case case) (/case.case! statement expression archive case) (^.with_template [<tag> <generator>] - [(pattern (<tag> value)) + [(<tag> value) (<generator> statement expression archive value)]) ([////synthesis.branch/let /case.let!] [////synthesis.branch/if /case.if!] [////synthesis.loop/scope /loop.scope!] [////synthesis.loop/again /loop.again!]) - (pattern (////synthesis.function/abstraction abstraction)) + (////synthesis.function/abstraction abstraction) (//////phase#each _.return (/function.function statement expression archive abstraction)) )) @@ -72,7 +72,7 @@ Phase (case synthesis (^.with_template [<tag> <generator>] - [(pattern (<tag> value)) + [(<tag> value) (//////phase#in (<generator> value))]) ([////synthesis.bit /primitive.bit] [////synthesis.i64 /primitive.i64] @@ -83,7 +83,7 @@ (//reference.reference /reference.system archive value) (^.with_template [<tag> <generator>] - [(pattern (<tag> value)) + [(<tag> value) (<generator> expression archive value)]) ([////synthesis.variant /structure.variant] [////synthesis.tuple /structure.tuple] @@ -93,13 +93,13 @@ [////synthesis.function/apply /function.apply]) (^.with_template [<tag> <generator>] - [(pattern (<tag> value)) + [(<tag> value) (<generator> statement expression archive value)]) ([////synthesis.branch/case /case.case] [////synthesis.loop/scope /loop.scope] [////synthesis.function/abstraction /function.function]) - (pattern (////synthesis.loop/again _)) + (////synthesis.loop/again _) (//////phase.except ..cannot_recur_as_an_expression []) {////synthesis.#Extension extension} diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/case.lux index 39ae8fcd4..00094289c 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/case.lux @@ -208,33 +208,33 @@ [/////synthesis.#Text_Fork //primitive.text]) (^.with_template [<complex> <simple> <choice>] - [(pattern (<complex> idx)) + [(<complex> idx) (///////phase#in (<choice> false idx)) - (pattern (<simple> idx nextP)) + (<simple> idx nextP) (|> nextP again (at ///////phase.monad each (_.then (<choice> true idx))))]) ([/////synthesis.side/left /////synthesis.simple_left_side ..left_choice] [/////synthesis.side/right /////synthesis.simple_right_side ..right_choice]) - (pattern (/////synthesis.member/left 0)) + (/////synthesis.member/left 0) (///////phase#in (|> ..peek (_.item (_.int +0)) ..push!)) (^.with_template [<pm> <getter>] - [(pattern (<pm> lefts)) + [(<pm> lefts) (///////phase#in (|> ..peek (<getter> (_.int (.int lefts))) ..push!))]) ([/////synthesis.member/left //runtime.tuple//left] [/////synthesis.member/right //runtime.tuple//right]) - (pattern (/////synthesis.!bind_top register thenP)) + (/////synthesis.!bind_top register thenP) (do ///////phase.monad [then! (again thenP)] (///////phase#in (all _.then (_.set! (..register register) ..peek_and_pop) then!))) - ... (pattern (/////synthesis.!multi_pop nextP)) + ... (/////synthesis.!multi_pop nextP) ... (.let [[extra_pops nextP'] (////synthesis/case.count_pops nextP)] ... (do ///////phase.monad ... [next! (again nextP')] @@ -243,7 +243,7 @@ ... next!)))) (^.with_template [<tag> <combinator>] - [(pattern (<tag> preP postP)) + [(<tag> preP postP) (do ///////phase.monad [pre! (again preP) post! (again postP)] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python.lux index a5435e72d..ef9fdee7e 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python.lux @@ -39,7 +39,7 @@ Phase (case synthesis (^.with_template [<tag> <generator>] - [(pattern (<tag> value)) + [(<tag> value) (//////phase#in (<generator> value))]) ([////synthesis.bit /primitive.bit] [////synthesis.i64 /primitive.i64] @@ -47,7 +47,7 @@ [////synthesis.text /primitive.text]) (^.with_template [<tag> <generator>] - [(pattern (<tag> value)) + [(<tag> value) (<generator> expression archive value)]) ([////synthesis.variant /structure.variant] [////synthesis.tuple /structure.tuple] @@ -60,13 +60,13 @@ [////synthesis.function/apply /function.apply]) (^.with_template [<tag> <generator>] - [(pattern (<tag> value)) + [(<tag> value) (<generator> ///extension/common.statement expression archive value)]) ([////synthesis.branch/case /case.case] [////synthesis.loop/scope /loop.scope] [////synthesis.function/abstraction /function.function]) - (pattern (////synthesis.loop/again updates)) + (////synthesis.loop/again updates) (//////phase.except ..cannot_recur_as_an_expression []) {////synthesis.#Reference value} diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/case.lux index 5062e41ae..02a90bd13 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/case.lux @@ -260,33 +260,33 @@ (///////phase#in (_.set (list (..register register)) ..peek)) (^.with_template [<complex> <simple> <choice>] - [(pattern (<complex> idx)) + [(<complex> idx) (///////phase#in (<choice> false idx)) - (pattern (<simple> idx nextP)) + (<simple> idx nextP) (|> nextP again (///////phase#each (_.then (<choice> true idx))))]) ([/////synthesis.side/left /////synthesis.simple_left_side ..left_choice] [/////synthesis.side/right /////synthesis.simple_right_side ..right_choice]) - (pattern (/////synthesis.member/left 0)) + (/////synthesis.member/left 0) (///////phase#in (|> ..peek (_.item (_.int +0)) ..push!)) (^.with_template [<pm> <getter>] - [(pattern (<pm> lefts)) + [(<pm> lefts) (///////phase#in (|> ..peek (<getter> (_.int (.int lefts))) ..push!))]) ([/////synthesis.member/left //runtime.tuple::left] [/////synthesis.member/right //runtime.tuple::right]) - (pattern (/////synthesis.!bind_top register thenP)) + (/////synthesis.!bind_top register thenP) (do ! [then! (again thenP)] (///////phase#in (all _.then (_.set (list (..register register)) ..peek_and_pop) then!))) - (pattern (/////synthesis.!multi_pop nextP)) + (/////synthesis.!multi_pop nextP) (.let [[extra_pops nextP'] (case.count_pops nextP)] (do ! [next! (again nextP')] @@ -294,13 +294,13 @@ (..multi_pop! (n.+ 2 extra_pops)) next!)))) - (pattern (/////synthesis.path/seq preP postP)) + (/////synthesis.path/seq preP postP) (do ! [pre! (again preP) post! (again postP)] (in (_.then pre! post!))) - (pattern (/////synthesis.path/alt preP postP)) + (/////synthesis.path/alt preP postP) (do ! [pre! (again preP) post! (again postP) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r.lux index 135f3e4df..6028a0ac3 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r.lux @@ -32,7 +32,7 @@ Phase (case synthesis (^.with_template [<tag> <generator>] - [(pattern (<tag> value)) + [(<tag> value) (//////phase#in (<generator> value))]) ([////synthesis.bit /primitive.bit] [////synthesis.i64 /primitive.i64] @@ -43,7 +43,7 @@ (//reference.reference /reference.system archive value) (^.with_template [<tag> <generator>] - [(pattern (<tag> value)) + [(<tag> value) (<generator> generate archive value)]) ([////synthesis.variant /structure.variant] [////synthesis.tuple /structure.tuple] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/case.lux index 51cb787a3..472f361b6 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/case.lux @@ -182,7 +182,7 @@ [/////synthesis.#Text_Fork //primitive.text _.=]) (^.with_template [<pm> <flag> <prep>] - [(pattern (<pm> idx)) + [(<pm> idx) (///////phase#in (all _.then (_.set! $temp (|> idx <prep> .int _.int (//runtime.sum::get ..peek (//runtime.flag <flag>)))) (_.if (_.= _.null $temp) @@ -191,16 +191,16 @@ ([/////synthesis.side/left false (<|)] [/////synthesis.side/right true ++]) - (pattern (/////synthesis.member/left 0)) + (/////synthesis.member/left 0) (///////phase#in (_.item (_.int +1) ..peek)) (^.with_template [<pm> <getter>] - [(pattern (<pm> lefts)) + [(<pm> lefts) (///////phase#in (|> ..peek (<getter> (_.int (.int lefts))) ..push_cursor!))]) ([/////synthesis.member/left //runtime.tuple::left] [/////synthesis.member/right //runtime.tuple::right]) - (pattern (/////synthesis.path/seq leftP rightP)) + (/////synthesis.path/seq leftP rightP) (do ///////phase.monad [leftO (again leftP) rightO (again rightP)] @@ -208,7 +208,7 @@ leftO rightO))) - (pattern (/////synthesis.path/alt leftP rightP)) + (/////synthesis.path/alt leftP rightP) (do [! ///////phase.monad] [leftO (again leftP) rightO (again rightP)] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/host.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/host.lux index 0201e556d..b5a3fcb3a 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/host.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/host.lux @@ -25,7 +25,7 @@ ... (def (lua//global proc translate inputs) ... (-> Text @.Proc) ... (case inputs -... (pattern (list [_ {.#Text name}])) +... (list [_ {.#Text name}]) ... (do macro.Monad<Meta> ... [] ... (in name)) @@ -36,7 +36,7 @@ ... (def (lua//call proc translate inputs) ... (-> Text @.Proc) ... (case inputs -... (pattern (list.partial functionS argsS+)) +... (list.partial functionS argsS+) ... (do [@ macro.Monad<Meta>] ... [functionO (translate functionS) ... argsO+ (monad.each @ translate argsS+)] @@ -56,7 +56,7 @@ ... (def (table//call proc translate inputs) ... (-> Text @.Proc) ... (case inputs -... (pattern (list.partial tableS [_ {.#Text field}] argsS+)) +... (list.partial tableS [_ {.#Text field}] argsS+) ... (do [@ macro.Monad<Meta>] ... [tableO (translate tableS) ... argsO+ (monad.each @ translate argsS+)] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby.lux index 989d07127..ed6f6710e 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby.lux @@ -39,7 +39,7 @@ Phase (case synthesis (^.with_template [<tag> <generator>] - [(pattern (<tag> value)) + [(<tag> value) (//////phase#in (<generator> value))]) ([////synthesis.bit /primitive.bit] [////synthesis.i64 /primitive.i64] @@ -47,7 +47,7 @@ [////synthesis.text /primitive.text]) (^.with_template [<tag> <generator>] - [(pattern (<tag> value)) + [(<tag> value) (<generator> expression archive value)]) ([////synthesis.variant /structure.variant] [////synthesis.tuple /structure.tuple] @@ -60,13 +60,13 @@ [////synthesis.function/apply /function.apply]) (^.with_template [<tag> <generator>] - [(pattern (<tag> value)) + [(<tag> value) (<generator> ///extension/common.statement expression archive value)]) ([////synthesis.branch/case /case.case] [////synthesis.loop/scope /loop.scope] [////synthesis.function/abstraction /function.function]) - (pattern (////synthesis.loop/again _)) + (////synthesis.loop/again _) (//////phase.except ..cannot_recur_as_an_expression []) {////synthesis.#Reference value} diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/case.lux index 68c958870..f76b378c8 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/case.lux @@ -301,33 +301,33 @@ [/////synthesis.#Text_Fork (<| //primitive.text)]) (^.with_template [<complex> <simple> <choice>] - [(pattern (<complex> idx)) + [(<complex> idx) (///////phase#in (<choice> false idx)) - (pattern (<simple> idx nextP)) + (<simple> idx nextP) (|> nextP again (///////phase#each (_.then (<choice> true idx))))]) ([/////synthesis.side/left /////synthesis.simple_left_side ..left_choice] [/////synthesis.side/right /////synthesis.simple_right_side ..right_choice]) - (pattern (/////synthesis.member/left 0)) + (/////synthesis.member/left 0) (///////phase#in (|> ..peek (_.item (_.int +0)) ..push!)) (^.with_template [<pm> <getter>] - [(pattern (<pm> lefts)) + [(<pm> lefts) (///////phase#in (|> ..peek (<getter> (_.int (.int lefts))) ..push!))]) ([/////synthesis.member/left //runtime.tuple//left] [/////synthesis.member/right //runtime.tuple//right]) - (pattern (/////synthesis.!bind_top register thenP)) + (/////synthesis.!bind_top register thenP) (do ///////phase.monad [then! (again thenP)] (///////phase#in (all _.then (_.set (list (..register register)) ..peek_and_pop) then!))) - (pattern (/////synthesis.!multi_pop nextP)) + (/////synthesis.!multi_pop nextP) (.let [[extra_pops nextP'] (case.count_pops nextP)] (do ///////phase.monad [next! (again nextP')] @@ -335,7 +335,7 @@ (..multi_pop! (n.+ 2 extra_pops)) next!)))) - (pattern (/////synthesis.path/seq preP postP)) + (/////synthesis.path/seq preP postP) (do ///////phase.monad [pre! (again preP) post! (again postP)] @@ -343,7 +343,7 @@ pre! post!))) - (pattern (/////synthesis.path/alt preP postP)) + (/////synthesis.path/alt preP postP) (do ///////phase.monad [pre! (again preP) post! (again postP) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme.lux index 24b418ffa..2dba1f481 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme.lux @@ -32,7 +32,7 @@ Phase (case synthesis (^.with_template [<tag> <generator>] - [(pattern (<tag> value)) + [(<tag> value) (//////phase#in (<generator> value))]) ([////synthesis.bit /primitive.bit] [////synthesis.i64 /primitive.i64] @@ -43,7 +43,7 @@ (//reference.reference /reference.system archive value) (^.with_template [<tag> <generator>] - [(pattern (<tag> value)) + [(<tag> value) (<generator> generate archive value)]) ([////synthesis.variant /structure.variant] [////synthesis.tuple /structure.tuple] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/case.lux index b9546d729..d35d72f9f 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/case.lux @@ -176,7 +176,7 @@ [/////synthesis.#Text_Fork //primitive.text _.string=?/2]) (^.with_template [<pm> <flag> <prep>] - [(pattern (<pm> idx)) + [(<pm> idx) (///////phase#in (_.let (list [@temp (|> idx <prep> .int _.int (//runtime.sum//get ..peek (_.bool <flag>)))]) (_.if (_.null?/1 @temp) ..fail! @@ -184,23 +184,23 @@ ([/////synthesis.side/left false (<|)] [/////synthesis.side/right true ++]) - (pattern (/////synthesis.member/left 0)) + (/////synthesis.member/left 0) (///////phase#in (..push_cursor! (_.vector_ref/2 ..peek (_.int +0)))) (^.with_template [<pm> <getter>] - [(pattern (<pm> lefts)) + [(<pm> lefts) (///////phase#in (|> ..peek (<getter> (_.int (.int lefts))) ..push_cursor!))]) ([/////synthesis.member/left //runtime.tuple//left] [/////synthesis.member/right //runtime.tuple//right]) - (pattern (/////synthesis.path/seq leftP rightP)) + (/////synthesis.path/seq leftP rightP) (do ///////phase.monad [leftO (again leftP) rightO (again rightP)] (in (_.begin (list leftO rightO)))) - (pattern (/////synthesis.path/alt leftP rightP)) + (/////synthesis.path/alt leftP rightP) (do [! ///////phase.monad] [leftO (again leftP) rightO (again rightP)] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis.lux index 3aa00a192..b21dbdaae 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis.lux @@ -77,7 +77,7 @@ (/.with_currying? false (/case.synthesize optimization branchesAB+ archive inputA)) - (pattern (///analysis.no_op value)) + (///analysis.no_op value) (optimization' value) {///analysis.#Apply _} diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/case.lux index b2e0d357d..e755791ab 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/case.lux @@ -1,6 +1,6 @@ (.require [library - [lux (.except) + [lux (.except Pattern) [abstract [equivalence (.only Equivalence)] ["[0]" monad (.only do)]] @@ -290,7 +290,7 @@ path (case input - (pattern (/.branch/get [sub_path sub_input])) + (/.branch/get [sub_path sub_input]) (///#in (/.branch/get [(list#composite path sub_path) sub_input])) _ @@ -301,11 +301,11 @@ (do [! ///.monad] [inputS (synthesize^ archive inputA)] (case [headB tailB+] - (pattern (!masking @variable @output)) + (!masking @variable @output) (..synthesize_masking synthesize^ archive inputS @variable @output) - (pattern [[(///pattern.unit) body] - {.#End}]) + [[(///pattern.unit) body] + {.#End}] (case inputA (^.or {///analysis.#Simple _} {///analysis.#Structure _} @@ -319,18 +319,18 @@ {.#End}] (..synthesize_let synthesize^ archive inputS @variable body) - (^.or (pattern [[(///pattern.bit #1) then] - (list [(///pattern.bit #0) else])]) - (pattern [[(///pattern.bit #1) then] - (list [(///pattern.unit) else])]) - - (pattern [[(///pattern.bit #0) else] - (list [(///pattern.bit #1) then])]) - (pattern [[(///pattern.bit #0) else] - (list [(///pattern.unit) then])])) + (^.or [[(///pattern.bit #1) then] + (list [(///pattern.bit #0) else])] + [[(///pattern.bit #1) then] + (list [(///pattern.unit) else])] + + [[(///pattern.bit #0) else] + (list [(///pattern.bit #1) then])] + [[(///pattern.bit #0) else] + (list [(///pattern.unit) then])]) (..synthesize_if synthesize^ archive inputS then else) - (pattern (!get patterns @member)) + (!get patterns @member) (..synthesize_get synthesize^ archive inputS patterns @member) match @@ -339,7 +339,7 @@ (def .public (count_pops path) (-> Path [Nat Path]) (case path - (pattern (/.path/seq {/.#Pop} path')) + (/.path/seq {/.#Pop} path') (let [[pops post_pops] (count_pops path')] [(++ pops) post_pops]) @@ -374,7 +374,7 @@ {/.#Access Access}) path_storage - (pattern (/.path/bind register)) + (/.path/bind register) (revised #bindings (set.has register) path_storage) @@ -394,22 +394,22 @@ (list#each product.right) (list#mix for_path path_storage)) - (^.or (pattern (/.path/seq left right)) - (pattern (/.path/alt left right))) + (^.or (/.path/seq left right) + (/.path/alt left right)) (list#mix for_path path_storage (list left right)) - (pattern (/.path/then bodyS)) + (/.path/then bodyS) (loop (for_synthesis [bodyS bodyS synthesis_storage path_storage]) (case bodyS (^.or {/.#Simple _} - (pattern (/.constant _))) + (/.constant _)) synthesis_storage - (pattern (/.variant [lefts right? valueS])) + (/.variant [lefts right? valueS]) (for_synthesis valueS synthesis_storage) - (pattern (/.tuple members)) + (/.tuple members) (list#mix for_synthesis synthesis_storage members) {/.#Reference {///reference.#Variable {///reference/variable.#Local register}}} @@ -420,21 +420,21 @@ {/.#Reference {///reference.#Variable var}} (revised #dependencies (set.has var) synthesis_storage) - (pattern (/.function/apply [functionS argsS])) + (/.function/apply [functionS argsS]) (list#mix for_synthesis synthesis_storage {.#Item functionS argsS}) - (pattern (/.function/abstraction [environment arity bodyS])) + (/.function/abstraction [environment arity bodyS]) (list#mix for_synthesis synthesis_storage environment) - (pattern (/.branch/case [inputS pathS])) + (/.branch/case [inputS pathS]) (revised #dependencies (set.union (the #dependencies (for_path pathS synthesis_storage))) (for_synthesis inputS synthesis_storage)) - (pattern (/.branch/exec [before after])) + (/.branch/exec [before after]) (list#mix for_synthesis synthesis_storage (list before after)) - (pattern (/.branch/let [inputS register exprS])) + (/.branch/let [inputS register exprS]) (revised #dependencies (set.union (|> synthesis_storage (revised #bindings (set.has register)) @@ -442,13 +442,13 @@ (the #dependencies))) (for_synthesis inputS synthesis_storage)) - (pattern (/.branch/if [testS thenS elseS])) + (/.branch/if [testS thenS elseS]) (list#mix for_synthesis synthesis_storage (list testS thenS elseS)) - (pattern (/.branch/get [access whole])) + (/.branch/get [access whole]) (for_synthesis whole synthesis_storage) - (pattern (/.loop/scope [start initsS+ iterationS])) + (/.loop/scope [start initsS+ iterationS]) (revised #dependencies (set.union (|> synthesis_storage (revised #bindings (set.union (|> initsS+ @@ -459,7 +459,7 @@ (the #dependencies))) (list#mix for_synthesis synthesis_storage initsS+)) - (pattern (/.loop/again replacementsS+)) + (/.loop/again replacementsS+) (list#mix for_synthesis synthesis_storage replacementsS+) {/.#Extension [extension argsS]} 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 f1bf10c2c..a97634d68 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 @@ -60,7 +60,7 @@ argsS (monad.each ! (phase archive) argsA)] (with_expansions [<apply> (these (/.function/apply [funcS argsS]))] (case funcS - (pattern (/.function/abstraction functionS)) + (/.function/abstraction functionS) (if (n.= (the /.#arity functionS) (list.size argsS)) (do ! @@ -70,7 +70,7 @@ (maybe#each (is (-> [Nat (List Synthesis) Synthesis] Synthesis) (function (_ [start inits iteration]) (case iteration - (pattern (/.loop/scope [start' inits' output])) + (/.loop/scope [start' inits' output]) (if (and (n.= start start') (list.empty? inits')) (/.loop/scope [start inits output]) @@ -81,7 +81,7 @@ (maybe.else <apply>)))) (in <apply>)) - (pattern (/.function/apply [funcS' argsS'])) + (/.function/apply [funcS' argsS']) (in (/.function/apply [funcS' (list#composite argsS' argsS)])) _ @@ -158,7 +158,7 @@ (monad.each phase.monad (grow environment)) (phase#each (|>> /.tuple)))) - (pattern (..self_reference)) + (..self_reference) (phase#in (/.function/apply [expression (list (/.variable/local 1))])) {/.#Reference reference} @@ -240,7 +240,7 @@ [funcS (grow environment funcS) argsS+ (monad.each ! (grow environment) argsS+)] (in (/.function/apply (case funcS - (pattern (/.function/apply [(..self_reference) pre_argsS+])) + (/.function/apply [(..self_reference) pre_argsS+]) [(..self_reference) (list#composite pre_argsS+ argsS+)] @@ -265,7 +265,7 @@ (phase archive bodyA))) abstraction (is (Operation Abstraction) (case bodyS - (pattern (/.function/abstraction [env' down_arity' bodyS'])) + (/.function/abstraction [env' down_arity' bodyS']) (|> bodyS' (grow env') (at ! each (function (_ body) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/loop.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/loop.lux index eb5738a11..c967930bf 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/loop.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/loop.lux @@ -102,53 +102,53 @@ {/.#Reference reference} (case reference - (pattern {reference.#Variable (variable.self)}) + {reference.#Variable (variable.self)} (if true_loop? {.#None} {.#Some expr}) - (pattern (reference.constant constant)) + (reference.constant constant) {.#Some expr} - (pattern (reference.local register)) + (reference.local register) {.#Some {/.#Reference (reference.local (register_optimization offset register))}} - (pattern (reference.foreign register)) + (reference.foreign register) (if true_loop? (list.item register scope_environment) {.#Some expr})) - (pattern (/.branch/case [input path])) + (/.branch/case [input path]) (do maybe.monad [input' (again false input) path' (path_optimization (again return?) offset path)] (in (|> path' [input'] /.branch/case))) - (pattern (/.branch/exec [this that])) + (/.branch/exec [this that]) (do maybe.monad [this (again false this) that (again return? that)] (in (/.branch/exec [this that]))) - (pattern (/.branch/let [input register body])) + (/.branch/let [input register body]) (do maybe.monad [input' (again false input) body' (again return? body)] (in (/.branch/let [input' (register_optimization offset register) body']))) - (pattern (/.branch/if [input then else])) + (/.branch/if [input then else]) (do maybe.monad [input' (again false input) then' (again return? then) else' (again return? else)] (in (/.branch/if [input' then' else']))) - (pattern (/.branch/get [path record])) + (/.branch/get [path record]) (do maybe.monad [record (again false record)] (in (/.branch/get [path record]))) - (pattern (/.loop/scope scope)) + (/.loop/scope scope) (do [! maybe.monad] [inits' (|> scope (the /.#inits) @@ -158,24 +158,24 @@ /.#inits inits' /.#iteration iteration']))) - (pattern (/.loop/again args)) + (/.loop/again args) (|> args (monad.each maybe.monad (again false)) (maybe#each (|>> /.loop/again))) - (pattern (/.function/abstraction [environment arity body])) + (/.function/abstraction [environment arity body]) (do [! maybe.monad] [environment' (monad.each ! (again false) environment)] (in (/.function/abstraction [environment' arity body]))) - (pattern (/.function/apply [abstraction arguments])) + (/.function/apply [abstraction arguments]) (do [! maybe.monad] [arguments' (monad.each ! (again false) arguments)] (with_expansions [<application> (these (do ! [abstraction' (again false abstraction)] (in (/.function/apply [abstraction' arguments']))))] (case abstraction - (pattern {/.#Reference {reference.#Variable (variable.self)}}) + {/.#Reference {reference.#Variable (variable.self)}} (if (and return? (n.= arity (list.size arguments))) (in (/.loop/again arguments')) @@ -187,14 +187,14 @@ <application>))) ... TODO: Stop relying on this custom code. - (pattern {/.#Extension ["lux syntax char case!" (list.partial input else matches)]}) + {/.#Extension ["lux syntax char case!" (list.partial input else matches)]} (if return? (do [! maybe.monad] [input (again false input) matches (monad.each ! (function (_ match) (case match - (pattern {/.#Structure {analysis/complex.#Tuple (list when then)}}) + {/.#Structure {analysis/complex.#Tuple (list when then)}} (do ! [when (again false when) then (again return? then)] diff --git a/stdlib/source/library/lux/tool/compiler/reference/variable.lux b/stdlib/source/library/lux/tool/compiler/reference/variable.lux index 852a1e058..80b01b5b8 100644 --- a/stdlib/source/library/lux/tool/compiler/reference/variable.lux +++ b/stdlib/source/library/lux/tool/compiler/reference/variable.lux @@ -61,7 +61,7 @@ (def .public self? (-> Variable Bit) (|>> (pipe.case - (pattern (..self)) + (..self) true _ diff --git a/stdlib/source/parser/lux/data/format/json.lux b/stdlib/source/parser/lux/data/format/json.lux index ddb73da8f..c125d79d1 100644 --- a/stdlib/source/parser/lux/data/format/json.lux +++ b/stdlib/source/parser/lux/data/format/json.lux @@ -169,7 +169,7 @@ (All (_ a) (-> Text (Parser a) (Parser a))) (function (again inputs) (case inputs - (pattern (list.partial {/.#String key} value inputs')) + (list.partial {/.#String key} value inputs') (if (text#= key field_name) (case (//.result parser (list value)) {try.#Success [{.#End} output]} diff --git a/stdlib/source/parser/lux/meta/type.lux b/stdlib/source/parser/lux/meta/type.lux index 2b03a75e1..6f31848ae 100644 --- a/stdlib/source/parser/lux/meta/type.lux +++ b/stdlib/source/parser/lux/meta/type.lux @@ -314,7 +314,7 @@ (do [! //.monad] [headT any] (case (/.anonymous headT) - (pattern {.#Apply (|recursion_dummy|) {.#UnivQ _ headT'}}) + {.#Apply (|recursion_dummy|) {.#UnivQ _ headT'}} (do ! [[recT _ output] (|> poly (with_extension (|recursion_dummy|)) @@ -331,7 +331,7 @@ [env ..env headT any] (case (/.anonymous headT) - (^.multi (pattern {.#Apply (|recursion_dummy|) {.#Parameter funcT_idx}}) + (^.multi {.#Apply (|recursion_dummy|) {.#Parameter funcT_idx}} (n.= 0 (..argument env funcT_idx)) [(dictionary.value 0 env) {.#Some [self_type self_call]}]) (in self_call) diff --git a/stdlib/source/parser/lux/tool/compiler/language/lux/analysis.lux b/stdlib/source/parser/lux/tool/compiler/language/lux/analysis.lux index 7c7e8b855..5e818aa29 100644 --- a/stdlib/source/parser/lux/tool/compiler/language/lux/analysis.lux +++ b/stdlib/source/parser/lux/tool/compiler/language/lux/analysis.lux @@ -91,7 +91,7 @@ (Parser <type>) (function (_ input) (case input - (pattern (list.partial (<tag> x) input')) + (list.partial (<tag> x) input') {try.#Success [input' x]} _ @@ -101,7 +101,7 @@ (-> <type> (Parser Any)) (function (_ input) (case input - (pattern (list.partial (<tag> actual) input')) + (list.partial (<tag> actual) input') (if (at <eq> = expected actual) {try.#Success [input' []]} (exception.except ..cannot_parse input)) @@ -124,7 +124,7 @@ (All (_ a) (-> (Parser a) (Parser a))) (function (_ input) (case input - (pattern (list.partial (/.tuple head) tail)) + (list.partial (/.tuple head) tail) (do try.monad [output (..result parser head)] {try.#Success [tail output]}) diff --git a/stdlib/source/parser/lux/tool/compiler/language/lux/synthesis.lux b/stdlib/source/parser/lux/tool/compiler/language/lux/synthesis.lux index de0c5d1ac..2117dabd0 100644 --- a/stdlib/source/parser/lux/tool/compiler/language/lux/synthesis.lux +++ b/stdlib/source/parser/lux/tool/compiler/language/lux/synthesis.lux @@ -95,7 +95,7 @@ (Parser <type>) (.function (_ input) (case input - (pattern (list.partial (<tag> x) input')) + (list.partial (<tag> x) input') {try.#Success [input' x]} _ @@ -105,7 +105,7 @@ (-> <type> (Parser Any)) (.function (_ input) (case input - (pattern (list.partial (<tag> actual) input')) + (list.partial (<tag> actual) input') (if (at <eq> = expected actual) {try.#Success [input' []]} (exception.except ..cannot_parse input)) @@ -126,7 +126,7 @@ (All (_ a) (-> (Parser a) (Parser a))) (.function (_ input) (case input - (pattern (list.partial (/.tuple head) tail)) + (list.partial (/.tuple head) tail) (do try.monad [output (..result parser head)] {try.#Success [tail output]}) @@ -138,7 +138,7 @@ (All (_ a) (-> Arity (Parser a) (Parser [(Environment Synthesis) a]))) (.function (_ input) (case input - (pattern (list.partial (/.function/abstraction [environment actual body]) tail)) + (list.partial (/.function/abstraction [environment actual body]) tail) (if (n.= expected actual) (do try.monad [output (..result parser (list body))] @@ -152,7 +152,7 @@ (All (_ a b) (-> (Parser a) (Parser b) (Parser [Register a b]))) (.function (_ input) (case input - (pattern (list.partial (/.loop/scope [start inits iteration]) tail)) + (list.partial (/.loop/scope [start inits iteration]) tail) (do try.monad [inits (..result init_parsers inits) iteration (..result iteration_parser (list iteration))] diff --git a/stdlib/source/program/aedifex.lux b/stdlib/source/program/aedifex.lux index 044ca9e4d..319ed87ad 100644 --- a/stdlib/source/program/aedifex.lux +++ b/stdlib/source/program/aedifex.lux @@ -87,7 +87,7 @@ profile) [exit_code output] ((command console program (file.async file.default) (shell.async shell.default) resolution) profile) _ (case exit_code - (pattern (static shell.normal)) + (static shell.normal) (in []) _ diff --git a/stdlib/source/program/aedifex/command/build.lux b/stdlib/source/program/aedifex/command/build.lux index 38738e400..b20dd16a6 100644 --- a/stdlib/source/program/aedifex/command/build.lux +++ b/stdlib/source/program/aedifex/command/build.lux @@ -105,7 +105,7 @@ {.#Some dependency} (case lux_name (^.with_template [<tag> <name>] - [(pattern (static <name>)) + [(static <name>) {try.#Success [(..remove_dependency dependency resolution) {<tag> dependency}]}]) ([#JVM ..jvm_lux_name] diff --git a/stdlib/source/program/aedifex/metadata/snapshot.lux b/stdlib/source/program/aedifex/metadata/snapshot.lux index c524ddefb..78b0e8c55 100644 --- a/stdlib/source/program/aedifex/metadata/snapshot.lux +++ b/stdlib/source/program/aedifex/metadata/snapshot.lux @@ -99,7 +99,7 @@ (is (-> (List ///artifact/snapshot/version.Version) (List ///artifact/snapshot/version.Version)) (|>> (pipe.case - (pattern (list)) + (list) (list <default_version>) versions diff --git a/stdlib/source/program/aedifex/repository/remote.lux b/stdlib/source/program/aedifex/repository/remote.lux index 75d9a3468..9d5a0f134 100644 --- a/stdlib/source/program/aedifex/repository/remote.lux +++ b/stdlib/source/program/aedifex/repository/remote.lux @@ -69,7 +69,7 @@ {.#None} http))] (case status - (pattern (static http/status.ok)) + (static http/status.ok) (at ! each product.right ((the @http.#body message) {.#None})) _ @@ -92,7 +92,7 @@ http)) _ ((the @http.#body message) {.#Some 0})] (case status - (pattern (static http/status.created)) + (static http/status.created) (in []) _ diff --git a/stdlib/source/test/lux.lux b/stdlib/source/test/lux.lux index 1452a1aed..a857eee53 100644 --- a/stdlib/source/test/lux.lux +++ b/stdlib/source/test/lux.lux @@ -173,7 +173,7 @@ (all _.and (_.coverage [/.list] (case (/.list e/0 e/1) - (pattern (/.list a/0 a/1)) + (/.list a/0 a/1) (and (n.= e/0 a/0) (n.= e/1 a/1)) @@ -550,7 +550,7 @@ (same? /.Nat (/.type_of expected))) (_.coverage [/.Primitive] (case (/.Primitive "foo" [expected/0 expected/1]) - (pattern {.#Primitive "foo" (list actual/0 actual/1)}) + {.#Primitive "foo" (list actual/0 actual/1)} (and (same? expected/0 actual/0) (same? expected/1 actual/1)) @@ -681,8 +681,8 @@ (all _.and (_.coverage [/.static] (case sample - (pattern (/.static option/0)) true - (pattern (/.static option/1)) true + (/.static option/0) true + (/.static option/1) true _ false)) (_.coverage [/.char] (|> (`` (/.char (,, (/.static static_char)))) @@ -982,10 +982,13 @@ {.#Right +0} true _ false) )) - (_.coverage [/.pattern] - (/.case [..#left expected_nat ..#right expected_int] - (/.pattern (!pair 0 +0)) true - _ false)) + ... (_.coverage [/.pattern] + ... (/.case [..#left expected_nat ..#right expected_int] + ... (!pair 0 +0) + ... true + + ... _ + ... false)) (_.coverage [/.let] (and (/.let [actual_nat expected_nat] (/.same? expected_nat actual_nat)) @@ -1105,7 +1108,7 @@ let/3 <code>.local]) (in (list (code.bit (case (the .#scopes lux_state) - (pattern (list.partial scope/2 _)) + (list.partial scope/2 _) (let [locals/2 (the .#locals scope/2) expected_locals/2 (set.of_list text.hash (list fn/2 var/2 let/2 let/3)) diff --git a/stdlib/source/test/lux/abstract/apply.lux b/stdlib/source/test/lux/abstract/apply.lux index d7c75cbe2..b120b3484 100644 --- a/stdlib/source/test/lux/abstract/apply.lux +++ b/stdlib/source/test/lux/abstract/apply.lux @@ -28,7 +28,7 @@ (case (at (/.composite maybe.monad maybe.apply list.apply) on {.#Some (list right)} {.#Some (list (n.+ left))}) - (pattern {.#Some (list actual)}) + {.#Some (list actual)} (n.= expected actual) _ diff --git a/stdlib/source/test/lux/abstract/functor.lux b/stdlib/source/test/lux/abstract/functor.lux index 9cca3367b..548acee7a 100644 --- a/stdlib/source/test/lux/abstract/functor.lux +++ b/stdlib/source/test/lux/abstract/functor.lux @@ -63,7 +63,7 @@ (case (at (/.sum maybe.functor list.functor) each (n.+ shift) {.#Right (list right)}) - (pattern {.#Right (list actual)}) + {.#Right (list actual)} (n.= (n.+ shift right) actual) _ @@ -72,7 +72,7 @@ (case (at (/.product maybe.functor list.functor) each (n.+ shift) [{.#Some left} (list right)]) - (pattern [{.#Some actualL} (list actualR)]) + [{.#Some actualL} (list actualR)] (and (n.= (n.+ shift left) actualL) (n.= (n.+ shift right) actualR)) @@ -82,7 +82,7 @@ (case (at (/.composite maybe.functor list.functor) each (n.+ shift) {.#Some (list left)}) - (pattern {.#Some (list actual)}) + {.#Some (list actual)} (n.= (n.+ shift left) actual) _ diff --git a/stdlib/source/test/lux/abstract/interval.lux b/stdlib/source/test/lux/abstract/interval.lux index 2fa7f5023..438a02394 100644 --- a/stdlib/source/test/lux/abstract/interval.lux +++ b/stdlib/source/test/lux/abstract/interval.lux @@ -142,7 +142,7 @@ (at ! each (|>> set.list (list.sorted n.<) (pipe.case - (pattern (list b t1 t2)) + (list b t1 t2) [b t1 t2] _ @@ -165,7 +165,7 @@ (at ! each (|>> set.list (list.sorted n.<) (pipe.case - (pattern (list b t1 t2)) + (list b t1 t2) [b t1 t2] _ @@ -193,7 +193,7 @@ (at ! each (|>> set.list (list.sorted n.<) (pipe.case - (pattern (list x0 x1 x2 x3)) + (list x0 x1 x2 x3) [x0 x1 x2 x3] _ @@ -227,7 +227,7 @@ (at ! each (|>> set.list (list.sorted n.<) (pipe.case - (pattern (list x0 x1 x2 x3)) + (list x0 x1 x2 x3) [x0 x1 x2 x3] _ diff --git a/stdlib/source/test/lux/control/concurrency/actor.lux b/stdlib/source/test/lux/control/concurrency/actor.lux index 218dfcb3d..d3ecb4887 100644 --- a/stdlib/source/test/lux/control/concurrency/actor.lux +++ b/stdlib/source/test/lux/control/concurrency/actor.lux @@ -143,7 +143,7 @@ (in {try.#Success [actor sent? alive? obituary]})))] (_.coverage' [/.Obituary /.obituary'] (case result - (pattern {try.#Success [actor sent? alive? {.#Some [error state (list single_pending_message)]}]}) + {try.#Success [actor sent? alive? {.#Some [error state (list single_pending_message)]}]} (and (..mailed? sent?) (not alive?) (exception.match? ..got_wrecked error) diff --git a/stdlib/source/test/lux/control/parser.lux b/stdlib/source/test/lux/control/parser.lux index 2a7139b86..31b5ac78a 100644 --- a/stdlib/source/test/lux/control/parser.lux +++ b/stdlib/source/test/lux/control/parser.lux @@ -69,7 +69,7 @@ then <code>.any input <code>.any]) (in (list (` (case (, input) - (pattern {try.#Success [(,' _) (, pattern)]}) + {try.#Success [(,' _) (, pattern)]} (, then) (,' _) diff --git a/stdlib/source/test/lux/control/remember.lux b/stdlib/source/test/lux/control/remember.lux index 9f79123c1..83dc740e8 100644 --- a/stdlib/source/test/lux/control/remember.lux +++ b/stdlib/source/test/lux/control/remember.lux @@ -92,13 +92,13 @@ _ false) (case should_succeed0 - (pattern {try.#Success (list)}) + {try.#Success (list)} true _ false) (case should_succeed1 - (pattern {try.#Success (list actual)}) + {try.#Success (list actual)} (same? expected actual) _ diff --git a/stdlib/source/test/lux/data/collection/array.lux b/stdlib/source/test/lux/data/collection/array.lux index d2be45fa4..ebe7676a0 100644 --- a/stdlib/source/test/lux/data/collection/array.lux +++ b/stdlib/source/test/lux/data/collection/array.lux @@ -156,9 +156,9 @@ (!.empty size))))) (_.coverage [!.type] (case !.Array - (pattern (<| {.#Named (symbol !.Array)} - {.#UnivQ (list)} - {.#Primitive nominal_type (list {.#Parameter 1})})) + (<| {.#Named (symbol !.Array)} + {.#UnivQ (list)} + {.#Primitive nominal_type (list {.#Parameter 1})}) (same? !.type nominal_type) _ @@ -324,10 +324,10 @@ (/.empty size))))) (_.coverage [/.type_name] (case /.Array - (pattern (<| {.#Named (symbol /.Array)} - {.#Named (symbol !.Array)} - {.#UnivQ (list)} - {.#Primitive nominal_type (list {.#Parameter 1})})) + (<| {.#Named (symbol /.Array)} + {.#Named (symbol !.Array)} + {.#UnivQ (list)} + {.#Primitive nominal_type (list {.#Parameter 1})}) (same? /.type_name nominal_type) _ diff --git a/stdlib/source/test/lux/data/collection/list.lux b/stdlib/source/test/lux/data/collection/list.lux index 2e5734c23..f915d4316 100644 --- a/stdlib/source/test/lux/data/collection/list.lux +++ b/stdlib/source/test/lux/data/collection/list.lux @@ -77,7 +77,7 @@ b (in subject)] (in (n.+ a b)))) (pipe.case - (pattern (list actual)) + (list actual) (n.= expected actual) _ diff --git a/stdlib/source/test/lux/data/format/json.lux b/stdlib/source/test/lux/data/format/json.lux index 0e7ec6b44..8eb35a192 100644 --- a/stdlib/source/test/lux/data/format/json.lux +++ b/stdlib/source/test/lux/data/format/json.lux @@ -151,7 +151,7 @@ [boolean_field number_field string_field] (|> (random.set text.hash 3 (random.unicode 3)) (at ! each (|>> set.list (pipe.case - (pattern (list boolean_field number_field string_field)) + (list boolean_field number_field string_field) [boolean_field number_field string_field] _ diff --git a/stdlib/source/test/lux/data/format/tar.lux b/stdlib/source/test/lux/data/format/tar.lux index 817c38c5a..7f695042d 100644 --- a/stdlib/source/test/lux/data/format/tar.lux +++ b/stdlib/source/test/lux/data/format/tar.lux @@ -174,7 +174,7 @@ (\\format.result /.format) (<b>.result /.parser))] (in (case (sequence.list tar) - (pattern (list {<tag> actual_path})) + (list {<tag> actual_path}) (text#= (/.from_path expected_path) (/.from_path actual_path)) @@ -203,7 +203,7 @@ (\\format.result /.format) (<b>.result /.parser))] (in (case (sequence.list tar) - (pattern (list {<tag> [actual_path actual_moment actual_mode actual_ownership actual_content]})) + (list {<tag> [actual_path actual_moment actual_mode actual_ownership actual_content]}) (let [seconds (is (-> Instant Int) (|>> instant.relative (duration.ticks duration.second)))] (and (text#= (/.from_path expected_path) @@ -261,7 +261,7 @@ (\\format.result /.format) (<b>.result /.parser))] (in (case (sequence.list tar) - (pattern (list {/.#Normal [_ _ actual_mode _ _]})) + (list {/.#Normal [_ _ actual_mode _ _]}) (n.= (/.mode expected_mode) (/.mode actual_mode)) @@ -284,7 +284,7 @@ (\\format.result /.format) (<b>.result /.parser))] (in (case (sequence.list tar) - (pattern (list {/.#Normal [_ _ actual_mode _ _]})) + (list {/.#Normal [_ _ actual_mode _ _]}) (n.= (/.mode <expected_mode>) (/.mode actual_mode)) @@ -351,7 +351,7 @@ (\\format.result /.format) (<b>.result /.parser))] (in (case (sequence.list tar) - (pattern (list {/.#Normal [_ _ _ actual_ownership _]})) + (list {/.#Normal [_ _ _ actual_ownership _]}) (and (text#= (/.from_name expected) (/.from_name (the [/.#user /.#name] actual_ownership))) (text#= (/.from_name /.anonymous) @@ -375,7 +375,7 @@ (\\format.result /.format) (<b>.result /.parser))] (in (case (sequence.list tar) - (pattern (list {/.#Normal [_ _ _ actual_ownership _]})) + (list {/.#Normal [_ _ _ actual_ownership _]}) (and (text#= (/.from_name /.anonymous) (/.from_name (the [/.#user /.#name] actual_ownership))) (n.= (/.from_small /.no_id) diff --git a/stdlib/source/test/lux/data/text/regex.lux b/stdlib/source/test/lux/data/text/regex.lux index faadefa50..48b376358 100644 --- a/stdlib/source/test/lux/data/text/regex.lux +++ b/stdlib/source/test/lux/data/text/regex.lux @@ -63,7 +63,7 @@ (in (list (` (|> (, input) (<text>.result (, regex)) (pipe.case - (pattern {try.#Success (, pattern)}) + {try.#Success (, pattern)} true (, g!_) diff --git a/stdlib/source/test/lux/documentation.lux b/stdlib/source/test/lux/documentation.lux index 37aff4544..c9d9cbc43 100644 --- a/stdlib/source/test/lux/documentation.lux +++ b/stdlib/source/test/lux/documentation.lux @@ -55,7 +55,7 @@ (all _.and (_.coverage [/.default] (case (`` (/.default (,, (template.symbol [.._] [g!default])))) - (pattern (list definition)) + (list definition) (and (|> definition (the /.#definition) (text#= (template.text [g!default]))) @@ -69,7 +69,7 @@ false)) (_.coverage [/.documentation] (case ..documentation - (pattern (list documentation)) + (list documentation) (and (|> documentation (the /.#definition) (text#= (template.text [/.documentation]))) @@ -99,7 +99,7 @@ (text.contains? (template.text ['super_description']) (/.markdown super)) (case ..documentation - (pattern (list documentation)) + (list documentation) (text.contains? (md.markdown (the /.#documentation documentation)) (/.markdown super)) diff --git a/stdlib/source/test/lux/math/logic/fuzzy.lux b/stdlib/source/test/lux/math/logic/fuzzy.lux index 8336d39ef..5011e2eee 100644 --- a/stdlib/source/test/lux/math/logic/fuzzy.lux +++ b/stdlib/source/test/lux/math/logic/fuzzy.lux @@ -92,7 +92,7 @@ (at ! each (|>> set.list (list.sorted r.<))) (random.one (function (_ thresholds) (case thresholds - (pattern (list threshold_0 threshold_1 threshold_2 threshold_3)) + (list threshold_0 threshold_1 threshold_2 threshold_3) {.#Some [threshold_0 threshold_1 threshold_2 threshold_3]} _ @@ -176,7 +176,7 @@ (at ! each (|>> set.list (list.sorted r.<))) (random.one (function (_ thresholds) (case thresholds - (pattern (list threshold_0 threshold_1 threshold_2 threshold_3)) + (list threshold_0 threshold_1 threshold_2 threshold_3) {.#Some [threshold_0 threshold_1 threshold_2 threshold_3]} _ diff --git a/stdlib/source/test/lux/meta.lux b/stdlib/source/test/lux/meta.lux index 5cd2da267..ea47a6fc7 100644 --- a/stdlib/source/test/lux/meta.lux +++ b/stdlib/source/test/lux/meta.lux @@ -813,7 +813,7 @@ (at ! each set.list) (random.one (function (_ values) (case values - (pattern (list name_0 name_1 name_2 name_3 name_4)) + (list name_0 name_1 name_2 name_3 name_4) {.#Some [name_0 name_1 name_2 name_3 name_4]} _ diff --git a/stdlib/source/test/lux/meta/macro/pattern.lux b/stdlib/source/test/lux/meta/macro/pattern.lux index 7b9e161c1..6d5e3c559 100644 --- a/stdlib/source/test/lux/meta/macro/pattern.lux +++ b/stdlib/source/test/lux/meta/macro/pattern.lux @@ -64,7 +64,7 @@ (let [expected_pair (is (Pair Nat Int) [..#left expected_nat ..#right expected_int])] (/.case expected_pair - (/.let actual_pair (/.pattern (!pair actual_left actual_right))) + (/.let actual_pair (!pair actual_left actual_right)) (and (/.same? expected_pair actual_pair) (/.same? expected_nat actual_left) (/.same? expected_int actual_right))))) @@ -72,7 +72,7 @@ (let [expected_pair (is (Pair Nat Int) [..#left expected_nat ..#right expected_int])] (and (/.case expected_pair - (/.multi (/.pattern (!pair 0 actual_right)) + (/.multi (!pair 0 actual_right) [actual_right +0]) true @@ -80,7 +80,7 @@ _ false) (/.case expected_pair - (/.multi (/.pattern (!pair 0 actual_right)) + (/.multi (!pair 0 actual_right) (i.= +0 actual_right)) true diff --git a/stdlib/source/test/lux/meta/type.lux b/stdlib/source/test/lux/meta/type.lux index d00adca34..9a78cd392 100644 --- a/stdlib/source/test/lux/meta/type.lux +++ b/stdlib/source/test/lux/meta/type.lux @@ -483,7 +483,7 @@ element_type (|> (..random 0) (random.only (function (_ type) (case type - (pattern {.#Primitive name (list element_type)}) + {.#Primitive name (list element_type)} (not (text#= array.type_name name)) _ diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis.lux index afa79d64e..a42a76432 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/analysis.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis.lux @@ -243,7 +243,7 @@ (`` (all _.and (_.coverage [/.unit] (case (/.unit) - (pattern (/.unit)) + (/.unit) true _ @@ -251,7 +251,7 @@ (,, (with_template [<tag> <expected>] [(_.coverage [<tag>] (case (<tag> <expected>) - (pattern (<tag> actual)) + (<tag> actual) (same? <expected> actual) _ @@ -278,7 +278,7 @@ expected_right expected_left)] (case (/.variant [expected_lefts expected_right? expected]) - (pattern (/.variant [actual_lefts actual_right? actual])) + (/.variant [actual_lefts actual_right? actual]) (and (same? expected_lefts actual_lefts) (same? expected_right? actual_right?) (same? expected actual)) @@ -287,7 +287,7 @@ false))) (_.coverage [/.tuple] (case (/.tuple (list expected_left expected_right)) - (pattern (/.tuple (list actual_left actual_right))) + (/.tuple (list actual_left actual_right)) (and (same? expected_left actual_left) (same? expected_right actual_right)) @@ -305,7 +305,7 @@ (,, (with_template [<tag> <expected>] [(_.coverage [<tag>] (case (<tag> <expected>) - (pattern (<tag> actual)) + (<tag> actual) (same? <expected> actual) _ @@ -339,7 +339,7 @@ (case (|> [expected_abstraction (list expected_parameter/0 expected_parameter/1)] /.reified /.reification) - (pattern [actual_abstraction (list actual_parameter/0 actual_parameter/1)]) + [actual_abstraction (list actual_parameter/0 actual_parameter/1)] (and (same? expected_abstraction actual_abstraction) (same? expected_parameter/0 actual_parameter/0) (same? expected_parameter/1 actual_parameter/1)) @@ -348,7 +348,7 @@ false)) (_.coverage [/.no_op] (case (/.no_op expected_parameter/0) - (pattern (/.no_op actual)) + (/.no_op actual) (same? expected_parameter/0 actual) _ @@ -363,7 +363,7 @@ (all _.and (_.coverage [/.case] (case (/.case [expected_input expected_match]) - (pattern (/.case [actual_input actual_match])) + (/.case [actual_input actual_match]) (and (same? expected_input actual_input) (same? expected_match actual_match)) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/coverage.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/coverage.lux index eb47e634e..417413fb0 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/coverage.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/coverage.lux @@ -1,6 +1,6 @@ (.require [library - [lux (.except) + [lux (.except Pattern) ["_" test (.only Test)] [abstract ["[0]" monad (.only do)] diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/module.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/module.lux index 567992ebc..7a68264d7 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/module.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/module.lux @@ -122,7 +122,7 @@ (/phase.result state) (try#each (|>> (the .#module_aliases) (pipe.case - (pattern (list [actual_alias actual_import])) + (list [actual_alias actual_import]) (and (same? expected_alias actual_alias) (same? expected_import actual_import)) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/pattern.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/pattern.lux index 7c1ab849a..e3034f93c 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/pattern.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/pattern.lux @@ -56,7 +56,7 @@ (text#= (/.format left) (/.format right)))) (_.coverage [/.unit] (case (/.unit) - (pattern (/.unit)) + (/.unit) true _ @@ -64,7 +64,7 @@ (,, (with_template [<tag> <value>] [(_.coverage [<tag>] (case (<tag> <value>) - (pattern (<tag> actual)) + (<tag> actual) (same? <value> actual) _ @@ -80,7 +80,7 @@ )) (_.coverage [/.variant] (case (/.variant [expected_lefts expected_right? (/.text expected_text)]) - (pattern (/.variant [actual_lefts actual_right? (/.text actual_text)])) + (/.variant [actual_lefts actual_right? (/.text actual_text)]) (and (same? expected_lefts actual_lefts) (same? expected_right? actual_right?) (same? expected_text actual_text)) @@ -94,12 +94,12 @@ (/.rev expected_rev) (/.frac expected_frac) (/.text expected_text))) - (pattern (/.tuple (list (/.bit actual_bit) - (/.nat actual_nat) - (/.int actual_int) - (/.rev actual_rev) - (/.frac actual_frac) - (/.text actual_text)))) + (/.tuple (list (/.bit actual_bit) + (/.nat actual_nat) + (/.int actual_int) + (/.rev actual_rev) + (/.frac actual_frac) + (/.text actual_text))) (and (same? expected_bit actual_bit) (same? expected_nat actual_nat) (same? expected_int actual_int) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis.lux index 317a4ec53..91614f4b2 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis.lux @@ -65,7 +65,7 @@ //type.inferring)] (in (and (type#= .Any :it:) (case it - (pattern (//.unit)) + (//.unit) true _ @@ -88,7 +88,7 @@ //type.inferring)] (in (and (type#= <type> :it:) (case it - (pattern (<analysis> it)) + (<analysis> it) (same? <expected> it) _ @@ -129,7 +129,7 @@ (/.phase ..expander archive.empty) (//type.expecting :variant:))] (in (case it - (pattern (//.variant [0 #0 (//.unit)])) + (//.variant [0 #0 (//.unit)]) true _ @@ -145,7 +145,7 @@ (/.phase ..expander archive.empty) (//type.expecting :variant:))] (in (case it - (pattern (//.variant [<lefts> <right> (<analysis> actual)])) + (//.variant [<lefts> <right> (<analysis> actual)]) (same? <expected> actual) _ @@ -171,7 +171,7 @@ (/.phase ..expander archive.empty) (//type.expecting :either:))] (in (case it - (pattern (//.variant [0 #0 (//.unit)])) + (//.variant [0 #0 (//.unit)]) true _ @@ -197,13 +197,13 @@ (/.phase ..expander archive.empty) (//type.expecting :either:))] (in (case it - (pattern (//.variant [0 #1 (//.tuple (list (//.unit) - (//.bit bit/?) - (//.nat nat/?) - (//.int int/?) - (//.rev rev/?) - (//.frac frac/?) - (//.text text/?)))])) + (//.variant [0 #1 (//.tuple (list (//.unit) + (//.bit bit/?) + (//.nat nat/?) + (//.int int/?) + (//.rev rev/?) + (//.frac frac/?) + (//.text text/?)))]) (and (same? bit/0 bit/?) (same? nat/0 nat/?) (same? int/0 int/?) @@ -243,7 +243,7 @@ (in (and (type#= :variant: :it:) (case it - (pattern (//.variant [0 #0 (//.unit)])) + (//.variant [0 #0 (//.unit)]) true _ @@ -262,7 +262,7 @@ (in (and (type#= :variant: :it:) (case it - (pattern (//.variant [<lefts> <right> (<analysis> actual)])) + (//.variant [<lefts> <right> (<analysis> actual)]) (same? <expected> actual) _ @@ -293,7 +293,7 @@ (in (and (type#= :either: :it:) (case it - (pattern (//.variant [0 #0 (//.unit)])) + (//.variant [0 #0 (//.unit)]) true _ @@ -323,13 +323,13 @@ (in (and (type#= :either: :it:) (case it - (pattern (//.variant [0 #1 (//.tuple (list (//.unit) - (//.bit bit/?) - (//.nat nat/?) - (//.int int/?) - (//.rev rev/?) - (//.frac frac/?) - (//.text text/?)))])) + (//.variant [0 #1 (//.tuple (list (//.unit) + (//.bit bit/?) + (//.nat nat/?) + (//.int int/?) + (//.rev rev/?) + (//.frac frac/?) + (//.text text/?)))]) (and (same? bit/0 bit/?) (same? nat/0 nat/?) (same? int/0 int/?) @@ -365,13 +365,13 @@ (in (and (type#= (type_literal [.Any .Bit .Nat .Int .Rev .Frac .Text]) :it:) (case it - (pattern (//.tuple (list (//.unit) - (//.bit bit/?) - (//.nat nat/?) - (//.int int/?) - (//.rev rev/?) - (//.frac frac/?) - (//.text text/?)))) + (//.tuple (list (//.unit) + (//.bit bit/?) + (//.nat nat/?) + (//.int int/?) + (//.rev rev/?) + (//.frac frac/?) + (//.text text/?))) (and (same? bit/0 bit/?) (same? nat/0 nat/?) (same? int/0 int/?) @@ -408,13 +408,13 @@ (in (and (type#= :record: :it:) (case it - (pattern (//.tuple (list (//.unit) - (//.bit bit/?) - (//.nat nat/?) - (//.int int/?) - (//.rev rev/?) - (//.frac frac/?) - (//.text text/?)))) + (//.tuple (list (//.unit) + (//.bit bit/?) + (//.nat nat/?) + (//.int int/?) + (//.rev rev/?) + (//.frac frac/?) + (//.text text/?))) (and (same? bit/0 bit/?) (same? nat/0 nat/?) (same? int/0 int/?) @@ -443,7 +443,7 @@ (in (and (type#= (All (_ a) (-> a .Nat)) :it:) (case it - (pattern {//.#Function (list) (//.nat nat/?)}) + {//.#Function (list) (//.nat nat/?)} (same? nat/0 nat/?) _ @@ -464,7 +464,7 @@ (in (and (type#= (All (_ a) (-> a (All (_ b) (-> b .Nat)))) :it:) (case it - (pattern {//.#Function (list) {//.#Function (list) (//.nat nat/?)}}) + {//.#Function (list) {//.#Function (list) (//.nat nat/?)}} (same? nat/0 nat/?) _ @@ -485,7 +485,7 @@ (in (and (type#= (All (_ a) (-> a (All (_ b) (-> b b)))) :it:) (case it - (pattern {//.#Function (list) {//.#Function (list) (//.local 1)}}) + {//.#Function (list) {//.#Function (list) (//.local 1)}} true _ @@ -504,7 +504,7 @@ (/.phase ..expander archive.empty) //type.inferring)] (in (and (case it - (pattern {//.#Function (list) {//.#Function (list (//.local 1)) (//.foreign 0)}}) + {//.#Function (list) {//.#Function (list (//.local 1)) (//.foreign 0)}} true _ @@ -530,7 +530,7 @@ ... (/.phase ..expander archive.empty) ... //type.inferring)] ... (in (case it - ... (pattern {//.#Function (list) {//.#Function (list) (//.local 0)}}) + ... {//.#Function (list) {//.#Function (list) (//.local 0)}} ... true ... _ @@ -548,7 +548,7 @@ ... (/.phase ..expander archive.empty) ... //type.inferring)] ... (in (case it - ... (pattern {//.#Function (list) {//.#Function (list (//.local 0)) (//.foreign 0)}}) + ... {//.#Function (list) {//.#Function (list (//.local 0)) (//.foreign 0)}} ... true ... _ @@ -573,8 +573,8 @@ //type.inferring)] (in (and (type#= .Bit :it:) (case it - (pattern {//.#Apply (//.nat nat/?) - {//.#Function (list) (//.bit bit/?)}}) + {//.#Apply (//.nat nat/?) + {//.#Function (list) (//.bit bit/?)}} (and (same? bit/0 bit/?) (same? nat/0 nat/?)) @@ -594,8 +594,8 @@ //type.inferring)] (in (and (type#= .Nat :it:) (case it - (pattern {//.#Apply (//.nat nat/?) - {//.#Function (list) (//.local 1)}}) + {//.#Apply (//.nat nat/?) + {//.#Function (list) (//.local 1)}} (same? nat/0 nat/?) _ @@ -616,9 +616,9 @@ //type.inferring)] (in (and (check.subsumes? (All (_ a) (-> a Bit)) :it:) (case it - (pattern {//.#Apply (//.nat nat/?) - {//.#Function (list) - {//.#Function (list) (//.bit bit/?)}}}) + {//.#Apply (//.nat nat/?) + {//.#Function (list) + {//.#Function (list) (//.bit bit/?)}}} (and (same? bit/0 bit/?) (same? nat/0 nat/?)) @@ -643,7 +643,7 @@ //type.inferring)] (in (and (type#= .Text :it:) (case it - (pattern {//.#Extension "lux text concat" (list (//.text left) (//.text right))}) + {//.#Extension "lux text concat" (list (//.text left) (//.text right))} (and (same? text/0 left) (same? text/0 right)) @@ -676,10 +676,10 @@ //type.inferring)] (in (and (type#= .Frac :it:) (case it - (pattern {//.#Case (<analysis> input/?) - [[//.#when (//pattern.bind 0) - //.#then (//.frac frac/?)] - (list)]}) + {//.#Case (<analysis> input/?) + [[//.#when (//pattern.bind 0) + //.#then (//.frac frac/?)] + (list)]} (and (same? <input> input/?) (same? frac/0 frac/?)) @@ -701,11 +701,11 @@ //type.inferring)] (in (and (type#= .Frac :it:) (case it - (pattern {//.#Case (<analysis> input/?) - [[//.#when (<pattern> pattern/?) - //.#then (//.frac frac/?)] - (list [//.#when (//pattern.bind 0) - //.#then (//.frac frac/?)])]}) + {//.#Case (<analysis> input/?) + [[//.#when (<pattern> pattern/?) + //.#then (//.frac frac/?)] + (list [//.#when (//pattern.bind 0) + //.#then (//.frac frac/?)])]} (and (same? <input> input/?) (same? <input> pattern/?) (same? frac/0 frac/?)) @@ -738,11 +738,11 @@ //type.inferring)] (in (and (type#= .Frac :it:) (case it - (pattern {//.#Case (//.bit bit/?) - [[//.#when (//pattern.bit #0) - //.#then (//.frac false/?)] - (list [//.#when (//pattern.bit #1) - //.#then (//.frac true/?)])]}) + {//.#Case (//.bit bit/?) + [[//.#when (//pattern.bit #0) + //.#then (//.frac false/?)] + (list [//.#when (//pattern.bit #1) + //.#then (//.frac true/?)])]} (and (same? bit/0 bit/?) (same? frac/0 false/?) (same? frac/0 true/?)) @@ -769,11 +769,11 @@ //type.inferring)] (in (and (type#= .Frac :it:) (case it - (pattern {//.#Case (//.variant [<lefts> <right?> (<analysis> analysis/?)]) - [[//.#when (//pattern.variant [<lefts> <right?> (<pattern> pattern/?)]) - //.#then (//.frac match/?)] - (list [//.#when (//pattern.bind 0) - //.#then (//.frac mismatch/?)])]}) + {//.#Case (//.variant [<lefts> <right?> (<analysis> analysis/?)]) + [[//.#when (//pattern.variant [<lefts> <right?> (<pattern> pattern/?)]) + //.#then (//.frac match/?)] + (list [//.#when (//pattern.bind 0) + //.#then (//.frac mismatch/?)])]} (and (same? <expected> analysis/?) (same? <expected> pattern/?) (same? frac/0 match/?) @@ -808,11 +808,11 @@ //type.inferring)] (in (and (type#= .Frac :it:) (case it - (pattern {//.#Case (//.tuple (list (//.bit bit/?) (//.nat nat/?))) - [[//.#when (//pattern.tuple (list (//pattern.bit #0) (//pattern.bind 0))) - //.#then (//.frac false/?)] - (list [//.#when (//pattern.tuple (list (//pattern.bit #1) (//pattern.bind 0))) - //.#then (//.frac true/?)])]}) + {//.#Case (//.tuple (list (//.bit bit/?) (//.nat nat/?))) + [[//.#when (//pattern.tuple (list (//pattern.bit #0) (//pattern.bind 0))) + //.#then (//.frac false/?)] + (list [//.#when (//pattern.tuple (list (//pattern.bit #1) (//pattern.bind 0))) + //.#then (//.frac true/?)])]} (and (same? bit/0 bit/?) (same? nat/0 nat/?) (same? frac/0 false/?) @@ -851,23 +851,23 @@ //type.inferring)] (in (and (type#= .Frac :it:) (case it - (pattern {//.#Case (//.tuple (list (//.unit) - (//.bit bit/?) - (//.nat nat/?) - (//.int int/?) - (//.rev rev/?) - (//.frac frac/?) - (//.text text/?))) - [[//.#when (//pattern.tuple (list (//pattern.unit) - (//pattern.bit bit/?') - (//pattern.nat nat/?') - (//pattern.int int/?') - (//pattern.rev rev/?') - (//pattern.frac frac/?') - (//pattern.text text/?'))) - //.#then (//.frac match/?)] - (list [//.#when (//pattern.bind 0) - //.#then (//.frac mismatch/?)])]}) + {//.#Case (//.tuple (list (//.unit) + (//.bit bit/?) + (//.nat nat/?) + (//.int int/?) + (//.rev rev/?) + (//.frac frac/?) + (//.text text/?))) + [[//.#when (//pattern.tuple (list (//pattern.unit) + (//pattern.bit bit/?') + (//pattern.nat nat/?') + (//pattern.int int/?') + (//pattern.rev rev/?') + (//pattern.frac frac/?') + (//pattern.text text/?'))) + //.#then (//.frac match/?)] + (list [//.#when (//pattern.bind 0) + //.#then (//.frac mismatch/?)])]} (and (same? bit/0 bit/?) (same? bit/0 bit/?') (same? nat/0 nat/?) (same? nat/0 nat/?') (same? int/0 int/?) (same? int/0 int/?') diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/complex.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/complex.lux index 2e7b3e031..46232997f 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/complex.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/complex.lux @@ -105,10 +105,10 @@ (def (analysed? expected actual) (-> Code Analysis Bit) (case [expected actual] - (pattern [[_ {.#Tuple (list)}] (//analysis.unit)]) + [[_ {.#Tuple (list)}] (//analysis.unit)] true - (pattern [[_ {.#Tuple expected}] (//analysis.tuple actual)]) + [[_ {.#Tuple expected}] (//analysis.tuple actual)] (and (n.= (list.size expected) (list.size actual)) (list.every? (function (_ [expected actual]) @@ -116,7 +116,7 @@ (list.zipped_2 expected actual))) (^.with_template [<expected> <actual>] - [(pattern [[_ {<expected> expected}] (<actual> actual)]) + [[[_ {<expected> expected}] (<actual> actual)] (same? expected actual)]) ([.#Bit //analysis.bit] [.#Nat //analysis.nat] @@ -150,7 +150,7 @@ [analysis (|> (/.sum ..analysis lefts right? archive.empty code) (//type.expecting type))] (in (case analysis - (pattern (//analysis.variant [lefts' right?' analysis])) + (//analysis.variant [lefts' right?' analysis]) (and (n.= lefts lefts') (bit#= right? right?') (..analysed? code analysis)) @@ -169,7 +169,7 @@ analysis (|> (/.sum ..analysis lefts right? archive.empty tagC) (//type.expecting varT))] (in (case analysis - (pattern (//analysis.variant [lefts' right?' it])) + (//analysis.variant [lefts' right?' it]) (and (n.= lefts lefts') (bit#= right? right?') (..analysed? tagC it)) @@ -242,7 +242,7 @@ analysis (|> (/.variant ..analysis tag archive.empty tagC) (//type.expecting variantT))] (in (case analysis - (pattern (//analysis.variant [lefts' right?' analysis])) + (//analysis.variant [lefts' right?' analysis]) (and (n.= lefts lefts') (bit#= right? right?') (..analysed? tagC analysis)) @@ -260,7 +260,7 @@ [actualT analysis] (|> (/.variant ..analysis tag archive.empty tagC) //type.inferring)] (in (case analysis - (pattern (//analysis.variant [lefts' right?' analysis])) + (//analysis.variant [lefts' right?' analysis]) (and (n.= lefts lefts') (bit#= right? right?') (..analysed? tagC analysis) @@ -307,7 +307,7 @@ (/.product ..analysis archive.empty) (//type.expecting type))] (in (case analysis - (pattern (//analysis.tuple actual)) + (//analysis.tuple actual) (and (n.= (list.size expected) (list.size actual)) (list.every? (function (_ [expected actual]) @@ -332,7 +332,7 @@ (/.product ..analysis archive.empty) (//type.expecting varT))] (in (case analysis - (pattern (//analysis.tuple actual)) + (//analysis.tuple actual) (and (n.= (list.size expected) (list.size actual)) (list.every? (function (_ [expected actual]) @@ -350,7 +350,7 @@ (/.product ..analysis archive.empty) //type.inferring)] (in (case analysis - (pattern (//analysis.tuple actual)) + (//analysis.tuple actual) (and (n.= (list.size expected) (list.size actual)) (list.every? (function (_ [expected actual]) @@ -373,7 +373,7 @@ (list term/0 term/1 term/2 term/2 term/2)))) :inferred: (//type.check (check.clean (list @var) :inferred:))] (in (case analysis - (pattern (//analysis.tuple (list analysis/0 analysis/1 (//analysis.tuple (list analysis/2 analysis/3 analysis/4))))) + (//analysis.tuple (list analysis/0 analysis/1 (//analysis.tuple (list analysis/2 analysis/3 analysis/4)))) (and (type#= (Tuple type/0 type/1 type/2 type/2 type/2) :inferred:) (..analysed? term/0 analysis/0) @@ -393,7 +393,7 @@ (/.product ..analysis archive.empty) (//type.expecting (Tuple type/0 type/1 type/2 type/2 type/2)))] (in (case analysis - (pattern (//analysis.tuple (list analysis/0 analysis/1 (//analysis.tuple (list analysis/2 analysis/3 analysis/4))))) + (//analysis.tuple (list analysis/0 analysis/1 (//analysis.tuple (list analysis/2 analysis/3 analysis/4)))) (and (..analysed? term/0 analysis/0) (..analysed? term/1 analysis/1) (..analysed? term/2 analysis/2) @@ -523,7 +523,7 @@ (|> (/.order false (list)) (//phase.result state) (pipe.case - (pattern {try.#Success {.#Some [0 (list) actual_type]}}) + {try.#Success {.#Some [0 (list) actual_type]}} (same? .Any actual_type) _ diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/reference.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/reference.lux index d55bc1c2b..e88482764 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/reference.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/reference.lux @@ -55,7 +55,7 @@ (//phase.result state) (try#each (|>> product.right (pipe.case - (pattern [actual_type (//analysis.local 0)]) + [actual_type (//analysis.local 0)] (type#= expected_type actual_type) _ @@ -74,7 +74,7 @@ (try#each (|>> product.right product.right (pipe.case - (pattern [actual_type (//analysis.foreign 0)]) + [actual_type (//analysis.foreign 0)] (type#= expected_type actual_type) _ @@ -90,7 +90,7 @@ (//phase.result state) (try#each (|>> product.right (pipe.case - (pattern [actual_type (//analysis.constant [actual_module actual_name])]) + [actual_type (//analysis.constant [actual_module actual_name])] (and (type#= expected_type actual_type) (same? expected_module actual_module) (same? expected_name actual_name)) @@ -110,7 +110,7 @@ (//phase.result state) (try#each (|>> product.right (pipe.case - (pattern [actual_type (//analysis.constant [actual_module actual_name])]) + [actual_type (//analysis.constant [actual_module actual_name])] (and (type#= expected_type actual_type) (same? import actual_module) (same? expected_name actual_name)) @@ -131,7 +131,7 @@ (//phase.result state) (try#each (|>> product.right (pipe.case - (pattern [actual_type (//analysis.constant [actual_module actual_name])]) + [actual_type (//analysis.constant [actual_module actual_name])] (and (type#= expected_type actual_type) (same? import actual_module) (same? expected_name actual_name)) @@ -152,7 +152,7 @@ (//phase.result state) (try#each (|>> product.right (pipe.case - (pattern [actual_type (//analysis.constant [actual_module actual_name])]) + [actual_type (//analysis.constant [actual_module actual_name])] (and (type#= .Type actual_type) (same? expected_module actual_module) (same? expected_name actual_name)) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/simple.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/simple.lux index 6db157abb..bceb035c6 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/simple.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/simple.lux @@ -35,7 +35,7 @@ (/phase.result [/extension.#bundle /extension.empty /extension.#state state]) (pipe.case - (pattern {try.#Success analysis}) + {try.#Success analysis} (? analysis) _ @@ -47,7 +47,7 @@ (/phase.result [/extension.#bundle /extension.empty /extension.#state state]) (pipe.case - (pattern {try.#Failure error}) + {try.#Failure error} true _ @@ -59,7 +59,7 @@ (/phase.result [/extension.#bundle /extension.empty /extension.#state state]) (pipe.case - (pattern {try.#Success [inferred analysis]}) + {try.#Success [inferred analysis]} (and (type#= type inferred) (? analysis)) @@ -71,7 +71,7 @@ [(is (-> <type> Analysis Bit) (function (_ expected) (|>> (pipe.case - (pattern (<tag> actual)) + (<tag> actual) (same? expected actual) _ @@ -88,7 +88,12 @@ (`` (all _.and (_.coverage [/.unit] (..analysis state module .Any /.unit - (|>> (pipe.case (pattern (/analysis.unit)) true _ false)))) + (|>> (pipe.case + (/analysis.unit) + true + + _ + false)))) (,, (with_template [<analysis> <type> <random> <tag>] [(do ! [sample <random>] diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux index ba8a98e65..7f348e194 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux @@ -72,7 +72,7 @@ (//.phase archive.empty) (phase.result [///bundle.empty synthesis.init]) (pipe.case - (pattern {try.#Success (synthesis.branch/let [inputS registerS outputS])}) + {try.#Success (synthesis.branch/let [inputS registerS outputS])} (and (n.= registerA registerS) (//primitive.corresponds? inputA inputS) (//primitive.corresponds? outputA outputS)) @@ -101,7 +101,7 @@ (//.phase archive.empty) (phase.result [///bundle.empty synthesis.init]) (pipe.case - (pattern {try.#Success (synthesis.branch/if [inputS thenS elseS])}) + {try.#Success (synthesis.branch/if [inputS thenS elseS])} (and (//primitive.corresponds? inputA inputS) (//primitive.corresponds? thenA thenS) (//primitive.corresponds? elseA elseS)) @@ -161,7 +161,7 @@ (//.phase archive.empty) (phase.result [///bundle.empty synthesis.init]) (pipe.case - (pattern {try.#Success (synthesis.branch/get [pathS recordS])}) + {try.#Success (synthesis.branch/get [pathS recordS])} (and (at (list.equivalence (sum.equivalence n.= n.=)) = pathA pathS) (//primitive.corresponds? recordA recordS)) @@ -189,7 +189,7 @@ (random.set hash 5) (at random.monad each (|>> set.list (pipe.case - (pattern (list s0 s1 s2 s3 s4)) + (list s0 s1 s2 s3 s4) [s0 s1 s2 s3 s4] _ @@ -338,7 +338,7 @@ (|> (/.synthesize_case //.phase archive.empty expected_input match) (phase.result [///bundle.empty synthesis.init]) (pipe.case - (pattern {try.#Success (synthesis.branch/case [actual_input actual_path])}) + {try.#Success (synthesis.branch/case [actual_input actual_path])} (and (at synthesis.equivalence = expected_input actual_input) (at synthesis.path_equivalence = expected_path actual_path)) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/function.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/function.lux index 10700d853..579f52354 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/function.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/function.lux @@ -449,7 +449,7 @@ (and (|> (analysis.apply [funcA argsA]) (//.phase archive.empty) (phase.result [///bundle.empty synthesis.init]) - (!expect (^.multi (pattern {try.#Success (synthesis.function/apply [funcS argsS])}) + (!expect (^.multi {try.#Success (synthesis.function/apply [funcS argsS])} (and (//primitive.corresponds? funcA funcS) (list.every? (product.uncurried //primitive.corresponds?) (list.zipped_2 argsA argsS)))))) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/loop.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/loop.lux index 40db9835c..76df6ec77 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/loop.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/loop.lux @@ -279,8 +279,8 @@ (list#each (|>> {variable.#Local}))) //.#arity arity //.#body iteration]) - (pattern {.#Some (//.loop/scope [actual_offset actual_inits - actual])}) + {.#Some (//.loop/scope [actual_offset actual_inits + actual])} (and (n.= expected_offset actual_offset) (at (list.equivalence //.equivalence) = diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/primitive.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/primitive.lux index f45fe8dd9..07414ac90 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/primitive.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/primitive.lux @@ -60,8 +60,8 @@ [////analysis.#Text (|>) ////synthesis.#Text (|>)] )) - (pattern [(////analysis.tuple expected) - (////synthesis.tuple actual)]) + [(////analysis.tuple expected) + (////synthesis.tuple actual)] (and (n.= (list.size expected) (list.size actual)) (list.every? (function (_ [expected actual]) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/structure.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/structure.lux index ed3f4cf05..d17044f40 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/structure.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/structure.lux @@ -49,7 +49,7 @@ (//.phase archive.empty) (phase.result [///bundle.empty ////synthesis.init]) (pipe.case - (pattern {try.#Success (////synthesis.variant [leftsS right?S valueS])}) + {try.#Success (////synthesis.variant [leftsS right?S valueS])} (let [tagS (if right?S (++ leftsS) leftsS)] (and (n.= tagA tagS) (|> tagS (n.= (-- size)) (bit#= right?S)) @@ -68,7 +68,7 @@ (//.phase archive.empty) (phase.result [///bundle.empty ////synthesis.init]) (pipe.case - (pattern {try.#Success (////synthesis.tuple membersS)}) + {try.#Success (////synthesis.tuple membersS)} (and (n.= size (list.size membersS)) (list.every? (product.uncurried //primitive.corresponds?) (list.zipped_2 membersA membersS))) diff --git a/stdlib/source/test/lux/tool/compiler/meta/archive.lux b/stdlib/source/test/lux/tool/compiler/meta/archive.lux index 12596c093..2ada929d2 100644 --- a/stdlib/source/test/lux/tool/compiler/meta/archive.lux +++ b/stdlib/source/test/lux/tool/compiler/meta/archive.lux @@ -150,7 +150,7 @@ archive (/.has module/0 entry archive)] (in (and (list.empty? pre) (case (/.entries archive) - (pattern (list [module/0' @module/0' entry'])) + (list [module/0' @module/0' entry']) (and (same? module/0 module/0') (same? @module/0 @module/0') (same? entry entry')) diff --git a/stdlib/source/test/lux/tool/compiler/meta/archive/registry.lux b/stdlib/source/test/lux/tool/compiler/meta/archive/registry.lux index 2e863466c..ef21f8b7d 100644 --- a/stdlib/source/test/lux/tool/compiler/meta/archive/registry.lux +++ b/stdlib/source/test/lux/tool/compiler/meta/archive/registry.lux @@ -70,7 +70,7 @@ (_.coverage [/.resource] (let [[@it registry] (/.resource mandatory? expected_dependencies /.empty)] (case (sequence.list (/.artifacts registry)) - (pattern (list [artifact actual_dependencies])) + (list [artifact actual_dependencies]) (and (same? @it (the artifact.#id artifact)) (same? mandatory? (the artifact.#mandatory? artifact)) (tagged? category.#Anonymous (the artifact.#category artifact)) @@ -84,13 +84,13 @@ <wrong_expected> <wrong_expected>'] (and (let [[@it registry] (<new> <expected> mandatory? expected_dependencies /.empty)] (and (case (<query> registry) - (pattern (list actual_name)) + (list actual_name) (same? <expected> actual_name) _ false) (case (sequence.list (/.artifacts registry)) - (pattern (list [artifact actual_dependencies])) + (list [artifact actual_dependencies]) (and (same? @it (the artifact.#id artifact)) (same? mandatory? (the artifact.#mandatory? artifact)) (case (the artifact.#category artifact) @@ -105,7 +105,7 @@ false))) (let [[@it registry] (<wrong_new> <wrong_expected> mandatory? expected_dependencies /.empty)] (case (<query> registry) - (pattern (list)) + (list) true _ diff --git a/stdlib/source/test/lux/tool/compiler/meta/export.lux b/stdlib/source/test/lux/tool/compiler/meta/export.lux index 07c9affa7..d9fb14ace 100644 --- a/stdlib/source/test/lux/tool/compiler/meta/export.lux +++ b/stdlib/source/test/lux/tool/compiler/meta/export.lux @@ -79,8 +79,8 @@ (try#each (|>> product.left sequence.list (pipe.case - (pattern (list {tar.#Normal [actual_path/0 when/0 mode/0 ownership/0 actual_content/0]} - {tar.#Normal [actual_path/1 when/1 mode/1 ownership/1 actual_content/1]})) + (list {tar.#Normal [actual_path/0 when/0 mode/0 ownership/0 actual_content/0]} + {tar.#Normal [actual_path/1 when/1 mode/1 ownership/1 actual_content/1]}) (with_expansions [<test> (and (and (text#= file/0' (tar.from_path actual_path/0)) (same? /.mode mode/0) (same? /.ownership ownership/0) @@ -102,8 +102,8 @@ (try#each (|>> product.right sequence.list (pipe.case - (pattern (list {tar.#Normal [actual_path/0 _ _ _ actual_content/0]} - {tar.#Normal [actual_path/1 _ _ _ actual_content/1]})) + (list {tar.#Normal [actual_path/0 _ _ _ actual_content/0]} + {tar.#Normal [actual_path/1 _ _ _ actual_content/1]}) (with_expansions [<test> (and (and (text#= file/0' (tar.from_path actual_path/0)) (binary#= content/0 (tar.data actual_content/0))) (and (text#= file/1' (tar.from_path actual_path/1)) diff --git a/stdlib/source/test/lux/tool/compiler/reference.lux b/stdlib/source/test/lux/tool/compiler/reference.lux index 9204b53a8..6f247179c 100644 --- a/stdlib/source/test/lux/tool/compiler/reference.lux +++ b/stdlib/source/test/lux/tool/compiler/reference.lux @@ -52,7 +52,7 @@ (,, (with_template [<tag>] [(_.coverage [<tag>] (case (<tag> expected_register) - (pattern (<tag> actual_register)) + (<tag> actual_register) (n.= expected_register actual_register) _ @@ -65,20 +65,20 @@ (_.coverage [/.variable /.self] (and (at /.equivalence = (/.self) (/.variable (variable.self))) (case (/.self) - (pattern (/.self)) + (/.self) true _ false) (case (/.variable (variable.self)) - (pattern (/.self)) + (/.self) true _ false))) (_.coverage [/.constant] (case (/.constant expected_constant) - (pattern (/.constant actual_constant)) + (/.constant actual_constant) (symbol#= expected_constant actual_constant) _ diff --git a/stdlib/source/test/lux/tool/compiler/reference/variable.lux b/stdlib/source/test/lux/tool/compiler/reference/variable.lux index 8036cab58..f2b219b86 100644 --- a/stdlib/source/test/lux/tool/compiler/reference/variable.lux +++ b/stdlib/source/test/lux/tool/compiler/reference/variable.lux @@ -34,7 +34,7 @@ ($hash.spec /.hash ..random)) (_.coverage [/.self] (case (/.self) - (pattern (/.self)) true + (/.self) true _ false)) (_.coverage [/.self?] (/.self? (/.self))) diff --git a/stdlib/source/test/lux/world/file/watch.lux b/stdlib/source/test/lux/world/file/watch.lux index 6179b2164..9977934a0 100644 --- a/stdlib/source/test/lux/world/file/watch.lux +++ b/stdlib/source/test/lux/world/file/watch.lux @@ -105,7 +105,7 @@ poll/pre (at watcher poll []) poll/post (at watcher poll [])] (in (and (case poll/pre - (pattern (list [concern actual_path])) + (list [concern actual_path]) (and (text#= expected_path actual_path) (and (/.creation? concern) (not (/.modification? concern)) @@ -123,7 +123,7 @@ poll/2 (at watcher poll []) poll/2' (at watcher poll [])] (in (and (case poll/2 - (pattern (list [concern actual_path])) + (list [concern actual_path]) (and (text#= expected_path actual_path) (and (not (/.creation? concern)) (/.modification? concern) @@ -140,7 +140,7 @@ poll/3 (at watcher poll []) poll/3' (at watcher poll [])] (in (and (case poll/3 - (pattern (list [concern actual_path])) + (list [concern actual_path]) (and (not (/.creation? concern)) (not (/.modification? concern)) (/.deletion? concern)) |