(.module: [library [lux "*" [control ["<>" parser ["" binary {"+" [Parser]}]]] [data [format ["_" binary {"+" [Writer]}]]]]] ["[0]" / "_" ["[1][0]" version] [phase [analysis ["[0]" module]]] [/// [meta [archive ["[0]" signature] ["[0]" key {"+" [Key]}]]]]]) ... TODO: Remove #module_hash, #imports & #module_state ASAP. ... TODO: Not just from this parser, but from the lux.Module type. (def: .public writer (Writer .Module) (let [definition (: (Writer Definition) ($_ _.and _.bit _.type _.any)) labels (: (Writer [Text (List Text)]) (_.and _.text (_.list _.text))) global_type (: (Writer [Bit Type (Either [Text (List Text)] [Text (List Text)])]) ($_ _.and _.bit _.type (_.or labels labels))) global_label (: (Writer .Label) ($_ _.and _.bit _.type (_.list _.text) _.nat)) name (: (Writer Name) (_.and _.text _.text)) alias (: (Writer Alias) (_.and _.text _.text)) global (: (Writer Global) ($_ _.or definition global_type global_label global_label alias))] ($_ _.and ... #module_hash _.nat ... #module_aliases (_.list alias) ... #definitions (_.list (_.and _.text global)) ... #imports (_.list _.text) ... #module_state _.any))) (def: .public parser (Parser .Module) (let [definition (: (Parser Definition) ($_ <>.and .bit .type .any)) labels (: (Parser [Text (List Text)]) (<>.and .text (.list .text))) global_type (: (Parser [Bit Type (Either [Text (List Text)] [Text (List Text)])]) ($_ <>.and .bit .type (.or labels labels))) global_label (: (Parser .Label) ($_ <>.and .bit .type (.list .text) .nat)) name (: (Parser Name) (<>.and .text .text)) alias (: (Parser Alias) (<>.and .text .text)) global (: (Parser Global) ($_ .or definition global_type global_label global_label alias))] ($_ <>.and ... #module_hash .nat ... #module_aliases (.list alias) ... #definitions (.list (<>.and .text global)) ... #imports (.list .text) ... #module_state (\ <>.monad in #.Cached)))) (def: .public key (Key .Module) (key.key [#signature.name (name_of ..compiler) #signature.version /version.version] (module.empty 0)))