From bcd3d9ee8f6797f758a2abea98d5cb6a74cc7df0 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 15 Jun 2018 00:11:33 -0400 Subject: - WIP: Adjustments to new-luxc based on recent changes to stdlib. --- new-luxc/source/luxc/lang/translation/js/function.jvm.lux | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'new-luxc/source/luxc/lang/translation/js/function.jvm.lux') 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 b3c6761cd..ef5ea668e 100644 --- a/new-luxc/source/luxc/lang/translation/js/function.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/js/function.jvm.lux @@ -21,7 +21,7 @@ (wrap (format functionJS "(" (text.join-with "," argsJS+) ")")))) (def: (input-declaration register) - (format "var " (referenceT.variable (n/inc register)) " = arguments[" (|> register nat-to-int %i) "];")) + (format "var " (referenceT.variable (inc register)) " = arguments[" (|> register .int %i) "];")) (def: (with-closure inits function) (-> (List Expression) Expression Expression) @@ -30,7 +30,7 @@ (list) _ - (|> (list.n/range +0 (n/dec (list.size inits))) + (|> (list.n/range +0 (dec (list.size inits))) (list/map referenceT.closure)))] (format "(function(" (text.join-with "," closure) ") {" "return " function @@ -47,11 +47,11 @@ (//.with-anchor [function-name +1] (translate bodyS)))) closureJS+ (monad.map @ referenceT.translate-variable env) - #let [args-initsJS+ (|> (list.n/range +0 (n/dec arity)) + #let [args-initsJS+ (|> (list.n/range +0 (dec arity)) (list/map input-declaration) (text.join-with "")) selfJS (format "var " (referenceT.variable +0) " = " function-name ";") - arityJS (|> arity nat-to-int %i)]] + arityJS (|> arity .int %i)]] (wrap (<| (with-closure closureJS+) (format "(function " function-name "() {" "\"use strict\";" -- cgit v1.2.3