diff options
author | Eduardo Julian | 2018-08-11 23:27:32 -0400 |
---|---|---|
committer | Eduardo Julian | 2018-08-11 23:27:32 -0400 |
commit | 453ab9f67873bb022acadf4c0f5c1e635c7d5794 (patch) | |
tree | fa2419e2bb78b37e75f2ac070e0916776116638d /new-luxc/source/luxc/lang/translation/jvm/structure.jvm.lux | |
parent | 425148d29846ba507599b220d4df05c805e8d38a (diff) |
- Fixed common translation tests for JVM.
- Fixed a bug in "lux text <".
- Small optimizations to old LuxC.
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" |