aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/tool/compiler
diff options
context:
space:
mode:
authorEduardo Julian2021-08-21 04:06:54 -0400
committerEduardo Julian2021-08-21 04:06:54 -0400
commit1ea83ecadccc5adee1bdb35bd11527c3982c015e (patch)
treeb2a701e6eb14469d55a4f88af3f398a7d7056121 /stdlib/source/library/lux/tool/compiler
parent374ccf07246484eb7beb2cd87f3fc88396373ee1 (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.lux11
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