aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/lua
diff options
context:
space:
mode:
authorEduardo Julian2018-03-13 23:28:19 -0400
committerEduardo Julian2018-03-13 23:28:19 -0400
commitb14f95ca68887d9e6cea211b47e04e5ec00c05fa (patch)
tree4fad118bec9800bfae885dcb6311e8755b98918a /new-luxc/source/luxc/lang/translation/lua
parent38bd6f35d81705ab0c04c85601ac5b236b62605a (diff)
- Initial Ruby back-end implementation.
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/lang/translation/lua/eval.jvm.lux2
-rw-r--r--new-luxc/source/luxc/lang/translation/lua/procedure/common.jvm.lux2
-rw-r--r--new-luxc/source/luxc/lang/translation/lua/runtime.jvm.lux11
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")