diff options
Diffstat (limited to '')
3 files changed, 14 insertions, 55 deletions
diff --git a/stdlib/source/library/lux.lux b/stdlib/source/library/lux.lux index c1696ff86..823132f6c 100644 --- a/stdlib/source/library/lux.lux +++ b/stdlib/source/library/lux.lux @@ -549,7 +549,6 @@ ... #module_aliases (List [Text Text]) ... #definitions (List [Text Global]) ... #imports (List Text) -... #module_annotations (Maybe Code) ... #module_state Module_State])) ("lux def type tagged" Module (#Named ["library/lux" "Module"] @@ -565,14 +564,11 @@ (#Product ... "lux.imports" (#Apply Text List) - (#Product - ... "lux.module_annotations" - (#Apply Code Maybe) - ... module_state - Module_State) + ... module_state + Module_State ))))) (record$ #End) - ["module_hash" "module_aliases" "definitions" "imports" "module_annotations" "module_state"] + ["module_hash" "module_aliases" "definitions" "imports" "module_state"] .public) ... (type: .public Type_Context @@ -1673,7 +1669,7 @@ #scopes scopes #type_context types #host host #seed seed #expected expected #location location #extensions extensions #scope_type_vars scope_type_vars #eval _eval] state] - ({(#Some [#module_hash _ #module_aliases _ #definitions definitions #imports _ #module_annotations _ #module_state _]) + ({(#Some [#module_hash _ #module_aliases _ #definitions definitions #imports _ #module_state _]) ({(#Some constant) ({(#Alias real_name) (#Right [state real_name]) @@ -2210,7 +2206,7 @@ ($' Maybe Macro)) (do maybe_monad [$module (plist\value module modules) - gdef (let' [[#module_hash _ #module_aliases _ #definitions bindings #imports _ #module_annotations _ #module_state _] ("lux type check" Module $module)] + gdef (let' [[#module_hash _ #module_aliases _ #definitions bindings #imports _ #module_state _] ("lux type check" Module $module)] (plist\value name bindings))] ({(#Alias [r_module r_name]) (macro'' modules current_module r_module r_name) @@ -3261,7 +3257,7 @@ (-> Name (Meta [Nat (List Name) Bit Type])) (do meta_monad [=module (..module module) - .let [[#module_hash _ #module_aliases _ #definitions definitions #imports _ #module_annotations _ #module_state _] =module]] + .let [[#module_hash _ #module_aliases _ #definitions definitions #imports _ #module_state _] =module]] (case (plist\value (text\composite "#" name) definitions) (#Some (#Slot [exported type group index])) (in_meta [index @@ -3289,7 +3285,7 @@ (#Named [module name] unnamed) (do meta_monad [=module (..module module) - .let [[#module_hash _ #module_aliases _ #definitions definitions #imports _ #module_annotations _ #module_state _] =module]] + .let [[#module_hash _ #module_aliases _ #definitions definitions #imports _ #module_state _] =module]] (case (plist\value name definitions) (#Some (#Type [exported? (#Named _ _type) (#Right slots)])) (case (interface_methods _type) @@ -4002,7 +3998,7 @@ (#Slot _) (list)))) - (let [[#module_hash _ #module_aliases _ #definitions definitions #imports _ #module_annotations _ #module_state _] =module] + (let [[#module_hash _ #module_aliases _ #definitions definitions #imports _ #module_state _] =module] definitions))] (#Right state (list\conjoint to_alias))) @@ -4084,7 +4080,7 @@ #None #None - (#Some [#definitions definitions #module_hash _ #module_aliases _ #imports _ #module_annotations _ #module_state _]) + (#Some [#definitions definitions #module_hash _ #module_aliases _ #imports _ #module_state _]) (case (plist\value v_name definitions) #None #None @@ -4117,7 +4113,7 @@ #None (#Left (text\composite "Unknown definition: " (name\encoded name))) - (#Some [#definitions definitions #module_hash _ #module_aliases _ #imports _ #module_annotations _ #module_state _]) + (#Some [#definitions definitions #module_hash _ #module_aliases _ #imports _ #module_state _]) (case (plist\value v_name definitions) #None (#Left (text\composite "Unknown definition: " (name\encoded name))) @@ -4401,7 +4397,7 @@ (-> Text Text (Meta Bit)) (do meta_monad [module (module module_name) - .let [[#module_hash _ #module_aliases _ #definitions _ #imports imports #module_annotations _ #module_state _] module]] + .let [[#module_hash _ #module_aliases _ #definitions _ #imports imports #module_state _] module]] (in (is_member? imports import_name)))) (def: (referrals module_name options) @@ -4508,16 +4504,9 @@ (~+ localizations) (~+ openings))))) -(macro: .public (module: tokens) +(macro: .public (module: _imports) (do meta_monad - [.let [[_meta _imports] (: [(List [Code Code]) (List Code)] - (case tokens - (^ (list& [_ (#Record _meta)] _imports)) - [_meta _imports] - - _ - [(list) tokens]))] - current_module current_module_name + [current_module current_module_name imports (imports_parser #0 current_module #End _imports) .let [=imports (|> imports (list\each (: (-> Importation Code) @@ -4528,9 +4517,7 @@ (function (_ [module_name m_alias =refer]) (refer_code module_name m_alias =refer))) imports) - =module (` ("lux def module" [(~ location_code) - (#.Record (~ (definition_annotations _meta)))] - (~ =imports)))]] + =module (` ("lux def module" (~ =imports)))]] (in (#Item =module =refers)))) (macro: .public (\ tokens) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux.lux b/stdlib/source/library/lux/tool/compiler/language/lux.lux index 16493d1dc..37ccff163 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux.lux @@ -51,8 +51,6 @@ (_.list (_.and _.text global)) ... #imports (_.list _.text) - ... #module_annotations - (_.maybe _.code) ... #module_state _.any))) @@ -87,8 +85,6 @@ (<b>.list (<>.and <b>.text global)) ... #imports (<b>.list <b>.text) - ... #module_annotations - (<b>.maybe <b>.code) ... #module_state (\ <>.monad in #.Cached)))) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/module.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/module.lux index 62bf284c3..845d07f17 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/module.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/module.lux @@ -65,38 +65,14 @@ #.Compiled "Compiled" #.Cached "Cached")])) -(exception: .public (cannot_set_module_annotations_more_than_once {module Text} {old Code} {new Code}) - (exception.report - ["Module" module] - ["Old annotations" (%.code old)] - ["New annotations" (%.code new)])) - (def: .public (empty hash) (-> Nat Module) [#.module_hash hash #.module_aliases (list) #.definitions (list) #.imports (list) - #.module_annotations #.None #.module_state #.Active]) -(def: .public (set_annotations annotations) - (-> Code (Operation Any)) - (///extension.lifted - (do ///.monad - [self_name meta.current_module_name - self meta.current_module] - (case (value@ #.module_annotations self) - #.None - (function (_ state) - (#try.Success [(revised@ #.modules - (plist.has self_name (with@ #.module_annotations (#.Some annotations) self)) - state) - []])) - - (#.Some old) - (/.except' cannot_set_module_annotations_more_than_once [self_name old annotations]))))) - (def: .public (import module) (-> Text (Operation Any)) (///extension.lifted |