diff options
author | Eduardo Julian | 2019-02-13 18:44:02 -0400 |
---|---|---|
committer | Eduardo Julian | 2019-02-13 18:44:02 -0400 |
commit | c60426c60a137b454f6177dcb2d563a942dde75f (patch) | |
tree | 7459ca78a034157e0005dad440657842a5e14be6 /new-luxc/source/luxc/lang/translation/js/primitive.jvm.lux | |
parent | 48f11e1d8394b516b778a0e76c5d29bf64492261 (diff) |
- WIP: Moved some of the JS compiler machinery over to stdlib.
- DRYed the reference translation machinery.
Diffstat (limited to '')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/js/primitive.jvm.lux | 41 |
1 files changed, 0 insertions, 41 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 deleted file mode 100644 index e69291007..000000000 --- a/new-luxc/source/luxc/lang/translation/js/primitive.jvm.lux +++ /dev/null @@ -1,41 +0,0 @@ -(.module: - lux - (lux (control pipe) - (data [bit] - [number] - text/format) - [macro "meta/" Monad<Meta>]) - [//] - (// [".T" runtime]) - (luxc (lang (host [js #+ JS Expression Statement])))) - -(def: #export translate-bit - (-> Bit (Meta Expression)) - (|>> %b meta/wrap)) - -(def: low-mask Nat (dec (bit.left-shift +32 +1))) - -(def: #export (translate-int value) - (-> Int (Meta Expression)) - (let [high (|> value (bit.logical-right-shift +32) %i) - low (|> value (bit.and low-mask) %i)] - (meta/wrap (format runtimeT.int//new "(" high "," low ")")))) - -(def: #export translate-frac - (-> Frac (Meta Expression)) - (|>> (cond> [(f/= number.positive-infinity)] - [(new> "Infinity")] - - [(f/= number.negative-infinity)] - [(new> "-Infinity")] - - [(f/= number.not-a-number)] - [(new> "NaN")] - - ## else - [%f]) - meta/wrap)) - -(def: #export translate-text - (-> Text (Meta Expression)) - (|>> %t meta/wrap)) |