diff options
author | Eduardo Julian | 2022-01-20 04:30:57 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-01-20 04:30:57 -0400 |
commit | 14bf4ffe5d7d88692ab895f96a2bb6a829a406de (patch) | |
tree | ef9204bb10c817c6d7feddfa20c7305dbc6a042d /stdlib/source/library/lux/tool/compiler | |
parent | c98d05fcb43714dc7e2ce07ab3fa17b78f21b3bf (diff) |
Better text formatting for types.
Diffstat (limited to 'stdlib/source/library/lux/tool/compiler')
13 files changed, 94 insertions, 91 deletions
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/generation.lux b/stdlib/source/library/lux/tool/compiler/language/lux/generation.lux index a65131c3a..4a9efba50 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/generation.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/generation.lux @@ -283,7 +283,7 @@ (do try.monad [[descriptor document] (archive.find _module archive)] {try.#Success (value@ descriptor.#registry descriptor)}))] - (case (registry.remember _name registry) + (case (registry.id _name registry) {.#None} (exception.except ..unknown_definition [name (registry.definitions registry)]) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux index 965a9e641..e85b1325b 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux @@ -47,8 +47,9 @@ ["[0]" phase] [meta ["[0]" archive {"+" Archive} - ["[0]" artifact] - ["[0]" dependency]]]]]]]) + ["[0]" artifact]] + ["[0]" cache "_" + ["[1]/[0]" artifact]]]]]]]) (def: .public (custom [syntax handler]) (All (_ anchor expression directive s) @@ -119,7 +120,7 @@ (do phase.monad [[interim_artifacts codeG] (/////generation.with_interim_artifacts archive (generate archive codeS)) - dependencies (dependency.dependencies archive codeS) + dependencies (cache/artifact.dependencies archive codeS) module_id (phase.lifted (archive.id module archive)) id (/////generation.learn name false (set.union interim_artifacts dependencies)) [target_name value directive] (/////generation.define! [module_id id] {.#None} codeG) @@ -173,7 +174,7 @@ (do phase.monad [[interim_artifacts codeG] (/////generation.with_interim_artifacts archive (generate archive codeS)) - dependencies (dependency.dependencies archive codeS) + dependencies (cache/artifact.dependencies archive codeS) module_id (phase.lifted (archive.id current_module archive)) id (<learn> extension (set.union interim_artifacts dependencies)) [target_name value directive] (/////generation.define! [module_id id] {.#None} codeG) @@ -498,7 +499,7 @@ (do phase.monad [[interim_artifacts programG] (/////generation.with_interim_artifacts archive (generate archive programS)) - dependencies (dependency.dependencies archive programS) + dependencies (cache/artifact.dependencies archive programS) artifact_id (/////generation.learn /////program.name true (set.union interim_artifacts dependencies))] (/////generation.save! artifact_id {.#None} (program [module_id artifact_id] programG)))) 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 7a3c93014..dda74b0e1 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 @@ -71,8 +71,9 @@ ["[2][0]" variable {"+" Variable Register}]] [meta ["[0]" archive {"+" Archive} - ["[0]" artifact] - ["[0]" dependency]]]]]]]) + ["[0]" artifact]] + ["[0]" cache "_" + ["[1]/[0]" artifact]]]]]]]) (template [<name> <0>] [(def: <name> @@ -1071,22 +1072,22 @@ (let [[_super _name _strict_fp? _annotations _t_vars _this _arguments _return _exceptions bodyS] method] - (dependency.dependencies archive bodyS))) + (cache/artifact.dependencies archive bodyS))) (def: (anonymous_dependencies archive inputsTS overriden_methods) (-> Archive (List Input) (List [(Environment Synthesis) (/.Overriden_Method Synthesis)]) (Operation (Set artifact.Dependency))) (do [! //////.monad] - [all_input_dependencies (monad.each ! (|>> product.right (dependency.dependencies archive)) inputsTS) + [all_input_dependencies (monad.each ! (|>> product.right (cache/artifact.dependencies archive)) inputsTS) all_closure_dependencies (|> overriden_methods (list#each product.left) list.together - (monad.each ! (dependency.dependencies archive))) + (monad.each ! (cache/artifact.dependencies archive))) all_method_dependencies (monad.each ! (|>> product.right (method_dependencies archive)) overriden_methods)] - (in (dependency.all ($_ list#composite - all_input_dependencies - all_closure_dependencies - all_method_dependencies))))) + (in (cache/artifact.all ($_ list#composite + all_input_dependencies + all_closure_dependencies + all_method_dependencies))))) (def: (prepare_argument lux_register argumentT jvm_register) (-> Register (Type Value) Register [Register (Bytecode Any)]) 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 357337927..2227d9f1d 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 @@ -33,8 +33,9 @@ [tool [compiler [meta - ["[0]" archive {"+" Archive} - ["[0]" dependency]]]]]]] + ["[0]" archive {"+" Archive}] + ["[0]" cache "_" + ["[1]/[0]" artifact]]]]]]] ["[0]" / "_" ["[1][0]" abstract] [field @@ -100,7 +101,7 @@ (def: .public (abstraction generate archive [environment arity bodyS]) (Generator Abstraction) (do phase.monad - [dependencies (dependency.dependencies archive bodyS) + [dependencies (cache/artifact.dependencies archive bodyS) @begin //runtime.forge_label [function_context bodyG] (generation.with_new_context archive dependencies (generation.with_anchor [@begin ..this_offset] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/program.lux b/stdlib/source/library/lux/tool/compiler/language/lux/program.lux index 176ab28ed..4e1c9805d 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/program.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/program.lux @@ -1,25 +1,25 @@ (.using - [library - [lux {"-" Module} - [abstract - ["[0]" monad {"+" do}]] - [control - ["[0]" maybe] - ["[0]" try {"+" Try}] - ["[0]" exception {"+" exception:}]] - [data - ["[0]" product] - [text - ["%" format {"+" format}]] - [collection - ["[0]" list ("[1]#[0]" functor)]]]]] - [// - [generation {"+" Context}] - [/// - [meta - ["[0]" archive {"+" Archive} - ["[0]" descriptor {"+" Module}] - ["[0]" registry {"+" Registry}]]]]]) + [library + [lux {"-" Module} + [abstract + ["[0]" monad {"+" do}]] + [control + ["[0]" maybe] + ["[0]" try {"+" Try}] + ["[0]" exception {"+" exception:}]] + [data + ["[0]" product] + [text + ["%" format {"+" format}]] + [collection + ["[0]" list ("[1]#[0]" functor)]]]]] + [// + [generation {"+" Context}] + [/// + [meta + ["[0]" archive {"+" Archive} + ["[0]" descriptor {"+" Module}] + ["[0]" registry {"+" Registry}]]]]]) (type: .public (Program expression directive) (-> Context expression directive)) @@ -45,7 +45,7 @@ (in [[module id] (value@ descriptor.#registry descriptor)])))))] (case (list.one (function (_ [[module module_id] registry]) (do maybe.monad - [program_id (registry.remember ..name registry)] + [program_id (registry.id ..name registry)] (in [module_id program_id]))) registries) {.#Some program_context} diff --git a/stdlib/source/library/lux/tool/compiler/meta/archive/registry.lux b/stdlib/source/library/lux/tool/compiler/meta/archive/registry.lux index 9b8e1e38a..c289d9af0 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/archive/registry.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/archive/registry.lux @@ -88,7 +88,7 @@ [//category.#Custom custom customs] ) - (def: .public (remember name registry) + (def: .public (id name registry) (-> Text Registry (Maybe ID)) (|> (:representation registry) (value@ #resolver) diff --git a/stdlib/source/library/lux/tool/compiler/meta/archive/dependency.lux b/stdlib/source/library/lux/tool/compiler/meta/cache/artifact.lux index 9d04addde..2a464b397 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/archive/dependency.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/cache/artifact.lux @@ -23,10 +23,10 @@ ["[0]" reference {"+" Constant}] [language [lux - ["[0]" analysis - ["[1]/[0]" complex]] ["[0]" synthesis {"+" Synthesis Path}] - ["[0]" generation {"+" Context Operation}]]] + ["[0]" generation {"+" Context Operation}] + ["[0]" analysis + ["[1]/[0]" complex]]]] [meta ["[0]" archive {"+" Archive} ["[0]" artifact] diff --git a/stdlib/source/library/lux/tool/compiler/meta/cache/dependency.lux b/stdlib/source/library/lux/tool/compiler/meta/cache/module.lux index 7b8a98a61..e61b8cad2 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/cache/dependency.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/cache/module.lux @@ -1,26 +1,26 @@ (.using - [library - [lux {"-" Module} - [abstract - ["[0]" monad {"+" do}]] - [control - ["[0]" maybe ("[1]#[0]" functor)] - ["[0]" try {"+" Try}] - ["[0]" state] - [function - ["[0]" memo {"+" Memo}]]] - [data - ["[0]" text - ["%" format {"+" format}]] - [collection - ["[0]" list ("[1]#[0]" functor mix)] - ["[0]" dictionary {"+" Dictionary}] - ["[0]" set {"+" Set}]]]]] - [/// - ["[0]" archive {"+" Output Archive} - [key {"+" Key}] - ["[0]" descriptor {"+" Module Descriptor}] - ["[0]" document {"+" Document}]]]) + [library + [lux {"-" Module} + [abstract + ["[0]" monad {"+" do}]] + [control + ["[0]" maybe ("[1]#[0]" functor)] + ["[0]" try {"+" Try}] + ["[0]" state] + [function + ["[0]" memo {"+" Memo}]]] + [data + ["[0]" text + ["%" format {"+" format}]] + [collection + ["[0]" list ("[1]#[0]" functor mix)] + ["[0]" dictionary {"+" Dictionary}] + ["[0]" set {"+" Set}]]]]] + [/// + ["[0]" archive {"+" Output Archive} + [key {"+" Key}] + ["[0]" descriptor {"+" Module Descriptor}] + ["[0]" document {"+" Document}]]]) (type: .public Ancestry (Set Module)) diff --git a/stdlib/source/library/lux/tool/compiler/meta/io/archive.lux b/stdlib/source/library/lux/tool/compiler/meta/io/archive.lux index b5fae7763..94e96ca26 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/io/archive.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/io/archive.lux @@ -41,8 +41,8 @@ ["[0]" document {"+" Document}] ["[0]" artifact {"+" Artifact Dependency} ["[0]" category {"+" Category}]]] - [cache - ["[0]" dependency]] + ["[0]" cache "_" + ["[1]/[0]" module]] ["/[1]" // {"+" Input} [language ["$" lux @@ -395,7 +395,7 @@ (def: (full_purge caches load_order) (-> (List [Bit [Module [archive.ID [Descriptor (Document .Module)]]]]) - dependency.Order + cache/module.Order Purge) (list#mix (function (_ [module_name [module_id [descriptor document]]] purge) (let [purged? (: (Predicate Module) @@ -439,7 +439,7 @@ (function (_ [module [module_id [descriptor document]]] archive) (archive.has module [descriptor document (: Output sequence.empty)] archive)) archive) - (# try.monad each (dependency.load_order $.key)) + (# try.monad each (cache/module.load_order $.key)) (# try.monad conjoint) async#in) .let [purge (..full_purge pre_loaded_caches load_order)] diff --git a/stdlib/source/library/lux/tool/compiler/meta/packager.lux b/stdlib/source/library/lux/tool/compiler/meta/packager.lux index d434c4603..9f37fff18 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/packager.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/packager.lux @@ -13,8 +13,8 @@ [world ["[0]" file]]]] [// - [cache - ["[0]" dependency]] + ["[0]" cache "_" + ["[1]/[0]" module]] ["[0]" archive {"+" Archive} ["[0]" descriptor] ["[0]" artifact] @@ -35,7 +35,7 @@ (List [archive.ID (List artifact.ID)])) (def: .public order - (-> dependency.Order Order) + (-> cache/module.Order Order) (list#each (function (_ [module [module_id [descriptor document]]]) (|> descriptor (value@ descriptor.#registry) diff --git a/stdlib/source/library/lux/tool/compiler/meta/packager/jvm.lux b/stdlib/source/library/lux/tool/compiler/meta/packager/jvm.lux index 0f933172d..594f14dd8 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/packager/jvm.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/packager/jvm.lux @@ -33,10 +33,10 @@ [// ["[0]" archive {"+" Output} ["[0]" descriptor {"+" Module}] - ["[0]" artifact] - ["tree_shaking" dependency]] - [cache - ["[0]" dependency]] + ["[0]" artifact]] + ["[0]" cache "_" + ["[1]/[0]" module] + ["[1]/[0]" artifact]] ["[0]" io "_" ["[1]" archive]] [// @@ -253,8 +253,8 @@ (-> Static Packager) (function (_ host_dependencies archive program) (do [! try.monad] - [.let [necessary_dependencies (tree_shaking.necessary_dependencies archive)] - order (dependency.load_order $.key archive) + [.let [necessary_dependencies (cache/artifact.necessary_dependencies archive)] + order (cache/module.load_order $.key archive) .let [buffer (java/io/ByteArrayOutputStream::new (.int ..mebi_byte))] sink (|> order (list#each (function (_ [module [module_id [descriptor document output]]]) diff --git a/stdlib/source/library/lux/tool/compiler/meta/packager/ruby.lux b/stdlib/source/library/lux/tool/compiler/meta/packager/ruby.lux index a375a908a..4cc20607c 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/packager/ruby.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/packager/ruby.lux @@ -33,10 +33,10 @@ ["[0]" archive {"+" Output} ["[0]" descriptor {"+" Module Descriptor}] ["[0]" artifact] - ["[0]" document {"+" Document}] - ["tree_shaking" dependency]] - [cache - ["[0]" dependency {"+" Order}]] + ["[0]" document {"+" Document}]] + ["[0]" cache "_" + ["[1]/[0]" module {"+" Order}] + ["[1]/[0]" artifact]] ["[0]" io "_" ["[1]" archive]] [// @@ -116,8 +116,8 @@ (def: .public (package host_dependencies archive program) Packager (do [! try.monad] - [.let [necessary_dependencies (tree_shaking.necessary_dependencies archive)] - order (dependency.load_order $.key archive) + [.let [necessary_dependencies (cache/artifact.necessary_dependencies archive)] + order (cache/module.load_order $.key archive) entries (monad.mix ! (..write_module (module_id_mapping order) necessary_dependencies) {.#End} order) .let [included_modules (..included_modules entries) imports (|> order diff --git a/stdlib/source/library/lux/tool/compiler/meta/packager/script.lux b/stdlib/source/library/lux/tool/compiler/meta/packager/script.lux index 7d6954d1a..c3f3e4867 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/packager/script.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/packager/script.lux @@ -24,10 +24,10 @@ [// ["[0]" archive {"+" Output} ["[0]" descriptor] - ["[0]" artifact] - ["tree_shaking" dependency]] - [cache - ["[0]" dependency]] + ["[0]" artifact]] + ["[0]" cache "_" + ["[1]/[0]" module] + ["[1]/[0]" artifact]] ["[0]" io "_" ["[1]" archive]] [// @@ -68,8 +68,8 @@ Packager)) (function (package host_dependencies archive program) (do [! try.monad] - [.let [necessary_dependencies (tree_shaking.necessary_dependencies archive)] - order (dependency.load_order $.key archive)] + [.let [necessary_dependencies (cache/artifact.necessary_dependencies archive)] + order (cache/module.load_order $.key archive)] (|> order (list#each (function (_ [module [module_id [descriptor document output]]]) [module_id output])) |