aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/js/function.jvm.lux
diff options
context:
space:
mode:
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/js/function.jvm.lux')
-rw-r--r--new-luxc/source/luxc/lang/translation/js/function.jvm.lux11
1 files changed, 6 insertions, 5 deletions
diff --git a/new-luxc/source/luxc/lang/translation/js/function.jvm.lux b/new-luxc/source/luxc/lang/translation/js/function.jvm.lux
index b0865a16e..b3c6761cd 100644
--- a/new-luxc/source/luxc/lang/translation/js/function.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/js/function.jvm.lux
@@ -7,13 +7,14 @@
[macro])
(luxc ["&" lang]
(lang ["ls" synthesis]
- [".L" variable #+ Variable]))
+ [".L" variable #+ Variable]
+ (host [js #+ JS Expression Statement])))
[//]
(// [".T" reference]
[".T" loop]))
(def: #export (translate-apply translate functionS argsS+)
- (-> (-> ls.Synthesis (Meta //.Expression)) ls.Synthesis (List ls.Synthesis) (Meta //.Expression))
+ (-> (-> ls.Synthesis (Meta Expression)) ls.Synthesis (List ls.Synthesis) (Meta Expression))
(do macro.Monad<Meta>
[functionJS (translate functionS)
argsJS+ (monad.map @ translate argsS+)]
@@ -23,7 +24,7 @@
(format "var " (referenceT.variable (n/inc register)) " = arguments[" (|> register nat-to-int %i) "];"))
(def: (with-closure inits function)
- (-> (List //.Expression) //.Expression //.Expression)
+ (-> (List Expression) Expression Expression)
(let [closure (case inits
#.Nil
(list)
@@ -36,9 +37,9 @@
";})(" (text.join-with "," inits) ")")))
(def: #export (translate-function translate env arity bodyS)
- (-> (-> ls.Synthesis (Meta //.Expression))
+ (-> (-> ls.Synthesis (Meta Expression))
(List Variable) ls.Arity ls.Synthesis
- (Meta //.Expression))
+ (Meta Expression))
(do macro.Monad<Meta>
[[function-name bodyJS] (//.with-sub-context
(do @