From 0bd93d82eb7a50b9ce8be42800c388e87e6ca9bf Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 23 Feb 2018 23:10:28 -0400 Subject: - Added a code-generation utility module for JS. --- .../source/luxc/lang/translation/js/primitive.jvm.lux | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'new-luxc/source/luxc/lang/translation/js/primitive.jvm.lux') 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]) [//] - (// [".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)) -- cgit v1.2.3