diff options
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/lua')
3 files changed, 6 insertions, 9 deletions
diff --git a/new-luxc/source/luxc/lang/translation/lua/eval.jvm.lux b/new-luxc/source/luxc/lang/translation/lua/eval.jvm.lux index 331ec857d..c42ba0668 100644 --- a/new-luxc/source/luxc/lang/translation/lua/eval.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/lua/eval.jvm.lux @@ -8,7 +8,7 @@ (coll [array])) [host]) (luxc [lang] - (lang (host [js #+ JS Expression Statement]))) + (lang (host [lua #+ Lua Expression Statement]))) [//]) (host.import java/lang/Object diff --git a/new-luxc/source/luxc/lang/translation/lua/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/lua/procedure/common.jvm.lux index 2b277dec4..77e57a5db 100644 --- a/new-luxc/source/luxc/lang/translation/lua/procedure/common.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/lua/procedure/common.jvm.lux @@ -176,7 +176,7 @@ (def: (array//remove [arrayO idxO]) Binary - (runtimeT.array//remove arrayO idxO)) + (runtimeT.array//put arrayO idxO runtimeT.unit)) (def: array//size Unary diff --git a/new-luxc/source/luxc/lang/translation/lua/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/lua/runtime.jvm.lux index b5e2147e0..50b8008dd 100644 --- a/new-luxc/source/luxc/lang/translation/lua/runtime.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/lua/runtime.jvm.lux @@ -19,8 +19,8 @@ (def: (flag value) (-> Bool Lua) (if value - (%t "") - "null")) + (lua.string "") + lua.nil)) (def: (variant' tag last? value) (-> Expression Expression Expression Expression) @@ -111,7 +111,7 @@ (runtime: (lux//program-args program-args) (lua.block! (list (lua.local! "inputs" (#.Some none)) - (lua.for-step! "idx" (lua.int 1) (lua.length program-args) (lua.int 1) + (lua.for-step! "idx" (lua.length program-args) (lua.int 1) (lua.int -1) (lua.set! "inputs" (some (lua.array (list (lua.nth "idx" program-args) "inputs"))))) (lua.return! "inputs")))) @@ -378,17 +378,14 @@ (lua.block! (list (lua.set! (lua.nth idx array) value) (lua.return! array))))) -(runtime: (array//remove array idx) - (array//put array idx unit)) - (def: runtime//array Runtime (format @@array//sub @@array//concat @@array//copy + @@array//new @@array//get @@array//put - @@array//remove )) (def: #export atom//field Text "_lux_atom") |