aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/macro/syntax/common/writer.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/lux/macro/syntax/common/writer.lux')
-rw-r--r--stdlib/source/lux/macro/syntax/common/writer.lux24
1 files changed, 24 insertions, 0 deletions
diff --git a/stdlib/source/lux/macro/syntax/common/writer.lux b/stdlib/source/lux/macro/syntax/common/writer.lux
new file mode 100644
index 000000000..72e4a11eb
--- /dev/null
+++ b/stdlib/source/lux/macro/syntax/common/writer.lux
@@ -0,0 +1,24 @@
+(;module: {#;doc "Commons syntax writers."}
+ lux
+ (lux (data (coll [list "L/" Functor<List>])
+ [product])
+ (macro [code]))
+ [.. #*])
+
+## Exports
+(def: #export (export ?el)
+ (-> (Maybe Export) (List Code))
+ (case ?el
+ #;None
+ (list)
+
+ (#;Some #..;Exported)
+ (list (' #export))
+
+ (#;Some #..;Hidden)
+ (list (' #hidden))))
+
+## Annotations
+(def: #export (annotations anns)
+ (-> Annotations Code)
+ (|> anns (L/map (product;both code;tag id)) code;record))