From 0bd93d82eb7a50b9ce8be42800c388e87e6ca9bf Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 23 Feb 2018 23:10:28 -0400 Subject: - Added a code-generation utility module for JS. --- new-luxc/source/luxc/lang/translation/js/reference.jvm.lux | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (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 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 [ ] [(def: #export ( register) - (-> Register //.Expression) + (-> Register Expression) (format (%i (nat-to-int register)))) (def: #export ( register) - (-> Register (Meta //.Expression)) + (-> Register (Meta Expression)) (:: macro.Monad wrap ( 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 wrap (global name))) -- cgit v1.2.3