aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/compiler.lux
diff options
context:
space:
mode:
authorEduardo Julian2016-12-27 19:40:11 -0400
committerEduardo Julian2016-12-27 19:40:11 -0400
commita10ff8416855e2079ba8da48cae43c80414666d0 (patch)
treeb0cb6f2453530c1b87d56299b6efb2088840c091 /stdlib/source/lux/compiler.lux
parent62cdfcec5980c936d5be8b37e34e8fb9533d1ba4 (diff)
- Now, it's possible to omit the module-prefix from the names of member functions/constants in struct auto-selection.
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/compiler.lux12
1 files changed, 12 insertions, 0 deletions
diff --git a/stdlib/source/lux/compiler.lux b/stdlib/source/lux/compiler.lux
index 437389717..feade4a8c 100644
--- a/stdlib/source/lux/compiler.lux
+++ b/stdlib/source/lux/compiler.lux
@@ -532,6 +532,18 @@
_
(fail ($_ Text/append "Unknown tag: " (Ident/encode tag))))))
+(def: #export (tag-lists module)
+ (-> Text (Lux (List [(List Ident) Type])))
+ (do Monad<Lux>
+ [=module (find-module module)
+ this-module-name current-module-name]
+ (wrap (|> (get@ #;types =module)
+ (list;filter (lambda [[type-name [tag-list exported? type]]]
+ (or exported?
+ (Text/= this-module-name module))))
+ (List/map (lambda [[type-name [tag-list exported? type]]]
+ [tag-list type]))))))
+
(def: #export locals
(Lux (List (List [Text Type])))
(lambda [state]