aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/js/primitive.jvm.lux
diff options
context:
space:
mode:
authorEduardo Julian2018-02-23 23:10:28 -0400
committerEduardo Julian2018-02-23 23:10:28 -0400
commit0bd93d82eb7a50b9ce8be42800c388e87e6ca9bf (patch)
tree847453417dbf6bf76be82efd498074029162d38b /new-luxc/source/luxc/lang/translation/js/primitive.jvm.lux
parentc8e2898611fa759cbe7c2ac84738b5b403575664 (diff)
- Added a code-generation utility module for JS.
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/js/primitive.jvm.lux')
-rw-r--r--new-luxc/source/luxc/lang/translation/js/primitive.jvm.lux15
1 files changed, 8 insertions, 7 deletions
diff --git a/new-luxc/source/luxc/lang/translation/js/primitive.jvm.lux b/new-luxc/source/luxc/lang/translation/js/primitive.jvm.lux
index 860cc7fae..2e1bf8389 100644
--- a/new-luxc/source/luxc/lang/translation/js/primitive.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/js/primitive.jvm.lux
@@ -6,16 +6,17 @@
text/format)
[macro "meta/" Monad<Meta>])
[//]
- (// [".T" runtime]))
+ (// [".T" runtime])
+ (luxc (lang (host [js #+ JS Expression Statement]))))
(def: #export translate-bool
- (-> Bool (Meta //.Expression))
+ (-> Bool (Meta Expression))
(|>> %b meta/wrap))
(def: low-mask Nat (n/dec (bit.shift-left +32 +1)))
(def: #export (translate-nat value)
- (-> Nat (Meta //.Expression))
+ (-> Nat (Meta Expression))
(let [high (|> value
(bit.shift-right +32)
nat-to-int %i)
@@ -25,7 +26,7 @@
(meta/wrap (format runtimeT.int//new "(" high "," low ")"))))
(def: #export translate-int
- (-> Int (Meta //.Expression))
+ (-> Int (Meta Expression))
(|>> int-to-nat translate-nat))
(def: deg-to-nat
@@ -33,11 +34,11 @@
(|>> (:! Nat)))
(def: #export translate-deg
- (-> Deg (Meta //.Expression))
+ (-> Deg (Meta Expression))
(|>> deg-to-nat translate-nat))
(def: #export translate-frac
- (-> Frac (Meta //.Expression))
+ (-> Frac (Meta Expression))
(|>> (cond> [(f/= number.positive-infinity)]
[(new> "Infinity")]
@@ -52,5 +53,5 @@
meta/wrap))
(def: #export translate-text
- (-> Text (Meta //.Expression))
+ (-> Text (Meta Expression))
(|>> %t meta/wrap))