diff options
Diffstat (limited to '')
-rw-r--r-- | lux-jvm/source/luxc/lang/translation/jvm/case.lux | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/case.lux b/lux-jvm/source/luxc/lang/translation/jvm/case.lux index e21cf9aec..7962ea991 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/case.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/case.lux @@ -153,18 +153,13 @@ ([synthesis.side/left _.NULL function.identity] [synthesis.side/right (_.string "") .inc]) - (^ (synthesis.member/left lefts)) - (operation@wrap (|>> peekI - (..left-projection lefts) - pushI)) - - (^ (synthesis.member/right lefts)) - (operation@wrap (|>> peekI - (..right-projection lefts) - pushI)) - ## Extra optimization (^template [<path> <projection>] + (^ (<path> lefts)) + (operation@wrap (|>> peekI + (<projection> lefts) + pushI)) + (^ (synthesis.path/seq (<path> lefts) (synthesis.!bind-top register thenP))) @@ -177,6 +172,13 @@ ([synthesis.member/left ..left-projection] [synthesis.member/right ..right-projection]) + (#synthesis.Seq leftP rightP) + (do phase.monad + [leftI (path' stack-depth @else @end phase archive leftP) + rightI (path' stack-depth @else @end phase archive rightP)] + (wrap (|>> leftI + rightI))) + (#synthesis.Alt leftP rightP) (do phase.monad [@alt-else _.make-label @@ -187,13 +189,6 @@ (_.label @alt-else) _.POP rightI))) - - (#synthesis.Seq leftP rightP) - (do phase.monad - [leftI (path' stack-depth @else @end phase archive leftP) - rightI (path' stack-depth @else @end phase archive rightP)] - (wrap (|>> leftI - rightI))) )) (def: (path @end phase archive path) |