diff options
author | Eduardo Julian | 2018-02-23 23:10:28 -0400 |
---|---|---|
committer | Eduardo Julian | 2018-02-23 23:10:28 -0400 |
commit | 0bd93d82eb7a50b9ce8be42800c388e87e6ca9bf (patch) | |
tree | 847453417dbf6bf76be82efd498074029162d38b /new-luxc/source/luxc/lang/translation/js/primitive.jvm.lux | |
parent | c8e2898611fa759cbe7c2ac84738b5b403575664 (diff) |
- Added a code-generation utility module for JS.
Diffstat (limited to '')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/js/primitive.jvm.lux | 15 |
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)) |