diff options
author | Eduardo Julian | 2018-07-03 18:40:16 -0400 |
---|---|---|
committer | Eduardo Julian | 2018-07-03 18:40:16 -0400 |
commit | d3f5e1f4baa667bc2eb72edd542cf5d8cd3924ce (patch) | |
tree | 2aa771401cce0d08276abc072b9d31e00a651f29 /new-luxc/source/luxc/lang/translation/lua | |
parent | bfd2d6c203042dfddb0ce29db3696365fe213314 (diff) |
- Re-named ":!" to ":coerce".
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/lua')
4 files changed, 18 insertions, 18 deletions
diff --git a/new-luxc/source/luxc/lang/translation/lua/case.jvm.lux b/new-luxc/source/luxc/lang/translation/lua/case.jvm.lux index ed084b44d..a72bf0011 100644 --- a/new-luxc/source/luxc/lang/translation/lua/case.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/lua/case.jvm.lux @@ -38,7 +38,7 @@ (let [method (if tail? runtimeT.product//right runtimeT.product//left)] - (method source (lua.int (:! Int idx))))) + (method source (lua.int (:coerce Int idx))))) valueO path)))) @@ -102,22 +102,22 @@ [_ (<tag> value)] (meta/wrap (lua.when! (lua.not (lua.= (|> value <format>) cursor-top)) (lua.return! pm-error)))) - ([#.Nat (<| lua.int (:! Int))] + ([#.Nat (<| lua.int (:coerce Int))] [#.Int lua.int] - [#.Deg (<| lua.int (:! Int))] + [#.Deg (<| lua.int (:coerce Int))] [#.Bool lua.bool] [#.Frac lua.float] [#.Text lua.string]) (^template [<pm> <getter>] (^code (<pm> (~ [_ (#.Nat idx)]))) - (meta/wrap (push-cursor! (<getter> cursor-top (lua.int (:! Int idx)))))) + (meta/wrap (push-cursor! (<getter> cursor-top (lua.int (:coerce Int idx)))))) (["lux case tuple left" runtimeT.product//left] ["lux case tuple right" runtimeT.product//right]) (^template [<pm> <flag>] (^code (<pm> (~ [_ (#.Nat idx)]))) - (meta/wrap (lua.block! (list (lua.set! "temp" (runtimeT.sum//get cursor-top (lua.int (:! Int idx)) <flag>)) + (meta/wrap (lua.block! (list (lua.set! "temp" (runtimeT.sum//get cursor-top (lua.int (:coerce Int idx)) <flag>)) (lua.if! (lua.= lua.nil "temp") (lua.return! pm-error) (push-cursor! "temp")))))) 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 0e413e7ad..0330f79c2 100644 --- a/new-luxc/source/luxc/lang/translation/lua/eval.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/lua/eval.jvm.lux @@ -45,7 +45,7 @@ (^multi [(#.Some tag) ?flag (#.Some value)] [(lux-object value) (#.Some value)]) - (#.Some [(Long::intValue [] (:! Long tag)) + (#.Some [(Long::intValue [] (:coerce Long tag)) (: Any (case ?flag (#.Some _) "" #.None (host.null))) value]) @@ -54,17 +54,17 @@ (def: (array lux-object host-object) (-> (-> Object (Error Any)) DefaultTable (Maybe (Array Object))) - (let [init-num-keys (:! Nat (Table::rawlen [] host-object))] + (let [init-num-keys (:coerce Nat (Table::rawlen [] host-object))] (loop [num-keys init-num-keys idx +0 output (: (Array Object) (array.new init-num-keys))] (if (n/< num-keys idx) - (case (Table::get-idx (:! Long (inc idx)) host-object) + (case (Table::get-idx (:coerce Long (inc idx)) host-object) (#.Some member) (case (lux-object member) (#e.Success parsed-member) - (recur num-keys (inc idx) (array.write idx (:! Object parsed-member) output)) + (recur num-keys (inc idx) (array.write idx (:coerce Object parsed-member) output)) (#e.Error error) #.None) @@ -85,10 +85,10 @@ (ex.return host-object) (host.instance? ByteString host-object) - (ex.return (ByteString::decode [] (:! ByteString host-object))) + (ex.return (ByteString::decode [] (:coerce ByteString host-object))) (host.instance? DefaultTable host-object) - (let [host-object (:! DefaultTable host-object)] + (let [host-object (:coerce DefaultTable host-object)] (case (variant lux-object host-object) (#.Some value) (ex.return value) @@ -99,23 +99,23 @@ (ex.return value) #.None - (ex.throw Unknown-Kind-Of-Host-Object (format "SECOND " (Object::toString [] (:! Object host-object))))))) + (ex.throw Unknown-Kind-Of-Host-Object (format "SECOND " (Object::toString [] (:coerce Object host-object))))))) ## else - (ex.throw Unknown-Kind-Of-Host-Object (format "FIRST " (Object::toString [] (:! Object host-object)))) + (ex.throw Unknown-Kind-Of-Host-Object (format "FIRST " (Object::toString [] (:coerce Object host-object)))) )) (def: #export (eval code) (-> Expression (Meta Any)) (function (_ compiler) - (let [interpreter (|> compiler (get@ #.host) (:! //.Host) (get@ #//.interpreter))] + (let [interpreter (|> compiler (get@ #.host) (:coerce //.Host) (get@ #//.interpreter))] (case (interpreter (format "return " code ";")) (#e.Error error) ((lang.throw Cannot-Evaluate error) compiler) (#e.Success output) (case (lux-object (|> output - (:! (Array Object)) + (:coerce (Array Object)) (array.read +0) maybe.assume)) (#e.Success parsed-output) diff --git a/new-luxc/source/luxc/lang/translation/lua/primitive.jvm.lux b/new-luxc/source/luxc/lang/translation/lua/primitive.jvm.lux index c322e5005..5769f6890 100644 --- a/new-luxc/source/luxc/lang/translation/lua/primitive.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/lua/primitive.jvm.lux @@ -16,11 +16,11 @@ (def: #export translate-nat (-> Nat (Meta Expression)) - (|>> (:! Int) %i meta/wrap)) + (|>> (:coerce Int) %i meta/wrap)) (def: #export translate-deg (-> Deg (Meta Expression)) - (|>> (:! Int) %i meta/wrap)) + (|>> (:coerce Int) %i meta/wrap)) (def: #export translate-frac (-> Frac (Meta Expression)) diff --git a/new-luxc/source/luxc/lang/translation/lua/statement.jvm.lux b/new-luxc/source/luxc/lang/translation/lua/statement.jvm.lux index 3a438ae65..8ff9c1ccd 100644 --- a/new-luxc/source/luxc/lang/translation/lua/statement.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/lua/statement.jvm.lux @@ -34,7 +34,7 @@ (wrap []) tags - (moduleL.declare-tags tags (macro.export? metaV) (:! Type expressionV))) + (moduleL.declare-tags tags (macro.export? metaV) (:coerce Type expressionV))) (wrap [])) #let [_ (log! (format "DEF " (%ident def-ident)))]] (wrap [])) |