diff options
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 | 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))) |