aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/jvm/case.jvm.lux
diff options
context:
space:
mode:
authorEduardo Julian2019-04-07 21:12:08 -0400
committerEduardo Julian2019-04-07 21:12:08 -0400
commitd4ded2084127fd8953d2889d72bab889213000a1 (patch)
tree687159e2055e598bdc1d16336532ee1d53edb838 /new-luxc/source/luxc/lang/translation/jvm/case.jvm.lux
parenta42c2004388ca204cae7bd1b3f4ef21d208f72b2 (diff)
Upgraded the tuple right-access mechanism to the new style.
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/case.jvm.lux52
1 files changed, 29 insertions, 23 deletions
diff --git a/new-luxc/source/luxc/lang/translation/jvm/case.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/case.jvm.lux
index 22817e8eb..43d11c71e 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/case.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/case.jvm.lux
@@ -132,29 +132,35 @@
([synthesis.side/left _.NULL function.identity]
[synthesis.side/right (_.string "") .inc])
- (^template [<pattern> <method> <prepare>]
- (^ (<pattern> idx))
- (operation/wrap (.case (<prepare> idx)
- 0
- (|>> peekI
- (_.CHECKCAST ($t.descriptor runtime.$Tuple))
- (_.int +0)
- _.AALOAD
- pushI)
-
- idx
- (|>> peekI
- (_.CHECKCAST ($t.descriptor runtime.$Tuple))
- (_.int (.int idx))
- (_.INVOKESTATIC //.runtime-class
- <method>
- ($t.method (list runtime.$Tuple $t.int)
- (#.Some $Object)
- (list))
- #0)
- pushI))))
- ([synthesis.member/left "tuple_left" <|]
- [synthesis.member/right "pm_right" inc])
+ (^ (synthesis.member/left lefts))
+ (operation/wrap (.let [accessI (.case lefts
+ 0
+ _.AALOAD
+
+ lefts
+ (_.INVOKESTATIC //.runtime-class
+ "tuple_left"
+ ($t.method (list runtime.$Tuple $t.int)
+ (#.Some $Object)
+ (list))
+ #0))]
+ (|>> peekI
+ (_.CHECKCAST ($t.descriptor runtime.$Tuple))
+ (_.int (.int lefts))
+ accessI
+ pushI)))
+
+ (^ (synthesis.member/right lefts))
+ (operation/wrap (|>> peekI
+ (_.CHECKCAST ($t.descriptor runtime.$Tuple))
+ (_.int (.int lefts))
+ (_.INVOKESTATIC //.runtime-class
+ "tuple_right"
+ ($t.method (list runtime.$Tuple $t.int)
+ (#.Some $Object)
+ (list))
+ #0)
+ pushI))
(#synthesis.Alt leftP rightP)
(do phase.monad