diff options
author | Eduardo Julian | 2021-08-21 04:06:54 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-08-21 04:06:54 -0400 |
commit | 1ea83ecadccc5adee1bdb35bd11527c3982c015e (patch) | |
tree | b2a701e6eb14469d55a4f88af3f398a7d7056121 /stdlib/source/library/lux/tool/compiler | |
parent | 374ccf07246484eb7beb2cd87f3fc88396373ee1 (diff) |
Can now produce arbitrary code fragments statically by evaluating arbitrary expressions at compile-time.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux | 11 |
1 files changed, 10 insertions, 1 deletions
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 329c79611..c5f410370 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 @@ -236,6 +236,14 @@ _ (phase.except ///.invalid_syntax [extension_name %.code inputsC+])))) +(def: (announce_tags! tags owner) + (All [anchor expression directive] + (-> (List Text) Type (Operation anchor expression directive (List Any)))) + (/////directive.lifted_generation + (monad.map phase.monad (function (_ tag) + (/////generation.log! (format "#" tag " : Tag of " (%.type owner)))) + tags))) + (def: (def::type_tagged expander host_analysis) (-> Expander /////analysis.Bundle Handler) (..custom @@ -255,7 +263,8 @@ [_ (module.define short_name (#.Right [exported? type annotations value]))] (module.declare_tags tags exported? (:as Type value)))) _ (..refresh expander host_analysis) - _ (..announce_definition! short_name type)] + _ (..announce_definition! short_name type) + _ (..announce_tags! tags (:as Type value))] (in /////directive.no_requirements)))])) (def: imports |