diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/tool/compiler/meta/archive/registry.lux | 84 |
1 files changed, 43 insertions, 41 deletions
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 3005c2e0d..9b8e1e38a 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/archive/registry.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/archive/registry.lux @@ -22,11 +22,12 @@ [type abstract]]] ["[0]" // "_" - ["[1]" artifact {"+" Dependency Category Artifact ID}]]) + ["[1]" artifact {"+" Dependency Artifact ID} + ["[2][0]" category {"+" Category}]]]) (abstract: .public Registry (Record - [#artifacts (Sequence Artifact) + [#artifacts (Sequence [Artifact (Set Dependency)]) #resolver (Dictionary Text ID)]) (def: .public empty @@ -35,7 +36,7 @@ #resolver (dictionary.empty text.hash)])) (def: .public artifacts - (-> Registry (Sequence Artifact)) + (-> Registry (Sequence [Artifact (Set Dependency)])) (|>> :representation (value@ #artifacts))) (def: next @@ -48,10 +49,10 @@ [id (|> registry :representation - (revised@ #artifacts (sequence.suffix [//.#id id - //.#category {//.#Anonymous} - //.#mandatory? mandatory? - //.#dependencies dependencies])) + (revised@ #artifacts (sequence.suffix [[//.#id id + //.#category {//category.#Anonymous} + //.#mandatory? mandatory?] + dependencies])) :abstraction)])) (template [<tag> <create> <fetch>] @@ -61,10 +62,10 @@ [id (|> registry :representation - (revised@ #artifacts (sequence.suffix [//.#id id - //.#category {<tag> name} - //.#mandatory? mandatory? - //.#dependencies dependencies])) + (revised@ #artifacts (sequence.suffix [[//.#id id + //.#category {<tag> name} + //.#mandatory? mandatory?] + dependencies])) (revised@ #resolver (dictionary.has name id)) :abstraction)])) @@ -74,16 +75,17 @@ :representation (value@ #artifacts) sequence.list - (list.all (|>> (value@ //.#category) + (list.all (|>> product.left + (value@ //.#category) (case> {<tag> name} {.#Some name} _ {.#None})))))] - [//.#Definition definition definitions] - [//.#Analyser analyser analysers] - [//.#Synthesizer synthesizer synthesizers] - [//.#Generator generator generators] - [//.#Directive directive directives] - [//.#Custom custom customs] + [//category.#Definition definition definitions] + [//category.#Analyser analyser analysers] + [//category.#Synthesizer synthesizer synthesizers] + [//category.#Generator generator generators] + [//category.#Directive directive directives] + [//category.#Custom custom customs] ) (def: .public (remember name registry) @@ -100,13 +102,13 @@ (^template [<nat> <tag> <writer>] [{<tag> value} ((binary.and binary.nat <writer>) [<nat> value])]) - ([0 //.#Anonymous binary.any] - [1 //.#Definition binary.text] - [2 //.#Analyser binary.text] - [3 //.#Synthesizer binary.text] - [4 //.#Generator binary.text] - [5 //.#Directive binary.text] - [6 //.#Custom binary.text])))) + ([0 //category.#Anonymous binary.any] + [1 //category.#Definition binary.text] + [2 //category.#Analyser binary.text] + [3 //category.#Synthesizer binary.text] + [4 //category.#Generator binary.text] + [5 //category.#Directive binary.text] + [6 //category.#Custom binary.text])))) mandatory? binary.bit dependency (: (Writer Dependency) (binary.and binary.nat binary.nat)) @@ -116,10 +118,10 @@ (binary.sequence/64 ($_ binary.and category mandatory? dependencies)))] (|>> :representation (value@ #artifacts) - (sequence#each (function (_ it) + (sequence#each (function (_ [it dependencies]) [(value@ //.#category it) (value@ //.#mandatory? it) - (value@ //.#dependencies it)])) + dependencies])) artifacts))) (exception: .public (invalid_category [tag Nat]) @@ -135,13 +137,13 @@ (^template [<nat> <tag> <parser>] [<nat> (# ! each (|>> {<tag>}) <parser>)]) - ([0 //.#Anonymous <binary>.any] - [1 //.#Definition <binary>.text] - [2 //.#Analyser <binary>.text] - [3 //.#Synthesizer <binary>.text] - [4 //.#Generator <binary>.text] - [5 //.#Directive <binary>.text] - [6 //.#Custom <binary>.text]) + ([0 //category.#Anonymous <binary>.any] + [1 //category.#Definition <binary>.text] + [2 //category.#Analyser <binary>.text] + [3 //category.#Synthesizer <binary>.text] + [4 //category.#Generator <binary>.text] + [5 //category.#Directive <binary>.text] + [6 //category.#Custom <binary>.text]) _ (<>.failure (exception.error ..invalid_category [tag]))))) mandatory? <binary>.bit @@ -153,18 +155,18 @@ (# <>.monad each (sequence#mix (function (_ [category mandatory? dependencies] registry) (product.right (case category - {//.#Anonymous} + {//category.#Anonymous} (..resource mandatory? dependencies registry) (^template [<tag> <create>] [{<tag> name} (<create> name mandatory? dependencies registry)]) - ([//.#Definition ..definition] - [//.#Analyser ..analyser] - [//.#Synthesizer ..synthesizer] - [//.#Generator ..generator] - [//.#Directive ..directive] - [//.#Custom ..custom]) + ([//category.#Definition ..definition] + [//category.#Analyser ..analyser] + [//category.#Synthesizer ..synthesizer] + [//category.#Generator ..generator] + [//category.#Directive ..directive] + [//category.#Custom ..custom]) ))) ..empty))))) ) |