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/reference.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/reference.jvm.lux | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/new-luxc/source/luxc/lang/translation/js/reference.jvm.lux b/new-luxc/source/luxc/lang/translation/js/reference.jvm.lux deleted file mode 100644 index 69a0075b1..000000000 --- a/new-luxc/source/luxc/lang/translation/js/reference.jvm.lux +++ /dev/null @@ -1,36 +0,0 @@ -(.module: - lux - (lux [macro] - (data [text] - text/format)) - (luxc ["&" lang] - (lang [".L" variable #+ Variable Register] - (host [js #+ JS Expression Statement]))) - [//] - (// [".T" runtime])) - -(do-template [<register> <translation> <prefix>] - [(def: #export (<register> register) - (-> Register Expression) - (format <prefix> (%i (.int register)))) - - (def: #export (<translation> register) - (-> Register (Meta Expression)) - (:: macro.Monad<Meta> wrap (<register> register)))] - - [closure translate-captured "c"] - [variable translate-local "v"]) - -(def: #export (translate-variable var) - (-> Variable (Meta Expression)) - (if (variableL.captured? var) - (translate-captured (variableL.captured-register var)) - (translate-local (.nat var)))) - -(def: #export global - (-> Name Expression) - //.definition-name) - -(def: #export (translate-definition name) - (-> Name (Meta Expression)) - (:: macro.Monad<Meta> wrap (global name))) |