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/php | |
parent | bfd2d6c203042dfddb0ce29db3696365fe213314 (diff) |
- Re-named ":!" to ":coerce".
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/php')
5 files changed, 26 insertions, 26 deletions
diff --git a/new-luxc/source/luxc/lang/translation/php/case.jvm.lux b/new-luxc/source/luxc/lang/translation/php/case.jvm.lux index 3a5eff053..6f78637cf 100644 --- a/new-luxc/source/luxc/lang/translation/php/case.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/php/case.jvm.lux @@ -39,7 +39,7 @@ (let [method (if tail? runtimeT.product//right runtimeT.product//left)] - (method source (_.int (:! Int idx))))) + (method source (_.int (:coerce Int idx))))) valueO pathP)))) @@ -114,22 +114,22 @@ [_ (<tag> value)] (meta/wrap (_.when! (_.not (_.= (|> value <format>) cursor-top)) fail-pm!))) - ([#.Nat (<| _.int (:! Int))] + ([#.Nat (<| _.int (:coerce Int))] [#.Int _.int] - [#.Deg (<| _.int (:! Int))] + [#.Deg (<| _.int (:coerce Int))] [#.Bool _.bool] [#.Frac _.float] [#.Text _.string]) (^template [<pm> <getter>] (^code (<pm> (~ [_ (#.Nat idx)]))) - (meta/wrap (push-cursor! (<getter> cursor-top (_.int (:! Int idx)))))) + (meta/wrap (push-cursor! (<getter> cursor-top (_.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 (|> (_.set! @temp (runtimeT.sum//get cursor-top (_.int (:! Int idx)) <flag>)) + (meta/wrap (|> (_.set! @temp (runtimeT.sum//get cursor-top (_.int (:coerce Int idx)) <flag>)) (_.then! (_.if! (_.is-null/1 @temp) fail-pm! (push-cursor! @temp)))))) diff --git a/new-luxc/source/luxc/lang/translation/php/eval.jvm.lux b/new-luxc/source/luxc/lang/translation/php/eval.jvm.lux index 54ec6abc2..4b954c4f1 100644 --- a/new-luxc/source/luxc/lang/translation/php/eval.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/php/eval.jvm.lux @@ -29,8 +29,8 @@ (intValue [] Integer)) (exception: #export (Unknown-Kind-Of-Host-Object {host-object Object}) - (let [object-class (:! Text (Object::toString [] (Object::getClass [] (:! Object host-object)))) - text-representation (:! Text (Object::toString [] (:! Object host-object)))] + (let [object-class (:coerce Text (Object::toString [] (Object::getClass [] (:coerce Object host-object)))) + text-representation (:coerce Text (Object::toString [] (:coerce Object host-object)))] (format object-class " --- " text-representation))) (host.import php/runtime/Memory) @@ -63,18 +63,18 @@ (-> (-> Object (Error Any)) ArrayMemory (Error Any)) (let [size (ArrayMemory::size [] host-object)] (loop [idx 0 - output (: (Array Any) (array.new (:! Nat size)))] + output (: (Array Any) (array.new (:coerce Nat size)))] (if (i/< size idx) (let [value (|> host-object (ArrayMemory::get [(LongMemory::new [idx])]) - (:! ReferenceMemory) (ReferenceMemory::getValue []))] + (:coerce ReferenceMemory) (ReferenceMemory::getValue []))] (if (host.instance? php/runtime/memory/NullMemory value) (recur (inc idx) - (array.write (:! Nat idx) (host.null) output)) + (array.write (:coerce Nat idx) (host.null) output)) (do e.Monad<Error> [lux-value (lux-object value)] (recur (inc idx) - (array.write (:! Nat idx) lux-value output))))) + (array.write (:coerce Nat idx) lux-value output))))) (ex.return output))))) (def: (variant lux-object host-object) @@ -83,11 +83,11 @@ [variant-tag (lux-object (ArrayMemory::get [(StringMemory::new [//.variant-tag-field])] host-object)) variant-value (lux-object (ArrayMemory::get [(StringMemory::new [//.variant-value-field])] host-object))] (wrap (: Any - [(Long::intValue [] (:! Long variant-tag)) + [(Long::intValue [] (:coerce Long variant-tag)) (: Any (if (|> host-object (ArrayMemory::get [(StringMemory::new [//.variant-flag-field])]) - (:! ReferenceMemory) + (:coerce ReferenceMemory) (ReferenceMemory::getValue []) (host.instance? php/runtime/memory/NullMemory)) (host.null) @@ -103,21 +103,21 @@ (ex.return true) (host.instance? php/runtime/memory/LongMemory host-object) - (ex.return (LongMemory::toLong [] (:! LongMemory host-object))) + (ex.return (LongMemory::toLong [] (:coerce LongMemory host-object))) (host.instance? php/runtime/memory/DoubleMemory host-object) - (ex.return (DoubleMemory::toDouble [] (:! DoubleMemory host-object))) + (ex.return (DoubleMemory::toDouble [] (:coerce DoubleMemory host-object))) (host.instance? php/runtime/memory/StringMemory host-object) - (ex.return (StringMemory::toString [] (:! StringMemory host-object))) + (ex.return (StringMemory::toString [] (:coerce StringMemory host-object))) (host.instance? php/runtime/memory/ReferenceMemory host-object) - (lux-object (ReferenceMemory::getValue [] (:! ReferenceMemory host-object))) + (lux-object (ReferenceMemory::getValue [] (:coerce ReferenceMemory host-object))) (host.instance? php/runtime/memory/ArrayMemory host-object) - (if (ArrayMemory::isMap [] (:! ArrayMemory host-object)) - (variant lux-object (:! ArrayMemory host-object)) - (tuple lux-object (:! ArrayMemory host-object))) + (if (ArrayMemory::isMap [] (:coerce ArrayMemory host-object)) + (variant lux-object (:coerce ArrayMemory host-object)) + (tuple lux-object (:coerce ArrayMemory host-object))) ## else (ex.throw Unknown-Kind-Of-Host-Object host-object))) @@ -125,7 +125,7 @@ (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 code) (#e.Error error) ((lang.throw Cannot-Evaluate error) compiler) diff --git a/new-luxc/source/luxc/lang/translation/php/expression.jvm.lux b/new-luxc/source/luxc/lang/translation/php/expression.jvm.lux index 43497c93e..cd67be0f0 100644 --- a/new-luxc/source/luxc/lang/translation/php/expression.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/php/expression.jvm.lux @@ -37,9 +37,9 @@ [_ (<tag> value)] (|> value <generator>)) ([#.Bool primitiveT.translate-bool] - [#.Nat (<| primitiveT.translate-int (:! Int))] + [#.Nat (<| primitiveT.translate-int (:coerce Int))] [#.Int primitiveT.translate-int] - [#.Deg (<| primitiveT.translate-int (:! Int))] + [#.Deg (<| primitiveT.translate-int (:coerce Int))] [#.Frac primitiveT.translate-frac] [#.Text primitiveT.translate-text]) diff --git a/new-luxc/source/luxc/lang/translation/php/reference.jvm.lux b/new-luxc/source/luxc/lang/translation/php/reference.jvm.lux index 9146684e4..4364d87ea 100644 --- a/new-luxc/source/luxc/lang/translation/php/reference.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/php/reference.jvm.lux @@ -12,7 +12,7 @@ (do-template [<register> <prefix>] [(def: #export <register> (-> Register Var) - (|>> (:! Int) %i (format <prefix>) _.var))] + (|>> (:coerce Int) %i (format <prefix>) _.var))] [closure "c"] [variable "v"]) @@ -21,7 +21,7 @@ (-> Variable Var) (if (variableL.captured? var) (closure (variableL.captured-register var)) - (variable (:! Nat var)))) + (variable (:coerce Nat var)))) (def: #export global (-> Ident Var) diff --git a/new-luxc/source/luxc/lang/translation/php/statement.jvm.lux b/new-luxc/source/luxc/lang/translation/php/statement.jvm.lux index a20e164ca..70a39a575 100644 --- a/new-luxc/source/luxc/lang/translation/php/statement.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/php/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 [])) |