From 498af2e0123c1ce65e46bf15fe3854266ad58f53 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 21 Jan 2018 12:58:48 -0400 Subject: - WIP: Host procedures for JS. --- .../luxc/lang/translation/js/reference.jvm.lux | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 new-luxc/source/luxc/lang/translation/js/reference.jvm.lux (limited to 'new-luxc/source/luxc/lang/translation/js/reference.jvm.lux') 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 [ ] + [(def: #export ( register) + (-> Nat //.Expression) + (format (%n register))) + + (def: #export ( register) + (-> Nat (Meta //.Expression)) + (:: macro.Monad wrap ( 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 wrap (global name))) -- cgit v1.2.3