aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/type/unit.lux
diff options
context:
space:
mode:
authorEduardo Julian2020-12-23 06:33:44 -0400
committerEduardo Julian2020-12-23 06:33:44 -0400
commitd29e091e98dabb8dfcf816899ada480ecbf7e357 (patch)
treea9d34c7fbb700cdb0c1f1226d377150614ce9914 /stdlib/source/lux/type/unit.lux
parentcad959345afb8bf0bd1e5eefe6c63f136833b3ce (diff)
Refactored "export" common syntax.
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/type/unit.lux15
1 files changed, 8 insertions, 7 deletions
diff --git a/stdlib/source/lux/type/unit.lux b/stdlib/source/lux/type/unit.lux
index deffa4e83..9f5fdba78 100644
--- a/stdlib/source/lux/type/unit.lux
+++ b/stdlib/source/lux/type/unit.lux
@@ -20,7 +20,8 @@
[syntax (#+ syntax:)
["cs" common
["csr" reader]
- ["csw" writer]]]]
+ ["csw" writer]
+ ["|.|" export]]]]
[type
abstract]])
@@ -70,13 +71,13 @@
)
(syntax: #export (unit:
- {export csr.export}
+ {export |export|.parser}
{name s.local-identifier}
{annotations (p.default cs.empty-annotations csr.annotations)})
- (wrap (list (` (type: (~+ (csw.export export)) (~ (code.local-identifier name))
+ (wrap (list (` (type: (~+ (|export|.write export)) (~ (code.local-identifier name))
(~ (csw.annotations annotations))
(primitive (~ (code.text (unit-name name))))))
- (` (def: (~+ (csw.export export)) (~ (code.local-identifier (format "@" name)))
+ (` (def: (~+ (|export|.write export)) (~ (code.local-identifier (format "@" name)))
(~ (code.local-identifier name))
(:assume [])))
)))
@@ -93,15 +94,15 @@
(wrap [(.nat numerator) (.nat denominator)]))))
(syntax: #export (scale:
- {export csr.export}
+ {export |export|.parser}
{name s.local-identifier}
{(^slots [#ratio.numerator #ratio.denominator]) ratio^}
{annotations (p.default cs.empty-annotations csr.annotations)})
(let [g!scale (code.local-identifier name)]
- (wrap (list (` (type: (~+ (csw.export export)) ((~ g!scale) (~' u))
+ (wrap (list (` (type: (~+ (|export|.write export)) ((~ g!scale) (~' u))
(~ (csw.annotations annotations))
(primitive (~ (code.text (scale-name name))) [(~' u)])))
- (` (structure: (~+ (csw.export export)) (~ (code.local-identifier (format "@" name)))
+ (` (structure: (~+ (|export|.write export)) (~ (code.local-identifier (format "@" name)))
(..Scale (~ g!scale))
(def: (~' scale)
(|>> ..out