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/structure.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/structure.jvm.lux | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/new-luxc/source/luxc/lang/translation/js/structure.jvm.lux b/new-luxc/source/luxc/lang/translation/js/structure.jvm.lux deleted file mode 100644 index 580f48807..000000000 --- a/new-luxc/source/luxc/lang/translation/js/structure.jvm.lux +++ /dev/null @@ -1,31 +0,0 @@ -(.module: - lux - (lux (control [monad #+ do]) - (data [text] - text/format) - [macro]) - (luxc ["&" lang] - (lang [synthesis #+ Synthesis] - (host [js #+ JS Expression Statement]))) - [//] - (// [".T" runtime])) - -(def: #export (translate-tuple translate elemsS+) - (-> (-> Synthesis (Meta Expression)) (List Synthesis) (Meta Expression)) - (case elemsS+ - #.Nil - (:: macro.Monad<Meta> wrap runtimeT.unit) - - (#.Cons singletonS #.Nil) - (translate singletonS) - - _ - (do macro.Monad<Meta> - [elemsT+ (monad.map @ translate elemsS+)] - (wrap (format "[" (text.join-with "," elemsT+) "]"))))) - -(def: #export (translate-variant translate tag tail? valueS) - (-> (-> Synthesis (Meta Expression)) Nat Bit Synthesis (Meta Expression)) - (do macro.Monad<Meta> - [valueT (translate valueS)] - (wrap (runtimeT.variant tag tail? valueT)))) |