diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/default/init.lux | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/stdlib/source/library/lux/meta/compiler/default/init.lux b/stdlib/source/library/lux/meta/compiler/default/init.lux index b30769ba6..07cfaf968 100644 --- a/stdlib/source/library/lux/meta/compiler/default/init.lux +++ b/stdlib/source/library/lux/meta/compiler/default/init.lux @@ -83,16 +83,14 @@ ///declaration.#generation [///declaration.#state generation_state ///declaration.#phase (generate extender)]]])) -(def .public (with_default_declarations host_analysis program extender) +(def .public (with_default_declarations host_analysis) (All (_ anchor expression declaration) (-> ///analysis.Bundle - (Program expression declaration) - (Extender anchor expression declaration) (-> (///declaration.State+ anchor expression declaration) (///declaration.State+ anchor expression declaration)))) (function (_ [declaration_extensions sub_state]) [(dictionary.composite declaration_extensions - (luxD.bundle host_analysis program extender)) + (luxD.bundle host_analysis)) sub_state])) (type Reader @@ -126,9 +124,21 @@ [(///generation.Buffer declaration) Registry]) -(def (with_generation_defaults module) - (-> Text - (Operation Any)) +(def with_declaration_defaults + (Operation Any) + (do [! ///phase.monad] + [state ///phase.state + _ (|> state + (the extension.#bundle) + dictionary.entries + (monad.each ! + (function (_ [name handler]) + (///declaration.lifted_analysis + (moduleA.define name {.#Default [true .Declaration handler]})))))] + (in []))) + +(def with_generation_defaults + (Operation Any) (do [! ///phase.monad] [state ///phase.state _ (|> state @@ -146,8 +156,8 @@ (when module .prelude (do ///phase.monad - [] - (with_generation_defaults module)) + [_ with_generation_defaults] + with_declaration_defaults) _ (with ///phase.monad |