diff options
author | Eduardo Julian | 2019-04-27 23:41:47 -0400 |
---|---|---|
committer | Eduardo Julian | 2019-04-27 23:41:47 -0400 |
commit | af7f85c4eb724f2888ecce9c8b52d6d3bb1cd807 (patch) | |
tree | 9d2b80257b5c82ebcc9f17bd32e9771ea51cc708 /new-luxc/source/luxc/lang/translation/jvm/case.lux | |
parent | aa7f1d12ae98da9726bf8bbdd3c494a671e3f94b (diff) |
Moved JVM type machinery to stdlib.
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/jvm/case.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/jvm/case.lux | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/new-luxc/source/luxc/lang/translation/jvm/case.lux b/new-luxc/source/luxc/lang/translation/jvm/case.lux index 43d11c71e..3c50f6124 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/case.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/case.lux @@ -8,15 +8,17 @@ [data [text format]] + [target + [jvm + ["$t" type]]] [tool [compiler ["." synthesis (#+ Path Synthesis)] - ["." phase ("operation/." monad)]]]] + ["." phase ("operation@." monad)]]]] [luxc [lang [host ["$" jvm (#+ Label Inst Operation Phase) - ["$t" type] ["_" inst]]]]] ["." // (#+ $Object) ["." runtime]]) @@ -63,34 +65,34 @@ (-> Phase Nat Label Label Path (Operation Inst)) (.case path #synthesis.Pop - (operation/wrap popI) + (operation@wrap popI) (#synthesis.Bind register) - (operation/wrap (|>> peekI + (operation@wrap (|>> peekI (_.ASTORE register))) (^ (synthesis.path/bit value)) - (operation/wrap (.let [jumpI (.if value _.IFEQ _.IFNE)] + (operation@wrap (.let [jumpI (.if value _.IFEQ _.IFNE)] (|>> peekI - (_.unwrap #$.Boolean) + (_.unwrap #$t.Boolean) (jumpI @else)))) (^ (synthesis.path/i64 value)) - (operation/wrap (|>> peekI - (_.unwrap #$.Long) + (operation@wrap (|>> peekI + (_.unwrap #$t.Long) (_.long (.int value)) _.LCMP (_.IFNE @else))) (^ (synthesis.path/f64 value)) - (operation/wrap (|>> peekI - (_.unwrap #$.Double) + (operation@wrap (|>> peekI + (_.unwrap #$t.Double) (_.double value) _.DCMPL (_.IFNE @else))) (^ (synthesis.path/text value)) - (operation/wrap (|>> peekI + (operation@wrap (|>> peekI (_.string value) (_.INVOKEVIRTUAL "java.lang.Object" "equals" @@ -110,7 +112,7 @@ (^template [<pattern> <flag> <prepare>] (^ (<pattern> idx)) - (operation/wrap (<| _.with-label (function (_ @success)) + (operation@wrap (<| _.with-label (function (_ @success)) _.with-label (function (_ @fail)) (|>> peekI (_.CHECKCAST ($t.descriptor runtime.$Variant)) @@ -133,7 +135,7 @@ [synthesis.side/right (_.string "") .inc]) (^ (synthesis.member/left lefts)) - (operation/wrap (.let [accessI (.case lefts + (operation@wrap (.let [accessI (.case lefts 0 _.AALOAD @@ -151,7 +153,7 @@ pushI))) (^ (synthesis.member/right lefts)) - (operation/wrap (|>> peekI + (operation@wrap (|>> peekI (_.CHECKCAST ($t.descriptor runtime.$Tuple)) (_.int (.int lefts)) (_.INVOKESTATIC //.runtime-class @@ -205,7 +207,7 @@ (wrap (<| _.with-label (function (_ @else)) _.with-label (function (_ @end)) (|>> testI - (_.unwrap #$.Boolean) + (_.unwrap #$t.Boolean) (_.IFEQ @else) thenI (_.GOTO @end) |