diff options
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/jvm/structure.jvm.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/jvm/structure.jvm.lux | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/new-luxc/source/luxc/lang/translation/jvm/structure.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/structure.jvm.lux index 040c4dd59..f937d5bdb 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/structure.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/structure.jvm.lux @@ -46,18 +46,20 @@ (_.array $Object) membersI)))) -(def: (flagI tail?) +(def: (flagI right?) (-> Bit Inst) - (if tail? + (if right? (_.string "") _.NULL)) -(def: #export (variant translate tag tail? member) +(def: #export (variant translate lefts right? member) (-> Phase Nat Bit Synthesis (Operation Inst)) (do phase.Monad<Operation> [memberI (translate member)] - (wrap (|>> (_.int (.int tag)) - (flagI tail?) + (wrap (|>> (_.int (.int (if right? + (.inc lefts) + lefts))) + (flagI right?) memberI (_.INVOKESTATIC //.runtime-class "variant_make" |