diff options
Diffstat (limited to 'stdlib/source/library/lux/meta/compiler/language')
18 files changed, 86 insertions, 73 deletions
diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/analysis/coverage.lux b/stdlib/source/library/lux/meta/compiler/language/lux/analysis/coverage.lux index 4756538e2..45097d4a5 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/analysis/coverage.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/analysis/coverage.lux @@ -86,7 +86,7 @@ (def (= reference sample) (case [reference sample] [{#Exhaustive} {#Exhaustive}] - #1 + true [{#Bit sideR} {#Bit sideS}] (bit#= sideR sideS) @@ -117,7 +117,7 @@ (list.zipped_2 flatR flatS)))) _ - #0)))) + false)))) (use "/#[0]" ..equivalence) @@ -251,10 +251,10 @@ (-> Coverage Bit) (case coverage {#Exhaustive} - #1 + true _ - #0)) + false)) ... After determining the coverage of each individual pattern, it is ... necessary to merge them all to figure out if the entire @@ -326,7 +326,7 @@ [{#Seq leftA rightA} {#Seq leftSF rightSF}] (case [(/#= leftSF leftA) (/#= rightSF rightA)] ... Same prefix - [#1 #0] + [.true .false] (do try.monad [rightM (composite rightA rightSF)] (in (if (..exhaustive? rightM) @@ -337,17 +337,17 @@ {#Seq leftSF rightM}))) ... Same suffix - [#0 #1] + [.false .true] (do try.monad [leftM (composite leftA leftSF)] (in {#Seq leftM rightA})) ... The 2 sequences cannot possibly be merged. - [#0 #0] + [.false .false] <alternatively> ... There is nothing the addition adds to the coverage. - [#1 #1] + [.true .true] <redundancy>) ... The addition cannot possibly improve the coverage. diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/analysis/module.lux b/stdlib/source/library/lux/meta/compiler/language/lux/analysis/module.lux index dbaa9e8b0..8284b0301 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/analysis/module.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/analysis/module.lux @@ -110,7 +110,12 @@ (|> state (the .#modules) (property.value module) - (pipe.case {.#Some _} #1 {.#None} #0) + (pipe.case + {.#Some _} + true + + {.#None} + false) [state] {try.#Success})))) @@ -162,8 +167,11 @@ (case (|> state (the .#modules) (property.value module_name)) {.#Some module} (let [active? (case (the .#module_state module) - {.#Active} #1 - _ #0)] + {.#Active} + true + + _ + false)] (if active? {try.#Success [(revised .#modules (property.has module_name (has .#module_state {<tag>} module)) @@ -184,8 +192,11 @@ {.#Some module} {try.#Success [state (case (the .#module_state module) - {<tag>} #1 - _ #0)]} + {<tag>} + true + + _ + false)]} {.#None} ((///extension.up (/.except ..unknown_module module_name)) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/jvm.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/jvm.lux index 09010717a..e072e7d9d 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/jvm.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/jvm.lux @@ -395,7 +395,7 @@ (def lux_array_type (template (_ :read: :write:) - [{.#Primitive (static array.type_name) (list {.#Apply :write: {.#Apply :read: _Mutable}})}])) + [{.#Primitive array.type_name (list {.#Apply :write: {.#Apply :read: _Mutable}})}])) (def (jvm_type luxT) (-> .Type (Operation (Type Value))) @@ -1016,7 +1016,7 @@ (in false))))) (in (case [(type#= java/lang/Object fromT) (parser.array? toJT)] - [#1 {.#Some _}] + [.true {.#Some _}] true _ @@ -2502,7 +2502,7 @@ (do pool.monad [constant (`` (|> value (,, (template.spliced <constant>)))) attribute (attribute.constant constant)] - (field.field ..constant::modifier name #1 <type> (sequence.sequence attribute)))]) + (field.field ..constant::modifier name true <type> (sequence.sequence attribute)))]) ([.#Bit jvm.boolean [(pipe.case #0 +0 #1 +1) .i64 i32.i32 constant.integer pool.integer]] [.#Int jvm.byte [.i64 i32.i32 constant.integer pool.integer]] [.#Int jvm.short [.i64 i32.i32 constant.integer pool.integer]] @@ -2521,7 +2521,7 @@ ... TODO: Handle annotations. {#Variable [name visibility state annotations type]} (field.field (modifier#composite visibility state) - name #1 type sequence.empty))) + name true type sequence.empty))) (def method_privacy (-> ffi.Privacy (Modifier method.Method)) @@ -2591,7 +2591,7 @@ method.strict modifier.empty)) ..constructor_name - #0 (jvm.method [variables (list#each product.right arguments) jvm.void exceptions]) + false (jvm.method [variables (list#each product.right arguments) jvm.void exceptions]) (list) {.#Some (all _.composite (_.aload 0) @@ -2612,7 +2612,7 @@ method.strict modifier.empty)) name - #0 (jvm.method [variables (list#each product.right arguments) return exceptions]) + false (jvm.method [variables (list#each product.right arguments) return exceptions]) (list) {.#Some (..mock_return return)}) @@ -2628,7 +2628,7 @@ method.final modifier.empty)) name - #0 (jvm.method [variables (list#each product.right arguments) return exceptions]) + false (jvm.method [variables (list#each product.right arguments) return exceptions]) (list) {.#Some (..mock_return return)}) @@ -2642,7 +2642,7 @@ method.strict modifier.empty)) name - #0 (jvm.method [variables (list#each product.right arguments) return exceptions]) + false (jvm.method [variables (list#each product.right arguments) return exceptions]) (list) {.#Some (..mock_return return)}) @@ -2652,7 +2652,7 @@ method.abstract (..method_privacy privacy)) name - #0 (jvm.method [variables (list#each product.right arguments) return exceptions]) + false (jvm.method [variables (list#each product.right arguments) return exceptions]) (list) {.#None}) )) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/jvm.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/jvm.lux index 9585f0521..16dc3bc08 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/jvm.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/jvm.lux @@ -236,7 +236,7 @@ (do pool.monad [constant (`` (|> value (,, (template.spliced <constant>)))) attribute (attribute.constant constant)] - (field.field ..constant::modifier name #1 <type> (sequence.sequence attribute)))]) + (field.field ..constant::modifier name true <type> (sequence.sequence attribute)))]) ([.#Bit type.boolean [(pipe.case #0 +0 #1 +1) .i64 i32.i32 constant.integer pool.integer]] [.#Int type.byte [.i64 i32.i32 constant.integer pool.integer]] [.#Int type.short [.i64 i32.i32 constant.integer pool.integer]] @@ -260,7 +260,7 @@ modifier.empty) visibility state) - name #1 type sequence.empty))) + name true type sequence.empty))) (def annotation_parameter_synthesis (<synthesis>.Parser (jvm.Annotation_Parameter Synthesis)) @@ -482,7 +482,7 @@ method.strict modifier.empty)) ..constructor_name - #1 (type.method [method_tvars argumentsT type.void exceptions]) + true (type.method [method_tvars argumentsT type.void exceptions]) (list) {.#Some (all _.composite (_.aload 0) @@ -551,7 +551,7 @@ method.strict modifier.empty)) method_name - #1 (type.method [method_tvars argumentsT returnJ exceptionsJ]) + true (type.method [method_tvars argumentsT returnJ exceptionsJ]) (list) {.#Some (all _.composite (method_arguments 1 argumentsT) @@ -581,7 +581,7 @@ method.final modifier.empty)) method_name - #1 (type.method [method_tvars argumentsT returnJ exceptionsJ]) + true (type.method [method_tvars argumentsT returnJ exceptionsJ]) (list) {.#Some (all _.composite (method_arguments 1 argumentsT) @@ -606,7 +606,7 @@ method.strict modifier.empty)) method_name - #1 (type.method [method_tvars argumentsT returnJ exceptionsJ]) + true (type.method [method_tvars argumentsT returnJ exceptionsJ]) (list) {.#Some (all _.composite (method_arguments 0 argumentsT) @@ -621,7 +621,7 @@ (..method_privacy privacy) method.abstract) name - #1 (type.method [variables (list#each product.right arguments) return exceptions]) + true (type.method [variables (list#each product.right arguments) return exceptions]) (list) {.#None}))) @@ -764,7 +764,7 @@ method.strict modifier.empty)) ..constructor_name - #1 (type.method [variables (list#each product.right arguments) type.void exceptions]) + true (type.method [variables (list#each product.right arguments) type.void exceptions]) (list) {.#Some (all _.composite (_.aload 0) @@ -785,7 +785,7 @@ method.strict modifier.empty)) name - #1 (type.method [variables (list#each product.right arguments) return exceptions]) + true (type.method [variables (list#each product.right arguments) return exceptions]) (list) {.#Some (..mock_return return)}) @@ -801,7 +801,7 @@ method.final modifier.empty)) name - #1 (type.method [variables (list#each product.right arguments) return exceptions]) + true (type.method [variables (list#each product.right arguments) return exceptions]) (list) {.#Some (..mock_return return)}) @@ -815,7 +815,7 @@ method.strict modifier.empty)) name - #1 (type.method [variables (list#each product.right arguments) return exceptions]) + true (type.method [variables (list#each product.right arguments) return exceptions]) (list) {.#Some (..mock_return return)}) @@ -825,7 +825,7 @@ method.abstract (..method_privacy privacy)) name - #1 (type.method [variables (list#each product.right arguments) return exceptions]) + true (type.method [variables (list#each product.right arguments) return exceptions]) (list) {.#None}) )) @@ -933,7 +933,7 @@ method.public method.abstract) /#name - #1 type + true type (list) {.#None}))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/lux.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/lux.lux index b127af8c6..4b93daa97 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/lux.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/lux.lux @@ -434,11 +434,11 @@ [_ handlerV] (<definer> archive (as Text name) (let [raw_type (type_literal <def_type>)] (case target_platform - (^.or (static @.jvm) - (static @.js)) + (^.or @.jvm + @.js) raw_type - (static @.python) + @.python (swapped binary.Binary Binary|Python raw_type) _ diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/jvm/host.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/jvm/host.lux index 8f73277d6..ced11c93e 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/jvm/host.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/jvm/host.lux @@ -1136,7 +1136,7 @@ (_.aload (n.+ inputs_offset (++ register))) (_.putfield class (///reference.foreign_name register) $Object)))))] (method.method method.public "<init>" - #1 (anonymous_init_method env inputsTG) + true (anonymous_init_method env inputsTG) (list) {.#Some (all _.composite (_.aload 0) @@ -1320,7 +1320,7 @@ method.strict modifier#identity)) name - #1 methodT + true methodT (list) {.#Some (all _.composite (prepare_arguments 1 argumentsT) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/field/constant.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/field/constant.lux index 31fb77c7b..cd54bb0f8 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/field/constant.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/field/constant.lux @@ -24,4 +24,4 @@ (def .public (constant name type) (-> Text (Type Value) (Resource Field)) - (field.field ..modifier name #0 type (sequence.sequence))) + (field.field ..modifier name false type (sequence.sequence))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/field/variable.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/field/variable.lux index 539f43afe..17ef0b605 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/field/variable.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/field/variable.lux @@ -47,7 +47,7 @@ (def .public (variable name type) (-> Text (Type Value) (Resource Field)) - (field.field ..modifier name #0 type (sequence.sequence))) + (field.field ..modifier name false type (sequence.sequence))) (def .public (variables naming amount) (-> (-> Register Text) Nat (List (Resource Field))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/apply.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/apply.lux index 10de5d326..74a1dac76 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/apply.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/apply.lux @@ -85,7 +85,7 @@ over_extent (i.- (.int apply_arity) (.int function_arity))] (method.method //.modifier ////runtime.apply::name - #0 (////runtime.apply::type apply_arity) + false (////runtime.apply::type apply_arity) (list) {.#Some (case num_partials 0 (all _.composite diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/implementation.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/implementation.lux index 65f3ef2bb..420872a39 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/implementation.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/implementation.lux @@ -46,7 +46,7 @@ (-> (Type Class) Arity Label (Bytecode Any) (Resource Method)) (method.method ..modifier ..name - #0 (..type :it: arity) + false (..type :it: arity) (list) {.#Some (all _.composite (_.set_label @begin) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/init.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/init.lux index 2e551f44d..6a2b7432e 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/init.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/init.lux @@ -95,7 +95,7 @@ offset_partial (is (-> Register Register) (|>> offset_arity (n.+ 1)))] (method.method //.modifier ..name - #0 (..type environment arity) + false (..type environment arity) (list) {.#Some (all _.composite ////reference.this diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/new.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/new.lux index 26f259dce..13dd6b6ee 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/new.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/new.lux @@ -68,7 +68,7 @@ after_arity (is (-> Nat Nat) (|>> after_environment (n.+ 1)))] (method.method //.modifier //init.name - #0 (//init.type environment arity) + false (//init.type environment arity) (list) {.#Some (all _.composite ////reference.this diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/reset.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/reset.lux index bfbacf886..fcb94a4ee 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/reset.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/function/method/reset.lux @@ -42,7 +42,7 @@ (def .public (method class environment arity) (-> (Type Class) (Environment Synthesis) Arity (Resource Method)) (method.method //.modifier ..name - #0 (..type class) + false (..type class) (list) {.#Some (all _.composite (if (arity.multiary? arity) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/host.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/host.lux index c5ff3c185..270fb31ab 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/host.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/host.lux @@ -120,9 +120,9 @@ (encoding/name.internal bytecode_name) {.#None} (encoding/name.internal "java.lang.Object") (list) - (list (field.field ..value::modifier //value.field #0 :value: (sequence.sequence))) + (list (field.field ..value::modifier //value.field false :value: (sequence.sequence))) (list (method.method ..init::modifier "<clinit>" - #0 ..init::type + false ..init::type (list) {.#Some (all _.composite diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/program.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/program.lux index 730a83b19..097959d4c 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/program.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/program.lux @@ -145,7 +145,7 @@ (-> (-> unit.ID Text) (Program (Bytecode Any) Definition)) (let [super_class (|> ..^Object type.reflection reflection.reflection name.internal) main (method.method ..main::modifier "main" - #0 ..main::type + false ..main::type (list) {.#Some (all _.composite program diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/runtime.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/runtime.lux index a728d2b2e..385015373 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/runtime.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/runtime.lux @@ -154,7 +154,7 @@ $right? _.aload_1 $value _.aload_2] (method.method ..modifier ..variant::name - #0 ..variant::type + .false ..variant::type (list) {.#Some (all _.composite new_variant ... A[3] @@ -216,7 +216,7 @@ (def decode_frac::method (method.method ..modifier ..decode_frac::name - #0 ..decode_frac::type + .false ..decode_frac::type (list) {.#Some (..risky @@ -253,7 +253,7 @@ (def (failure name message) (-> Text Text (Resource Method)) (method.method ..modifier name - #0 ..failure::type + .false ..failure::type (list) {.#Some (all _.composite @@ -275,7 +275,7 @@ (def push::method (method.method ..modifier ..push::name - #0 ..push::type + .false ..push::type (list) {.#Some (let [new_stack_frame! (all _.composite @@ -295,7 +295,7 @@ (def case::method (method.method ..modifier ..case::name - #0 ..case::type + .false ..case::type (list) {.#Some (do _.monad @@ -407,7 +407,7 @@ left_projection::method (method.method ..modifier ..left_projection::name - #0 ..projection_type + .false ..projection_type (list) {.#Some (do _.monad @@ -427,7 +427,7 @@ right_projection::method (method.method ..modifier ..right_projection::name - #0 ..projection_type + .false ..projection_type (list) {.#Some (do _.monad @@ -483,7 +483,7 @@ (def try::method (method.method ..modifier ..try::name - #0 ..try::type + .false ..try::type (list) {.#Some (do _.monad @@ -578,7 +578,7 @@ //function/arity.maximum) (list#each (function (_ arity) (method.method method.public ..apply::name - #0 (..apply::type arity) + .false (..apply::type arity) (list) {.#Some (let [previous_inputs (|> arity @@ -593,11 +593,11 @@ _.areturn))}))) (list.partial (method.method (modifier#composite method.public method.abstract) ..apply::name - #0 (..apply::type //function/arity.minimum) + .false (..apply::type //function/arity.minimum) (list) {.#None}))) <init>::method (method.method method.public "<init>" - #0 //function.init + .false //function.init (list) {.#Some (let [$partials _.iload_1] @@ -616,7 +616,7 @@ partial_count (is (Resource Field) (field.field (modifier#composite field.public field.final) //function/count.field - #0 //function/count.type + .false //function/count.type sequence.empty)) bytecode (<| (\\format.result class.format) try.trusted diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/reference.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/reference.lux index bc1c562c2..ef720c4ae 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/reference.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/reference.lux @@ -35,7 +35,9 @@ @.scheme ... Cannot make all definitions be local variables because of limitations with Kawa. (not ("scheme script universe")) - #0)) + + ... Otherwise... + false)) (def universe_label Text diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis/case.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis/case.lux index e755791ab..d6d6f31ed 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis/case.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis/case.lux @@ -186,11 +186,11 @@ (if (n.= newL oldL) old <default>)]) - ([/access.#Side #0 /side.#lefts /side.#right?] - [/access.#Side #1 /side.#lefts /side.#right?] + ([/access.#Side .false /side.#lefts /side.#right?] + [/access.#Side .true /side.#lefts /side.#right?] - [/access.#Member #0 /member.#lefts /member.#right?] - [/access.#Member #1 /member.#lefts /member.#right?]) + [/access.#Member .false /member.#lefts /member.#right?] + [/access.#Member .true /member.#lefts /member.#right?]) [{/.#Bind newR} {/.#Bind oldR}] (if (n.= newR oldR) @@ -319,14 +319,14 @@ {.#End}] (..synthesize_let synthesize^ archive inputS @variable body) - (^.or [[(///pattern.bit #1) then] - (list [(///pattern.bit #0) else])] - [[(///pattern.bit #1) then] + (^.or [[(///pattern.bit .true) then] + (list [(///pattern.bit .false) else])] + [[(///pattern.bit .true) then] (list [(///pattern.unit) else])] - [[(///pattern.bit #0) else] - (list [(///pattern.bit #1) then])] - [[(///pattern.bit #0) else] + [[(///pattern.bit .false) else] + (list [(///pattern.bit .true) then])] + [[(///pattern.bit .false) else] (list [(///pattern.unit) then])]) (..synthesize_if synthesize^ archive inputS then else) |