diff options
author | Eduardo Julian | 2021-08-23 02:30:53 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-08-23 02:30:53 -0400 |
commit | ec1f31b5a1492d5e0ab260397291d4449483bbd9 (patch) | |
tree | c730b4ca89af366779b0ad0f46fae705b5c2bcbc /lux-jvm/source/luxc/lang/translation | |
parent | 1ea83ecadccc5adee1bdb35bd11527c3982c015e (diff) |
The Python compiler can now be compiled by the new JVM compiler.
Diffstat (limited to 'lux-jvm/source/luxc/lang/translation')
-rw-r--r-- | lux-jvm/source/luxc/lang/translation/jvm/case.lux | 52 | ||||
-rw-r--r-- | lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux | 10 |
2 files changed, 31 insertions, 31 deletions
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/case.lux b/lux-jvm/source/luxc/lang/translation/jvm/case.lux index 3a6291036..eb1f37f0b 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/case.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/case.lux @@ -8,7 +8,7 @@ ["ex" exception (#+ exception:)]] [data [collection - ["." list ("#@." fold)]]] + ["." list ("#@." mix)]]] [math [number ["n" nat]]] @@ -132,21 +132,21 @@ [(<tag> cons) (do {@ phase.monad} [forkG (: (Operation Inst) - (monad.fold @ (function (_ [test thenP] elseG) - (do @ - [thenG (path' stack_depth @else @end phase archive thenP)] - (in (<| _.with_label (function (_ @else)) - (|>> <dup> - (<test> test) - <comparison> - (<if> @else) - <pop> - thenG - (_.label @else) - elseG))))) - (|>> <pop> - (_.GOTO @else)) - (#.Item cons)))] + (monad.mix @ (function (_ [test thenP] elseG) + (do @ + [thenG (path' stack_depth @else @end phase archive thenP)] + (in (<| _.with_label (function (_ @else)) + (|>> <dup> + (<test> test) + <comparison> + (<if> @else) + <pop> + thenG + (_.label @else) + elseG))))) + (|>> <pop> + (_.GOTO @else)) + (#.Item cons)))] (in (|>> peekI <unwrap> forkG)))]) @@ -266,16 +266,16 @@ (Generator [(List synthesis.Member) Synthesis]) (do phase.monad [recordG (phase archive recordS)] - (in (list@fold (function (_ step so_far) - (.let [next (.case step - (#.Left lefts) - (..left_projection lefts) - - (#.Right lefts) - (..right_projection lefts))] - (|>> so_far next))) - recordG - (list.reversed path))))) + (in (list@mix (function (_ step so_far) + (.let [next (.case step + (#.Left lefts) + (..left_projection lefts) + + (#.Right lefts) + (..right_projection lefts))] + (|>> so_far next))) + recordG + (list.reversed path))))) (def: .public (case phase archive [valueS path]) (Generator [Synthesis Path]) diff --git a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux index 31538a0bd..e2855e999 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux @@ -16,7 +16,7 @@ ["." text ("#\." equivalence) ["%" format (#+ format)]] [collection - ["." list ("#\." monad fold)] + ["." list ("#\." monad mix)] ["." dictionary (#+ Dictionary)] ["." set]]] [macro @@ -1031,10 +1031,10 @@ (-> Nat (List (Type Value)) Inst) (|> types list.enumeration - (list\fold (function (_ [lux_register type] [jvm_register before]) - (let [[jvm_register' after] (prepare_argument (n.+ offset lux_register) type jvm_register)] - [jvm_register' (|>> before after)])) - (: [Register Inst] [offset (|>>)])) + (list\mix (function (_ [lux_register type] [jvm_register before]) + (let [[jvm_register' after] (prepare_argument (n.+ offset lux_register) type jvm_register)] + [jvm_register' (|>> before after)])) + (: [Register Inst] [offset (|>>)])) product.right)) (def: .public (returnI returnT) |