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/reference.jvm.lux | |
parent | c8e2898611fa759cbe7c2ac84738b5b403575664 (diff) |
- Added a code-generation utility module for JS.
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/js/reference.jvm.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/js/reference.jvm.lux | 13 |
1 files changed, 7 insertions, 6 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 index d9e508193..0c5cc3a44 100644 --- a/new-luxc/source/luxc/lang/translation/js/reference.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/js/reference.jvm.lux @@ -4,32 +4,33 @@ (data [text] text/format)) (luxc ["&" lang] - (lang [".L" variable #+ Variable Register])) + (lang [".L" variable #+ Variable Register] + (host [js #+ JS Expression Statement]))) [//] (// [".T" runtime])) (do-template [<register> <translation> <prefix>] [(def: #export (<register> register) - (-> Register //.Expression) + (-> Register Expression) (format <prefix> (%i (nat-to-int register)))) (def: #export (<translation> register) - (-> Register (Meta //.Expression)) + (-> 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)) + (-> Variable (Meta Expression)) (if (variableL.captured? var) (translate-captured (variableL.captured-register var)) (translate-local (int-to-nat var)))) (def: #export global - (-> Ident //.Expression) + (-> Ident Expression) //.definition-name) (def: #export (translate-definition name) - (-> Ident (Meta //.Expression)) + (-> Ident (Meta Expression)) (:: macro.Monad<Meta> wrap (global name))) |