aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/python
diff options
context:
space:
mode:
authorEduardo Julian2018-07-03 18:40:16 -0400
committerEduardo Julian2018-07-03 18:40:16 -0400
commitd3f5e1f4baa667bc2eb72edd542cf5d8cd3924ce (patch)
tree2aa771401cce0d08276abc072b9d31e00a651f29 /new-luxc/source/luxc/lang/translation/python
parentbfd2d6c203042dfddb0ce29db3696365fe213314 (diff)
- Re-named ":!" to ":coerce".
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/python')
-rw-r--r--new-luxc/source/luxc/lang/translation/python/case.jvm.lux10
-rw-r--r--new-luxc/source/luxc/lang/translation/python/eval.jvm.lux14
-rw-r--r--new-luxc/source/luxc/lang/translation/python/primitive.jvm.lux4
-rw-r--r--new-luxc/source/luxc/lang/translation/python/statement.jvm.lux2
4 files changed, 15 insertions, 15 deletions
diff --git a/new-luxc/source/luxc/lang/translation/python/case.jvm.lux b/new-luxc/source/luxc/lang/translation/python/case.jvm.lux
index f51acc402..aedf2a6e1 100644
--- a/new-luxc/source/luxc/lang/translation/python/case.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/python/case.jvm.lux
@@ -38,7 +38,7 @@
(let [method (if tail?
runtimeT.product//right
runtimeT.product//left)]
- (method source (python.int (:! Int idx)))))
+ (method source (python.int (:coerce Int idx)))))
valueO
pathP))))
@@ -115,23 +115,23 @@
[_ (<tag> value)]
(meta/wrap (python.when! (python.not (python.= (|> value <format>) cursor-top))
fail-pm!)))
- ([#.Nat (<| python.int (:! Int))]
+ ([#.Nat (<| python.int (:coerce Int))]
[#.Int python.int]
- [#.Deg (<| python.int (:! Int))]
+ [#.Deg (<| python.int (:coerce Int))]
[#.Bool python.bool]
[#.Frac python.float]
[#.Text python.string])
(^template [<pm> <getter>]
(^code (<pm> (~ [_ (#.Nat idx)])))
- (meta/wrap (push-cursor! (<getter> cursor-top (python.int (:! Int idx))))))
+ (meta/wrap (push-cursor! (<getter> cursor-top (python.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 ($_ python.then!
- (python.set! (list $temp) (runtimeT.sum//get cursor-top (python.int (:! Int idx)) <flag>))
+ (python.set! (list $temp) (runtimeT.sum//get cursor-top (python.int (:coerce Int idx)) <flag>))
(python.if! (python.= python.none (@@ $temp))
fail-pm!
(push-cursor! (@@ $temp))))))
diff --git a/new-luxc/source/luxc/lang/translation/python/eval.jvm.lux b/new-luxc/source/luxc/lang/translation/python/eval.jvm.lux
index df1e7004c..88fdd3173 100644
--- a/new-luxc/source/luxc/lang/translation/python/eval.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/python/eval.jvm.lux
@@ -46,11 +46,11 @@
(def: (tuple lux-object host-object)
(-> (-> PyObject (Error Any)) PyObject (Error Any))
- (let [size (:! Nat (PyObject::__len__ [] host-object))]
+ (let [size (:coerce Nat (PyObject::__len__ [] host-object))]
(loop [idx +0
- output (:! (Array Any) (array.new size))]
+ output (:coerce (Array Any) (array.new size))]
(if (n/< size idx)
- (case (PyObject::__getitem__ [(:! Int idx)] host-object)
+ (case (PyObject::__getitem__ [(:coerce Int idx)] host-object)
(#e.Error error)
(#e.Error error)
@@ -65,7 +65,7 @@
(def: python-type
(-> PyObject Text)
- (|>> (PyObject::getType []) (PyType::getName []) (:! Text)))
+ (|>> (PyObject::getType []) (PyType::getName []) (:coerce Text)))
(def: tag-field (PyString::new [//.variant-tag-field]))
(def: flag-field (PyString::new [//.variant-flag-field]))
@@ -84,9 +84,9 @@
(#e.Success tag)]
[(lux-object value)
(#e.Success value)])
- (#e.Success [(Long::intValue [] (:! Long tag))
+ (#e.Success [(Long::intValue [] (:coerce Long tag))
(: Any
- (case (python-type (:! PyObject flag))
+ (case (python-type (:coerce PyObject flag))
"NoneType"
(host.null)
@@ -127,7 +127,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)
(exec (log! (format "eval #e.Error\n"
diff --git a/new-luxc/source/luxc/lang/translation/python/primitive.jvm.lux b/new-luxc/source/luxc/lang/translation/python/primitive.jvm.lux
index 7b2ba1786..f1cf731a2 100644
--- a/new-luxc/source/luxc/lang/translation/python/primitive.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/python/primitive.jvm.lux
@@ -13,11 +13,11 @@
(def: #export translate-nat
(-> Nat (Meta Expression))
- (|>> (:! Int) python.int meta/wrap))
+ (|>> (:coerce Int) python.int meta/wrap))
(def: #export translate-deg
(-> Deg (Meta Expression))
- (|>> (:! Int) python.int meta/wrap))
+ (|>> (:coerce Int) python.int meta/wrap))
(def: #export translate-frac
(-> Frac (Meta Expression))
diff --git a/new-luxc/source/luxc/lang/translation/python/statement.jvm.lux b/new-luxc/source/luxc/lang/translation/python/statement.jvm.lux
index 23b51371c..c241afa8a 100644
--- a/new-luxc/source/luxc/lang/translation/python/statement.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/python/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 []))