diff options
Diffstat (limited to 'lux-jvm/source/luxc/lang/translation')
7 files changed, 29 insertions, 29 deletions
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/case.lux b/lux-jvm/source/luxc/lang/translation/jvm/case.lux index d3f6a29c1..3a6291036 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/case.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/case.lux @@ -212,7 +212,7 @@ (#synthesis.Alt leftP rightP) (do phase.monad [@alt_else _.make_label - leftI (path' (inc stack_depth) @alt_else @end phase archive leftP) + leftI (path' (++ stack_depth) @alt_else @end phase archive leftP) rightI (path' stack_depth @else @end phase archive rightP)] (in (|>> _.DUP leftI diff --git a/lux-jvm/source/luxc/lang/translation/jvm/common.lux b/lux-jvm/source/luxc/lang/translation/jvm/common.lux index b6bba249f..cfdadecb5 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/common.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/common.lux @@ -31,18 +31,18 @@ ... (def: .public (with-artifacts action) ... (All [a] (-> (Meta a) (Meta [Artifacts a]))) ... (function (_ state) -... (case (action (update@ #.host +... (case (action (revised@ #.host ... (|>> (:coerce Host) -... (set@ #artifacts (dictionary.new text.hash)) +... (with@ #artifacts (dictionary.new text.hash)) ... (:coerce Nothing)) ... state)) ... (#try.Success [state' output]) -... (#try.Success [(update@ #.host +... (#try.Success [(revised@ #.host ... (|>> (:coerce Host) -... (set@ #artifacts (|> (get@ #.host state) (:coerce Host) (get@ #artifacts))) +... (with@ #artifacts (|> (value@ #.host state) (:coerce Host) (value@ #artifacts))) ... (:coerce Nothing)) ... state') -... [(|> state' (get@ #.host) (:coerce Host) (get@ #artifacts)) +... [(|> state' (value@ #.host) (:coerce Host) (value@ #artifacts)) ... output]]) ... (#try.Failure error) 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 20962c13d..31538a0bd 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux @@ -977,7 +977,7 @@ list.indices (list\map (.function (_ register) (|>> (_.ALOAD 0) - (_.ALOAD (inc register)) + (_.ALOAD (++ register)) (_.PUTFIELD class (///reference.foreign_name register) $Object)))) _.fuse)] (_def.method #$.Public $.noneM "<init>" (anonymous_init_method env) diff --git a/lux-jvm/source/luxc/lang/translation/jvm/function.lux b/lux-jvm/source/luxc/lang/translation/jvm/function.lux index 9af108496..0508e9c62 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/function.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/function.lux @@ -58,9 +58,9 @@ (-> (Environment Synthesis) Arity (Type Method)) (if (poly_arg? arity) (type.method [(list) - (list.joined (list (captured_args env) - (list type.int) - (list.repeated (dec arity) //.$Value))) + (list.together (list (captured_args env) + (list type.int) + (list.repeated (-- arity) //.$Value))) type.void (list)]) (type.method [(list) (captured_args env) type.void (list)]))) @@ -80,7 +80,7 @@ (def: (inputsI start amount) (-> Register Nat Inst) - (|> (enum.range n.enum start (n.+ start (dec amount))) + (|> (enum.range n.enum start (n.+ start (-- amount))) (list@map _.ALOAD) _.fuse)) @@ -111,7 +111,7 @@ (do {@ phase.monad} [captureI+ (monad.map @ (generate archive) env) .let [argsI (if (poly_arg? arity) - (|> (nullsI (dec arity)) + (|> (nullsI (-- arity)) (list (_.int +0)) _.fuse) function.identity)]] @@ -132,12 +132,12 @@ (let [env_size (list.size env) captureI (|> (case env_size 0 (list) - _ (enum.range n.enum 0 (dec env_size))) + _ (enum.range n.enum 0 (-- env_size))) (list@map (.function (_ source) (|>> (_.ALOAD 0) (_.GETFIELD class (reference.foreign_name source) //.$Value)))) _.fuse) - argsI (|> (nullsI (dec arity)) + argsI (|> (nullsI (-- arity)) (list (_.int +0)) _.fuse)] (|>> (_.NEW class) @@ -164,20 +164,20 @@ (if (n.= 1 arity) (|>> (_.int +0) (_.INVOKESPECIAL //.$Function "<init>" function_init_method)) - (|>> (_.ILOAD (inc env_size)) + (|>> (_.ILOAD (++ env_size)) (_.INVOKESPECIAL //.$Function "<init>" function_init_method)))) (def: (with_init class env arity) (-> (Type Class) (Environment Synthesis) Arity Def) (let [env_size (list.size env) offset_partial (: (-> Nat Nat) - (|>> inc (n.+ env_size))) + (|>> ++ (n.+ env_size))) store_capturedI (|> (case env_size 0 (list) - _ (enum.range n.enum 0 (dec env_size))) + _ (enum.range n.enum 0 (-- env_size))) (list@map (.function (_ register) (|>> (_.ALOAD 0) - (_.ALOAD (inc register)) + (_.ALOAD (++ register)) (_.PUTFIELD class (reference.foreign_name register) //.$Value)))) _.fuse) store_partialI (if (poly_arg? arity) @@ -185,7 +185,7 @@ (list@map (.function (_ idx) (let [register (offset_partial idx)] (|>> (_.ALOAD 0) - (_.ALOAD (inc register)) + (_.ALOAD (++ register)) (_.PUTFIELD class (reference.partial_name idx) //.$Value))))) _.fuse) function.identity)] @@ -199,7 +199,7 @@ (def: (with_apply class env function_arity @begin bodyI apply_arity) (-> (Type Class) (Environment Synthesis) Arity Label Inst Arity Def) - (let [num_partials (dec function_arity) + (let [num_partials (-- function_arity) @default ($.new_label []) @labels (list@map $.new_label (list.repeated num_partials [])) over_extent (|> (.int function_arity) (i.- (.int apply_arity))) @@ -207,7 +207,7 @@ (list.zipped/2 (enum.range n.enum 0 num_partials)) (list@map (.function (_ [stage @label]) (let [load_partialsI (if (n.> 0 stage) - (|> (enum.range n.enum 0 (dec stage)) + (|> (enum.range n.enum 0 (-- stage)) (list@map (|>> reference.partial_name (load_fieldI class))) _.fuse) function.identity)] @@ -230,14 +230,14 @@ load_partialsI (inputsI 1 args_to_completion) (_.INVOKEVIRTUAL class "impl" (implementation_method function_arity)) - (applysI (inc args_to_completion) args_left) + (applysI (++ args_to_completion) args_left) _.ARETURN)) ... (i.< over_extent (.int stage)) (let [env_size (list.size env) load_capturedI (|> (case env_size 0 (list) - _ (enum.range n.enum 0 (dec env_size))) + _ (enum.range n.enum 0 (-- env_size))) (list@map (|>> reference.foreign_name (load_fieldI class))) _.fuse)] (|>> (_.label @label) @@ -255,7 +255,7 @@ _.fuse)] (def.method #$.Public $.noneM //runtime.apply_method (//runtime.apply_signature apply_arity) (|>> get_amount_of_partialsI - (_.TABLESWITCH +0 (|> num_partials dec .int) + (_.TABLESWITCH +0 (|> num_partials -- .int) @default @labels) casesI )))) diff --git a/lux-jvm/source/luxc/lang/translation/jvm/program.lux b/lux-jvm/source/luxc/lang/translation/jvm/program.lux index 8d95becc1..ab36835da 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/program.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/program.lux @@ -29,7 +29,7 @@ (-> (-> Context Text) (Program _.Inst _.Definition)) (let [nilI runtime.noneI num_inputsI (|>> ($i.ALOAD 0) $i.ARRAYLENGTH) - decI (|>> ($i.int +1) $i.ISUB) + --I (|>> ($i.int +1) $i.ISUB) headI (|>> $i.DUP ($i.ALOAD 0) $i.SWAP @@ -59,7 +59,7 @@ (|>> nilI num_inputsI ($i.label @loop) - decI + --I $i.DUP ($i.IFLT @end) headI diff --git a/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux b/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux index 2808065c6..23d59b8f4 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux @@ -361,11 +361,11 @@ (let [applyI (|> (enum.range n.enum 2 num_apply_variants) (list@map (function (_ arity) ($d.method #$.Public $.noneM apply_method (apply_signature arity) - (let [preI (|> (enum.range n.enum 0 (dec arity)) + (let [preI (|> (enum.range n.enum 0 (-- arity)) (list@map _.ALOAD) _.fuse)] (|>> preI - (_.INVOKEVIRTUAL //.$Function apply_method (apply_signature (dec arity))) + (_.INVOKEVIRTUAL //.$Function apply_method (apply_signature (-- arity))) (_.CHECKCAST //.$Function) (_.ALOAD arity) (_.INVOKEVIRTUAL //.$Function apply_method (apply_signature 1)) diff --git a/lux-jvm/source/luxc/lang/translation/jvm/structure.lux b/lux-jvm/source/luxc/lang/translation/jvm/structure.lux index ce9c56aed..71e9c514f 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/structure.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/structure.lux @@ -75,7 +75,7 @@ (def: .public (tagI lefts right?) (-> Nat Bit Inst) (case (if right? - (.inc lefts) + (.++ lefts) lefts) 0 _.ICONST_0 1 _.ICONST_1 |