diff options
author | Eduardo Julian | 2018-01-21 12:58:48 -0400 |
---|---|---|
committer | Eduardo Julian | 2018-01-21 12:58:48 -0400 |
commit | 498af2e0123c1ce65e46bf15fe3854266ad58f53 (patch) | |
tree | e8235092c959b91c4328c838450a9ac391e0cbcc /new-luxc/source/luxc/lang/translation/js/reference.jvm.lux | |
parent | 002ee0418195afccd1a1b500a36cc5b2adc44791 (diff) |
- WIP: Host procedures for JS.
Diffstat (limited to '')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/js/reference.jvm.lux | 28 |
1 files changed, 28 insertions, 0 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 new file mode 100644 index 000000000..33cf3ed7d --- /dev/null +++ b/new-luxc/source/luxc/lang/translation/js/reference.jvm.lux @@ -0,0 +1,28 @@ +(.module: + lux + (lux [macro] + (data [text] + text/format)) + (luxc ["&" lang]) + [//] + (// [".T" runtime])) + +(do-template [<register> <translation> <prefix>] + [(def: #export (<register> register) + (-> Nat //.Expression) + (format <prefix> (%n register))) + + (def: #export (<translation> register) + (-> Nat (Meta //.Expression)) + (:: macro.Monad<Meta> wrap (<register> register)))] + + [closure translate-local "c"] + [variable translate-captured "v"]) + +(def: #export (global [module name]) + (-> Ident //.Expression) + (format (text.replace-all "/" "_" module) "$" (&.normalize-name name))) + +(def: #export (translate-definition name) + (-> Ident (Meta //.Expression)) + (:: macro.Monad<Meta> wrap (global name))) |