diff options
author | Eduardo Julian | 2021-09-12 00:07:08 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-09-12 00:07:08 -0400 |
commit | dda05bca0956af5e5b3875c4cc36e61aa04772e4 (patch) | |
tree | 0f8b27697d58ab5c8e41aba7c7c9f769d3800767 /lux-jvm/source/luxc | |
parent | d48270f43c404ba19ca04da2553455ecaaf2caba (diff) |
Made the "#" character great again!
Diffstat (limited to '')
-rw-r--r-- | lux-jvm/source/luxc/lang/directive/jvm.lux | 542 | ||||
-rw-r--r-- | lux-jvm/source/luxc/lang/host/jvm.lux | 24 | ||||
-rw-r--r-- | lux-jvm/source/luxc/lang/host/jvm/def.lux | 48 | ||||
-rw-r--r-- | lux-jvm/source/luxc/lang/host/jvm/inst.lux | 12 | ||||
-rw-r--r-- | lux-jvm/source/luxc/lang/synthesis/variable.lux | 33 | ||||
-rw-r--r-- | lux-jvm/source/luxc/lang/translation/jvm.lux | 24 | ||||
-rw-r--r-- | lux-jvm/source/luxc/lang/translation/jvm/case.lux | 28 | ||||
-rw-r--r-- | lux-jvm/source/luxc/lang/translation/jvm/common.lux | 22 | ||||
-rw-r--r-- | lux-jvm/source/luxc/lang/translation/jvm/expression.lux | 2 | ||||
-rw-r--r-- | lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux | 4 | ||||
-rw-r--r-- | lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux | 104 | ||||
-rw-r--r-- | lux-jvm/source/luxc/lang/translation/jvm/function.lux | 12 | ||||
-rw-r--r-- | lux-jvm/source/luxc/lang/translation/jvm/program.lux | 6 | ||||
-rw-r--r-- | lux-jvm/source/luxc/lang/translation/jvm/reference.lux | 4 | ||||
-rw-r--r-- | lux-jvm/source/luxc/lang/translation/jvm/runtime.lux | 8 |
15 files changed, 437 insertions, 436 deletions
diff --git a/lux-jvm/source/luxc/lang/directive/jvm.lux b/lux-jvm/source/luxc/lang/directive/jvm.lux index b81a10c69..36a498cda 100644 --- a/lux-jvm/source/luxc/lang/directive/jvm.lux +++ b/lux-jvm/source/luxc/lang/directive/jvm.lux @@ -72,181 +72,181 @@ (def: (literal literal) (-> /.Literal Inst) (case literal - {#/.Boolean value} (_.boolean value) - {#/.Int value} (_.int value) - {#/.Long value} (_.long value) - {#/.Double value} (_.double value) - {#/.Char value} (_.char value) - {#/.String value} (_.string value))) + {/.#Boolean value} (_.boolean value) + {/.#Int value} (_.int value) + {/.#Long value} (_.long value) + {/.#Double value} (_.double value) + {/.#Char value} (_.char value) + {/.#String value} (_.string value))) (def: (constant instruction) (-> /.Constant Inst) (case instruction - {#/.BIPUSH constant} (_.BIPUSH constant) + {/.#BIPUSH constant} (_.BIPUSH constant) - {#/.SIPUSH constant} (_.SIPUSH constant) - - #/.ICONST_M1 _.ICONST_M1 - #/.ICONST_0 _.ICONST_0 - #/.ICONST_1 _.ICONST_1 - #/.ICONST_2 _.ICONST_2 - #/.ICONST_3 _.ICONST_3 - #/.ICONST_4 _.ICONST_4 - #/.ICONST_5 _.ICONST_5 - - #/.LCONST_0 _.LCONST_0 - #/.LCONST_1 _.LCONST_1 + {/.#SIPUSH constant} (_.SIPUSH constant) + + {/.#ICONST_M1} _.ICONST_M1 + {/.#ICONST_0} _.ICONST_0 + {/.#ICONST_1} _.ICONST_1 + {/.#ICONST_2} _.ICONST_2 + {/.#ICONST_3} _.ICONST_3 + {/.#ICONST_4} _.ICONST_4 + {/.#ICONST_5} _.ICONST_5 + + {/.#LCONST_0} _.LCONST_0 + {/.#LCONST_1} _.LCONST_1 - #/.FCONST_0 _.FCONST_0 - #/.FCONST_1 _.FCONST_1 - #/.FCONST_2 _.FCONST_2 + {/.#FCONST_0} _.FCONST_0 + {/.#FCONST_1} _.FCONST_1 + {/.#FCONST_2} _.FCONST_2 - #/.DCONST_0 _.DCONST_0 - #/.DCONST_1 _.DCONST_1 + {/.#DCONST_0} _.DCONST_0 + {/.#DCONST_1} _.DCONST_1 - #/.ACONST_NULL _.NULL + {/.#ACONST_NULL} _.NULL - {#/.LDC literal} + {/.#LDC literal} (..literal literal) )) (def: (int_arithmetic instruction) (-> /.Int_Arithmetic Inst) (case instruction - #/.IADD _.IADD - #/.ISUB _.ISUB - #/.IMUL _.IMUL - #/.IDIV _.IDIV - #/.IREM _.IREM - #/.INEG _.INEG)) + {/.#IADD} _.IADD + {/.#ISUB} _.ISUB + {/.#IMUL} _.IMUL + {/.#IDIV} _.IDIV + {/.#IREM} _.IREM + {/.#INEG} _.INEG)) (def: (long_arithmetic instruction) (-> /.Long_Arithmetic Inst) (case instruction - #/.LADD _.LADD - #/.LSUB _.LSUB - #/.LMUL _.LMUL - #/.LDIV _.LDIV - #/.LREM _.LREM - #/.LNEG _.LNEG)) + {/.#LADD} _.LADD + {/.#LSUB} _.LSUB + {/.#LMUL} _.LMUL + {/.#LDIV} _.LDIV + {/.#LREM} _.LREM + {/.#LNEG} _.LNEG)) (def: (float_arithmetic instruction) (-> /.Float_Arithmetic Inst) (case instruction - #/.FADD _.FADD - #/.FSUB _.FSUB - #/.FMUL _.FMUL - #/.FDIV _.FDIV - #/.FREM _.FREM - #/.FNEG _.FNEG)) + {/.#FADD} _.FADD + {/.#FSUB} _.FSUB + {/.#FMUL} _.FMUL + {/.#FDIV} _.FDIV + {/.#FREM} _.FREM + {/.#FNEG} _.FNEG)) (def: (double_arithmetic instruction) (-> /.Double_Arithmetic Inst) (case instruction - #/.DADD _.DADD - #/.DSUB _.DSUB - #/.DMUL _.DMUL - #/.DDIV _.DDIV - #/.DREM _.DREM - #/.DNEG _.DNEG)) + {/.#DADD} _.DADD + {/.#DSUB} _.DSUB + {/.#DMUL} _.DMUL + {/.#DDIV} _.DDIV + {/.#DREM} _.DREM + {/.#DNEG} _.DNEG)) (def: (arithmetic instruction) (-> /.Arithmetic Inst) (case instruction - {#/.Int_Arithmetic int_arithmetic} + {/.#Int_Arithmetic int_arithmetic} (..int_arithmetic int_arithmetic) - {#/.Long_Arithmetic long_arithmetic} + {/.#Long_Arithmetic long_arithmetic} (..long_arithmetic long_arithmetic) - {#/.Float_Arithmetic float_arithmetic} + {/.#Float_Arithmetic float_arithmetic} (..float_arithmetic float_arithmetic) - {#/.Double_Arithmetic double_arithmetic} + {/.#Double_Arithmetic double_arithmetic} (..double_arithmetic double_arithmetic))) (def: (int_bitwise instruction) (-> /.Int_Bitwise Inst) (case instruction - #/.IOR _.IOR - #/.IXOR _.IXOR - #/.IAND _.IAND - #/.ISHL _.ISHL - #/.ISHR _.ISHR - #/.IUSHR _.IUSHR)) + {/.#IOR} _.IOR + {/.#IXOR} _.IXOR + {/.#IAND} _.IAND + {/.#ISHL} _.ISHL + {/.#ISHR} _.ISHR + {/.#IUSHR} _.IUSHR)) (def: (long_bitwise instruction) (-> /.Long_Bitwise Inst) (case instruction - #/.LOR _.LOR - #/.LXOR _.LXOR - #/.LAND _.LAND - #/.LSHL _.LSHL - #/.LSHR _.LSHR - #/.LUSHR _.LUSHR)) + {/.#LOR} _.LOR + {/.#LXOR} _.LXOR + {/.#LAND} _.LAND + {/.#LSHL} _.LSHL + {/.#LSHR} _.LSHR + {/.#LUSHR} _.LUSHR)) (def: (bitwise instruction) (-> /.Bitwise Inst) (case instruction - {#/.Int_Bitwise int_bitwise} + {/.#Int_Bitwise int_bitwise} (..int_bitwise int_bitwise) - {#/.Long_Bitwise long_bitwise} + {/.#Long_Bitwise long_bitwise} (..long_bitwise long_bitwise))) (def: (conversion instruction) (-> /.Conversion Inst) (case instruction - #/.I2B _.I2B - #/.I2S _.I2S - #/.I2L _.I2L - #/.I2F _.I2F - #/.I2D _.I2D - #/.I2C _.I2C - - #/.L2I _.L2I - #/.L2F _.L2F - #/.L2D _.L2D - - #/.F2I _.F2I - #/.F2L _.F2L - #/.F2D _.F2D + {/.#I2B} _.I2B + {/.#I2S} _.I2S + {/.#I2L} _.I2L + {/.#I2F} _.I2F + {/.#I2D} _.I2D + {/.#I2C} _.I2C + + {/.#L2I} _.L2I + {/.#L2F} _.L2F + {/.#L2D} _.L2D + + {/.#F2I} _.F2I + {/.#F2L} _.F2L + {/.#F2D} _.F2D - #/.D2I _.D2I - #/.D2L _.D2L - #/.D2F _.D2F)) + {/.#D2I} _.D2I + {/.#D2L} _.D2L + {/.#D2F} _.D2F)) (def: (array instruction) (-> /.Array Inst) (case instruction - #/.ARRAYLENGTH _.ARRAYLENGTH + {/.#ARRAYLENGTH} _.ARRAYLENGTH - {#/.NEWARRAY type} (_.NEWARRAY type) - {#/.ANEWARRAY type} (_.ANEWARRAY type) + {/.#NEWARRAY type} (_.NEWARRAY type) + {/.#ANEWARRAY type} (_.ANEWARRAY type) - #/.BALOAD _.BALOAD - #/.BASTORE _.BASTORE + {/.#BALOAD} _.BALOAD + {/.#BASTORE} _.BASTORE - #/.SALOAD _.SALOAD - #/.SASTORE _.SASTORE + {/.#SALOAD} _.SALOAD + {/.#SASTORE} _.SASTORE - #/.IALOAD _.IALOAD - #/.IASTORE _.IASTORE + {/.#IALOAD} _.IALOAD + {/.#IASTORE} _.IASTORE - #/.LALOAD _.LALOAD - #/.LASTORE _.LASTORE + {/.#LALOAD} _.LALOAD + {/.#LASTORE} _.LASTORE - #/.FALOAD _.FALOAD - #/.FASTORE _.FASTORE + {/.#FALOAD} _.FALOAD + {/.#FASTORE} _.FASTORE - #/.DALOAD _.DALOAD - #/.DASTORE _.DASTORE + {/.#DALOAD} _.DALOAD + {/.#DASTORE} _.DASTORE - #/.CALOAD _.CALOAD - #/.CASTORE _.CASTORE + {/.#CALOAD} _.CALOAD + {/.#CASTORE} _.CASTORE - #/.AALOAD _.AALOAD - #/.AASTORE _.AASTORE)) + {/.#AALOAD} _.AALOAD + {/.#AASTORE} _.AASTORE)) (def: (object instruction) (-> /.Object Inst) @@ -254,162 +254,162 @@ (^template [<tag> <inst>] [{<tag> class field_name field_type} (<inst> class field_name field_type)]) - ([#/.GETSTATIC _.GETSTATIC] - [#/.PUTSTATIC _.PUTSTATIC] - [#/.GETFIELD _.GETFIELD] - [#/.PUTFIELD _.PUTFIELD]) + ([/.#GETSTATIC _.GETSTATIC] + [/.#PUTSTATIC _.PUTSTATIC] + [/.#GETFIELD _.GETFIELD] + [/.#PUTFIELD _.PUTFIELD]) - {#/.NEW type} (_.NEW type) + {/.#NEW type} (_.NEW type) - {#/.INSTANCEOF type} (_.INSTANCEOF type) - {#/.CHECKCAST type} (_.CHECKCAST type) + {/.#INSTANCEOF type} (_.INSTANCEOF type) + {/.#CHECKCAST type} (_.CHECKCAST type) (^template [<tag> <inst>] [{<tag> class method_name method_type} (<inst> class method_name method_type)]) - ([#/.INVOKEINTERFACE _.INVOKEINTERFACE] - [#/.INVOKESPECIAL _.INVOKESPECIAL] - [#/.INVOKESTATIC _.INVOKESTATIC] - [#/.INVOKEVIRTUAL _.INVOKEVIRTUAL]) + ([/.#INVOKEINTERFACE _.INVOKEINTERFACE] + [/.#INVOKESPECIAL _.INVOKESPECIAL] + [/.#INVOKESTATIC _.INVOKESTATIC] + [/.#INVOKEVIRTUAL _.INVOKEVIRTUAL]) )) (def: (local_int instruction) (-> /.Local_Int Inst) (case instruction - {#/.ILOAD register} (_.ILOAD register) - {#/.ISTORE register} (_.ISTORE register))) + {/.#ILOAD register} (_.ILOAD register) + {/.#ISTORE register} (_.ISTORE register))) (def: (local_long instruction) (-> /.Local_Long Inst) (case instruction - {#/.LLOAD register} (_.LLOAD register) - {#/.LSTORE register} (_.LSTORE register))) + {/.#LLOAD register} (_.LLOAD register) + {/.#LSTORE register} (_.LSTORE register))) (def: (local_float instruction) (-> /.Local_Float Inst) (case instruction - {#/.FLOAD register} (_.FLOAD register) - {#/.FSTORE register} (_.FSTORE register))) + {/.#FLOAD register} (_.FLOAD register) + {/.#FSTORE register} (_.FSTORE register))) (def: (local_double instruction) (-> /.Local_Double Inst) (case instruction - {#/.DLOAD register} (_.DLOAD register) - {#/.DSTORE register} (_.DSTORE register))) + {/.#DLOAD register} (_.DLOAD register) + {/.#DSTORE register} (_.DSTORE register))) (def: (local_object instruction) (-> /.Local_Object Inst) (case instruction - {#/.ALOAD register} (_.ALOAD register) - {#/.ASTORE register} (_.ASTORE register))) + {/.#ALOAD register} (_.ALOAD register) + {/.#ASTORE register} (_.ASTORE register))) (def: (local instruction) (-> /.Local Inst) (case instruction - {#/.Local_Int instruction} (..local_int instruction) - {#/.IINC register} (_.IINC register) - {#/.Local_Long instruction} (..local_long instruction) - {#/.Local_Float instruction} (..local_float instruction) - {#/.Local_Double instruction} (..local_double instruction) - {#/.Local_Object instruction} (..local_object instruction))) + {/.#Local_Int instruction} (..local_int instruction) + {/.#IINC register} (_.IINC register) + {/.#Local_Long instruction} (..local_long instruction) + {/.#Local_Float instruction} (..local_float instruction) + {/.#Local_Double instruction} (..local_double instruction) + {/.#Local_Object instruction} (..local_object instruction))) (def: (stack instruction) (-> /.Stack Inst) (case instruction - #/.DUP _.DUP - #/.DUP_X1 _.DUP_X1 - #/.DUP_X2 _.DUP_X2 - #/.DUP2 _.DUP2 - #/.DUP2_X1 _.DUP2_X1 - #/.DUP2_X2 _.DUP2_X2 - #/.SWAP _.SWAP - #/.POP _.POP - #/.POP2 _.POP2)) + {/.#DUP} _.DUP + {/.#DUP_X1} _.DUP_X1 + {/.#DUP_X2} _.DUP_X2 + {/.#DUP2} _.DUP2 + {/.#DUP2_X1} _.DUP2_X1 + {/.#DUP2_X2} _.DUP2_X2 + {/.#SWAP} _.SWAP + {/.#POP} _.POP + {/.#POP2} _.POP2)) (def: (comparison instruction) (-> /.Comparison Inst) (case instruction - #/.LCMP _.LCMP + {/.#LCMP} _.LCMP - #/.FCMPG _.FCMPG - #/.FCMPL _.FCMPL + {/.#FCMPG} _.FCMPG + {/.#FCMPL} _.FCMPL - #/.DCMPG _.DCMPG - #/.DCMPL _.DCMPL)) + {/.#DCMPG} _.DCMPG + {/.#DCMPL} _.DCMPL)) (def: (branching instruction) (-> (/.Branching org/objectweb/asm/Label) Inst) (case instruction - {#/.IF_ICMPEQ label} (_.IF_ICMPEQ label) - {#/.IF_ICMPGE label} (_.IF_ICMPGE label) - {#/.IF_ICMPGT label} (_.IF_ICMPGT label) - {#/.IF_ICMPLE label} (_.IF_ICMPLE label) - {#/.IF_ICMPLT label} (_.IF_ICMPLT label) - {#/.IF_ICMPNE label} (_.IF_ICMPNE label) - {#/.IFEQ label} (_.IFEQ label) - {#/.IFGE label} (_.IFGE label) - {#/.IFGT label} (_.IFGT label) - {#/.IFLE label} (_.IFLE label) - {#/.IFLT label} (_.IFLT label) - {#/.IFNE label} (_.IFNE label) - - {#/.TABLESWITCH min max default labels} + {/.#IF_ICMPEQ label} (_.IF_ICMPEQ label) + {/.#IF_ICMPGE label} (_.IF_ICMPGE label) + {/.#IF_ICMPGT label} (_.IF_ICMPGT label) + {/.#IF_ICMPLE label} (_.IF_ICMPLE label) + {/.#IF_ICMPLT label} (_.IF_ICMPLT label) + {/.#IF_ICMPNE label} (_.IF_ICMPNE label) + {/.#IFEQ label} (_.IFEQ label) + {/.#IFGE label} (_.IFGE label) + {/.#IFGT label} (_.IFGT label) + {/.#IFLE label} (_.IFLE label) + {/.#IFLT label} (_.IFLT label) + {/.#IFNE label} (_.IFNE label) + + {/.#TABLESWITCH min max default labels} (_.TABLESWITCH min max default labels) - {#/.LOOKUPSWITCH default keys+labels} + {/.#LOOKUPSWITCH default keys+labels} (_.LOOKUPSWITCH default keys+labels) - {#/.IF_ACMPEQ label} (_.IF_ACMPEQ label) - {#/.IF_ACMPNE label} (_.IF_ACMPNE label) - {#/.IFNONNULL label} (_.IFNONNULL label) - {#/.IFNULL label} (_.IFNULL label))) + {/.#IF_ACMPEQ label} (_.IF_ACMPEQ label) + {/.#IF_ACMPNE label} (_.IF_ACMPNE label) + {/.#IFNONNULL label} (_.IFNONNULL label) + {/.#IFNULL label} (_.IFNULL label))) (def: (exception instruction) (-> (/.Exception org/objectweb/asm/Label) Inst) (case instruction - {#/.Try start end handler exception} (_.try start end handler exception) - #/.ATHROW _.ATHROW)) + {/.#Try start end handler exception} (_.try start end handler exception) + {/.#ATHROW} _.ATHROW)) (def: (concurrency instruction) (-> /.Concurrency Inst) (case instruction - #/.MONITORENTER _.MONITORENTER - #/.MONITOREXIT _.MONITOREXIT)) + {/.#MONITORENTER} _.MONITORENTER + {/.#MONITOREXIT} _.MONITOREXIT)) (def: (return instruction) (-> /.Return Inst) (case instruction - #/.RETURN _.RETURN - #/.IRETURN _.IRETURN - #/.LRETURN _.LRETURN - #/.FRETURN _.FRETURN - #/.DRETURN _.DRETURN - #/.ARETURN _.ARETURN)) + {/.#RETURN} _.RETURN + {/.#IRETURN} _.IRETURN + {/.#LRETURN} _.LRETURN + {/.#FRETURN} _.FRETURN + {/.#DRETURN} _.DRETURN + {/.#ARETURN} _.ARETURN)) (def: (control instruction) (-> (/.Control org/objectweb/asm/Label) Inst) (case instruction - {#/.GOTO label} (_.GOTO label) - {#/.Branching instruction} (..branching instruction) - {#/.Exception instruction} (..exception instruction) - {#/.Concurrency instruction} (..concurrency instruction) - {#/.Return instruction} (..return instruction))) + {/.#GOTO label} (_.GOTO label) + {/.#Branching instruction} (..branching instruction) + {/.#Exception instruction} (..exception instruction) + {/.#Concurrency instruction} (..concurrency instruction) + {/.#Return instruction} (..return instruction))) (def: (instruction instruction) (-> (/.Instruction Inst org/objectweb/asm/Label) Inst) (case instruction - #/.NOP _.NOP - {#/.Constant instruction} (..constant instruction) - {#/.Arithmetic instruction} (..arithmetic instruction) - {#/.Bitwise instruction} (..bitwise instruction) - {#/.Conversion instruction} (..conversion instruction) - {#/.Array instruction} (..array instruction) - {#/.Object instruction} (..object instruction) - {#/.Local instruction} (..local instruction) - {#/.Stack instruction} (..stack instruction) - {#/.Comparison instruction} (..comparison instruction) - {#/.Control instruction} (..control instruction) - {#/.Embedded embedded} embedded)) + {/.#NOP} _.NOP + {/.#Constant instruction} (..constant instruction) + {/.#Arithmetic instruction} (..arithmetic instruction) + {/.#Bitwise instruction} (..bitwise instruction) + {/.#Conversion instruction} (..conversion instruction) + {/.#Array instruction} (..array instruction) + {/.#Object instruction} (..object instruction) + {/.#Local instruction} (..local instruction) + {/.#Stack instruction} (..stack instruction) + {/.#Comparison instruction} (..comparison instruction) + {/.#Control instruction} (..control instruction) + {/.#Embedded embedded} embedded)) (type: Mapping (Dictionary /.Label org/objectweb/asm/Label)) @@ -421,10 +421,10 @@ (def: (relabel [mapping label]) (Re_labeler Identity) (case (dictionary.value label mapping) - {#.Some label} + {.#Some label} [mapping label] - #.None + {.#None} (let [label' (org/objectweb/asm/Label::new)] [(dictionary.has label label' mapping) label']))) @@ -435,39 +435,39 @@ [{<tag> label} (let [[mapping label] (..relabel [mapping label])] [mapping {<tag> label}])]) - ([#/.IF_ICMPEQ] [#/.IF_ICMPGE] [#/.IF_ICMPGT] [#/.IF_ICMPLE] [#/.IF_ICMPLT] [#/.IF_ICMPNE] - [#/.IFEQ] [#/.IFNE] [#/.IFGE] [#/.IFGT] [#/.IFLE] [#/.IFLT] + ([/.#IF_ICMPEQ] [/.#IF_ICMPGE] [/.#IF_ICMPGT] [/.#IF_ICMPLE] [/.#IF_ICMPLT] [/.#IF_ICMPNE] + [/.#IFEQ] [/.#IFNE] [/.#IFGE] [/.#IFGT] [/.#IFLE] [/.#IFLT] - [#/.IF_ACMPEQ] [#/.IF_ACMPNE] [#/.IFNONNULL] [#/.IFNULL]) + [/.#IF_ACMPEQ] [/.#IF_ACMPNE] [/.#IFNONNULL] [/.#IFNULL]) - {#/.TABLESWITCH min max default labels} + {/.#TABLESWITCH min max default labels} (let [[mapping default] (..relabel [mapping default]) [mapping labels] (list\mix (function (_ input [mapping output]) (let [[mapping input] (..relabel [mapping input])] [mapping (list& input output)])) [mapping (list)] labels)] - [mapping {#/.TABLESWITCH min max default (list.reversed labels)}]) + [mapping {/.#TABLESWITCH min max default (list.reversed labels)}]) - {#/.LOOKUPSWITCH default keys+labels} + {/.#LOOKUPSWITCH default keys+labels} (let [[mapping default] (..relabel [mapping default]) [mapping keys+labels] (list\mix (function (_ [expected input] [mapping output]) (let [[mapping input] (..relabel [mapping input])] [mapping (list& [expected input] output)])) [mapping (list)] keys+labels)] - [mapping {#/.LOOKUPSWITCH default (list.reversed keys+labels)}]) + [mapping {/.#LOOKUPSWITCH default (list.reversed keys+labels)}]) )) (def: (relabel_exception [mapping instruction]) (Re_labeler /.Exception) (case instruction - {#/.Try start end handler exception} + {/.#Try start end handler exception} (let [[mapping start] (..relabel [mapping start]) [mapping end] (..relabel [mapping end]) [mapping handler] (..relabel [mapping handler])] - [mapping {#/.Try start end handler exception}]) + [mapping {/.#Try start end handler exception}]) - #/.ATHROW - [mapping #/.ATHROW] + {/.#ATHROW} + [mapping {/.#ATHROW}] )) (def: (relabel_control [mapping instruction]) @@ -477,41 +477,41 @@ [{<tag> instruction} (let [[mapping instruction] (<relabel> [mapping instruction])] [mapping {<tag> instruction}])]) - ([#/.GOTO ..relabel] - [#/.Branching ..relabel_branching] - [#/.Exception ..relabel_exception]) + ([/.#GOTO ..relabel] + [/.#Branching ..relabel_branching] + [/.#Exception ..relabel_exception]) (^template [<tag>] [{<tag> instruction} [mapping {<tag> instruction}]]) - ([#/.Concurrency] [#/.Return]) + ([/.#Concurrency] [/.#Return]) )) (def: (relabel_instruction [mapping instruction]) (Re_labeler (/.Instruction Inst)) (case instruction - {#/.Embedded embedded} - [mapping {#/.Embedded embedded}] + {/.#Embedded embedded} + [mapping {/.#Embedded embedded}] - #/.NOP - [mapping #/.NOP] + {/.#NOP} + [mapping {/.#NOP}] (^template [<tag>] [{<tag> instruction} [mapping {<tag> instruction}]]) - ([#/.Constant] - [#/.Arithmetic] - [#/.Bitwise] - [#/.Conversion] - [#/.Array] - [#/.Object] - [#/.Local] - [#/.Stack] - [#/.Comparison]) + ([/.#Constant] + [/.#Arithmetic] + [/.#Bitwise] + [/.#Conversion] + [/.#Array] + [/.#Object] + [/.#Local] + [/.#Stack] + [/.#Comparison]) - {#/.Control instruction} + {/.#Control instruction} (let [[mapping instruction] (..relabel_control [mapping instruction])] - [mapping {#/.Control instruction}]))) + [mapping {/.#Control instruction}]))) (def: (relabel_bytecode [mapping bytecode]) (Re_labeler (/.Bytecode Inst)) @@ -587,10 +587,10 @@ ..Handler)) (function (_ extension_name phase archive input) (case (<code>.result parser input) - {#try.Success input'} + {try.#Success input'} (handler extension_name phase archive input') - {#try.Failure error} + {try.#Failure error} (phase.except extension.invalid_syntax [extension_name %.code input])))) (type: Declaration @@ -819,22 +819,22 @@ (def: (constraint tv) (-> (Type Var) Constraint) - [#/type.name (parser.name tv) - #/type.super_class java/lang/Object - #/type.super_interfaces (list)]) + [/type.#name (parser.name tv) + /type.#super_class java/lang/Object + /type.#super_interfaces (list)]) (def: visibility (-> ffi.Privacy jvm.Visibility) - (|>> (case> #ffi.PublicP #jvm.Public - #ffi.PrivateP #jvm.Private - #ffi.ProtectedP #jvm.Protected - #ffi.DefaultP #jvm.Default))) + (|>> (case> {ffi.#PublicP} {jvm.#Public} + {ffi.#PrivateP} {jvm.#Private} + {ffi.#ProtectedP} {jvm.#Protected} + {ffi.#DefaultP} {jvm.#Default}))) (def: field_config (-> ffi.State jvm.Field_Config) - (|>> (case> #ffi.VolatileS jvm.volatileF - #ffi.FinalS jvm.finalF - #ffi.DefaultS jvm.noneF))) + (|>> (case> {ffi.#VolatileS} jvm.volatileF + {ffi.#FinalS} jvm.finalF + {ffi.#DefaultS} jvm.noneF))) (def: (field_header [name privacy state annotations type]) (-> Field jvm.Def) @@ -843,10 +843,10 @@ (def: (header_value valueT) (-> (Type Value) Inst) (case (/type.primitive? valueT) - {#.Left classT} + {.#Left classT} _.NULL - {#.Right primitiveT} + {.#Right primitiveT} (cond (or (\ /type.equivalence = /type.boolean primitiveT) (\ /type.equivalence = /type.byte primitiveT) (\ /type.equivalence = /type.short primitiveT) @@ -866,16 +866,16 @@ (def: (header_return returnT) (-> (Type Return) Inst) (case (/type.void? returnT) - {#.Right returnT} + {.#Right returnT} _.RETURN - {#.Left valueT} + {.#Left valueT} (case (/type.primitive? valueT) - {#.Left classT} + {.#Left classT} (|>> (header_value classT) _.ARETURN) - {#.Right primitiveT} + {.#Right primitiveT} (cond (or (\ /type.equivalence = /type.boolean primitiveT) (\ /type.equivalence = /type.byte primitiveT) (\ /type.equivalence = /type.short primitiveT) @@ -936,7 +936,7 @@ {#Override [[parent_name parent_variables] name strict_floating_point? annotations variables self arguments return exceptions body]} - (def.method #jvm.Public + (def.method {jvm.#Public} (if strict_floating_point? jvm.strictM jvm.noneM) @@ -995,16 +995,16 @@ method_definitions))] [class_name (case inheritance - #ffi.DefaultI - (def.class #jvm.V1_6 #jvm.Public jvm.noneC class_name constraints super_class super_interfaces + {ffi.#DefaultI} + (def.class {jvm.#V1_6} {jvm.#Public} jvm.noneC class_name constraints super_class super_interfaces definitions) - #ffi.FinalI - (def.class #jvm.V1_6 #jvm.Public jvm.finalC class_name constraints super_class super_interfaces + {ffi.#FinalI} + (def.class {jvm.#V1_6} {jvm.#Public} jvm.finalC class_name constraints super_class super_interfaces definitions) - #ffi.AbstractI - (def.abstract #jvm.V1_6 #jvm.Public jvm.noneC class_name constraints super_class super_interfaces + {ffi.#AbstractI} + (def.abstract {jvm.#V1_6} {jvm.#Public} jvm.noneC class_name constraints super_class super_interfaces definitions))])) (def: (constructor_method_analysis archive [class_name class_tvars] method) @@ -1033,7 +1033,7 @@ arguments) returnT (//A.boxed_reflection_return mapping /type.void) [_scope bodyA] (|> arguments' - {#.Item [self selfT]} + {.#Item [self selfT]} list.reversed (list\mix scopeA.with_local (analyse archive bodyC)) (typeA.with_type returnT) @@ -1063,7 +1063,7 @@ arguments) returnT (//A.boxed_reflection_return mapping returnJ) [_scope bodyA] (|> arguments' - {#.Item [self selfT]} + {.#Item [self selfT]} list.reversed (list\mix scopeA.with_local (analyse archive bodyC)) (typeA.with_type returnT) @@ -1091,7 +1091,7 @@ arguments) returnT (//A.boxed_reflection_return mapping returnJ) [_scope bodyA] (|> arguments' - {#.Item [self selfT]} + {.#Item [self selfT]} list.reversed (list\mix scopeA.with_local (analyse archive bodyC)) (typeA.with_type returnT) @@ -1129,19 +1129,19 @@ (-> Archive Declaration (List (Type Class)) (Method Code) (Operation (Method Analysis))) (case method {#Constructor method} - (\ phase.monad each (|>> #Constructor) + (\ phase.monad each (|>> {#Constructor}) (constructor_method_analysis archive declaration method)) {#Override method} - (\ phase.monad each (|>> #Override) + (\ phase.monad each (|>> {#Override}) (override_method_analysis archive declaration supers method)) {#Virtual method} - (\ phase.monad each (|>> #Virtual) + (\ phase.monad each (|>> {#Virtual}) (virtual_method_analysis archive declaration method)) {#Static method} - (\ phase.monad each (|>> #Static) + (\ phase.monad each (|>> {#Static}) (static_method_analysis archive method)) {#Abstract method} @@ -1168,7 +1168,7 @@ (\ ! each (|>> [typeJ]) (synthesise archive termA))) constructor_argumentsA) - bodyS (synthesise archive {#analysis.Function (list) (//A.hide_method_body (list.size arguments) bodyA)})] + bodyS (synthesise archive {analysis.#Function (list) (//A.hide_method_body (list.size arguments) bodyA)})] (in [privacy strict_floating_point? annotations method_tvars exceptions self arguments constructor_argumentsS (case bodyS @@ -1187,7 +1187,7 @@ synthesise directive.synthesis] (directive.lifted_synthesis (do ! - [bodyS (synthesise archive {#analysis.Function (list) (//A.hide_method_body (list.size arguments) bodyA)})] + [bodyS (synthesise archive {analysis.#Function (list) (//A.hide_method_body (list.size arguments) bodyA)})] (in [[super_name super_tvars] method_name strict_floating_point? annotations method_tvars self arguments returnJ exceptionsJ (case bodyS @@ -1206,7 +1206,7 @@ synthesise directive.synthesis] (directive.lifted_synthesis (do ! - [bodyS (synthesise archive {#analysis.Function (list) (//A.hide_method_body (list.size arguments) bodyA)})] + [bodyS (synthesise archive {analysis.#Function (list) (//A.hide_method_body (list.size arguments) bodyA)})] (in [name privacy final? strict_floating_point? annotations method_tvars self arguments returnJ exceptionsJ (case bodyS @@ -1225,7 +1225,7 @@ synthesise directive.synthesis] (directive.lifted_synthesis (do ! - [bodyS (synthesise archive {#analysis.Function (list) (//A.hide_method_body (list.size arguments) bodyA)})] + [bodyS (synthesise archive {analysis.#Function (list) (//A.hide_method_body (list.size arguments) bodyA)})] (in [name privacy strict_floating_point? annotations method_tvars arguments returnJ exceptionsJ (case bodyS @@ -1239,19 +1239,19 @@ (-> Archive (Method Analysis) (Operation (Method Synthesis))) (case method {#Constructor method} - (\ phase.monad each (|>> #Constructor) + (\ phase.monad each (|>> {#Constructor}) (constructor_method_synthesis archive method)) {#Override method} - (\ phase.monad each (|>> #Override) + (\ phase.monad each (|>> {#Override}) (override_method_synthesis archive method)) {#Virtual method} - (\ phase.monad each (|>> #Virtual) + (\ phase.monad each (|>> {#Virtual}) (virtual_method_synthesis archive method)) {#Static method} - (\ phase.monad each (|>> #Static) + (\ phase.monad each (|>> {#Static}) (static_method_synthesis archive method)) {#Abstract method} @@ -1303,7 +1303,7 @@ (do ! [bodyG (generate archive (//G.hidden_method_body (list.size arguments) bodyS)) .let [argumentsT (list\each product.right arguments)]] - (in (def.method #jvm.Public + (in (def.method {jvm.#Public} (if strict_floating_point? jvm.strictM jvm.noneM) @@ -1387,13 +1387,13 @@ {#Override [[parent_name parent_variables] method_name strict_floating_point? annotations variables self arguments return exceptions body]} - {#.Some [(/type.class parent_name parent_variables) method_name + {.#Some [(/type.class parent_name parent_variables) method_name strict_floating_point? (list) variables self arguments return exceptions body]} _ - #.None)) + {.#None})) (def: (jvm::class class_loader) (-> java/lang/ClassLoader ..Handler) @@ -1435,7 +1435,7 @@ methodsS (monad.each ! (method_synthesis archive) methodsA) methodsG (monad.each ! (method_generation archive super_class) methodsS) .let [directive [class_name - (def.class #jvm.V1_6 #jvm.Public jvm.noneC class_name + (def.class {jvm.#V1_6} {jvm.#Public} jvm.noneC class_name (list\each ..constraint type_variables) super_class super_interfaces @@ -1445,7 +1445,7 @@ (do ! [artifact_id (generation.learn_custom class_name) _ (generation.execute! directive) - _ (generation.save! artifact_id {#.Some class_name} directive) + _ (generation.save! artifact_id {.#Some class_name} directive) _ (generation.log! (format "JVM Class " (%.text class_name)))] (in directive.no_requirements)))))])) @@ -1460,19 +1460,19 @@ (function (_ extension_name phase archive [[class_name type_variables] supers annotations method_declarations]) (do [! phase.monad] [.let [directive [class_name - (def.interface #jvm.V1_6 #jvm.Public jvm.noneC class_name + (def.interface {jvm.#V1_6} {jvm.#Public} jvm.noneC class_name (list\each ..constraint type_variables) supers (|> method_declarations (list\each (function (_ (^slots [#name #annotations #type_variables #exceptions #arguments #return])) - (def.abstract_method #jvm.Public jvm.noneM name + (def.abstract_method {jvm.#Public} jvm.noneM name (/type.method [type_variables arguments return exceptions])))) def.fuse))]]] (directive.lifted_generation (do ! [artifact_id (generation.learn_custom class_name) _ (generation.execute! directive) - _ (generation.save! artifact_id {#.Some class_name} directive) + _ (generation.save! artifact_id {.#Some class_name} directive) _ (generation.log! (format "JVM Interface " (%.text class_name)))] (in directive.no_requirements)))))])) diff --git a/lux-jvm/source/luxc/lang/host/jvm.lux b/lux-jvm/source/luxc/lang/host/jvm.lux index a7eb07777..3bb609324 100644 --- a/lux-jvm/source/luxc/lang/host/jvm.lux +++ b/lux-jvm/source/luxc/lang/host/jvm.lux @@ -47,21 +47,21 @@ (type: .public Visibility (Variant - #Public - #Protected - #Private - #Default)) + {#Public} + {#Protected} + {#Private} + {#Default})) (type: .public Version (Variant - #V1_1 - #V1_2 - #V1_3 - #V1_4 - #V1_5 - #V1_6 - #V1_7 - #V1_8)) + {#V1_1} + {#V1_2} + {#V1_3} + {#V1_4} + {#V1_5} + {#V1_6} + {#V1_7} + {#V1_8})) (type: .public ByteCode Binary) diff --git a/lux-jvm/source/luxc/lang/host/jvm/def.lux b/lux-jvm/source/luxc/lang/host/jvm/def.lux index ecafc00d2..4aa88ff9a 100644 --- a/lux-jvm/source/luxc/lang/host/jvm/def.lux +++ b/lux-jvm/source/luxc/lang/host/jvm/def.lux @@ -90,43 +90,43 @@ (def: (version_flag version) (-> //.Version Int) (case version - #//.V1_1 (org/objectweb/asm/Opcodes::V1_1) - #//.V1_2 (org/objectweb/asm/Opcodes::V1_2) - #//.V1_3 (org/objectweb/asm/Opcodes::V1_3) - #//.V1_4 (org/objectweb/asm/Opcodes::V1_4) - #//.V1_5 (org/objectweb/asm/Opcodes::V1_5) - #//.V1_6 (org/objectweb/asm/Opcodes::V1_6) - #//.V1_7 (org/objectweb/asm/Opcodes::V1_7) - #//.V1_8 (org/objectweb/asm/Opcodes::V1_8))) + {//.#V1_1} (org/objectweb/asm/Opcodes::V1_1) + {//.#V1_2} (org/objectweb/asm/Opcodes::V1_2) + {//.#V1_3} (org/objectweb/asm/Opcodes::V1_3) + {//.#V1_4} (org/objectweb/asm/Opcodes::V1_4) + {//.#V1_5} (org/objectweb/asm/Opcodes::V1_5) + {//.#V1_6} (org/objectweb/asm/Opcodes::V1_6) + {//.#V1_7} (org/objectweb/asm/Opcodes::V1_7) + {//.#V1_8} (org/objectweb/asm/Opcodes::V1_8))) (def: (visibility_flag visibility) (-> //.Visibility Int) (case visibility - #//.Public (org/objectweb/asm/Opcodes::ACC_PUBLIC) - #//.Protected (org/objectweb/asm/Opcodes::ACC_PROTECTED) - #//.Private (org/objectweb/asm/Opcodes::ACC_PRIVATE) - #//.Default +0)) + {//.#Public} (org/objectweb/asm/Opcodes::ACC_PUBLIC) + {//.#Protected} (org/objectweb/asm/Opcodes::ACC_PROTECTED) + {//.#Private} (org/objectweb/asm/Opcodes::ACC_PRIVATE) + {//.#Default} +0)) (def: (class_flags config) (-> //.Class_Config Int) ($_ i.+ - (if (value@ #//.finalC config) (org/objectweb/asm/Opcodes::ACC_FINAL) +0))) + (if (value@ //.#finalC config) (org/objectweb/asm/Opcodes::ACC_FINAL) +0))) (def: (method_flags config) (-> //.Method_Config Int) ($_ i.+ - (if (value@ #//.staticM config) (org/objectweb/asm/Opcodes::ACC_STATIC) +0) - (if (value@ #//.finalM config) (org/objectweb/asm/Opcodes::ACC_FINAL) +0) - (if (value@ #//.synchronizedM config) (org/objectweb/asm/Opcodes::ACC_SYNCHRONIZED) +0) - (if (value@ #//.strictM config) (org/objectweb/asm/Opcodes::ACC_STRICT) +0))) + (if (value@ //.#staticM config) (org/objectweb/asm/Opcodes::ACC_STATIC) +0) + (if (value@ //.#finalM config) (org/objectweb/asm/Opcodes::ACC_FINAL) +0) + (if (value@ //.#synchronizedM config) (org/objectweb/asm/Opcodes::ACC_SYNCHRONIZED) +0) + (if (value@ //.#strictM config) (org/objectweb/asm/Opcodes::ACC_STRICT) +0))) (def: (field_flags config) (-> //.Field_Config Int) ($_ i.+ - (if (value@ #//.staticF config) (org/objectweb/asm/Opcodes::ACC_STATIC) +0) - (if (value@ #//.finalF config) (org/objectweb/asm/Opcodes::ACC_FINAL) +0) - (if (value@ #//.transientF config) (org/objectweb/asm/Opcodes::ACC_TRANSIENT) +0) - (if (value@ #//.volatileF config) (org/objectweb/asm/Opcodes::ACC_VOLATILE) +0))) + (if (value@ //.#staticF config) (org/objectweb/asm/Opcodes::ACC_STATIC) +0) + (if (value@ //.#finalF config) (org/objectweb/asm/Opcodes::ACC_FINAL) +0) + (if (value@ //.#transientF config) (org/objectweb/asm/Opcodes::ACC_TRANSIENT) +0) + (if (value@ //.#volatileF config) (org/objectweb/asm/Opcodes::ACC_VOLATILE) +0))) (def: param_signature (-> (Type Class) Text) @@ -293,11 +293,11 @@ (def: .public (fuse defs) (-> (List //.Def) //.Def) (case defs - #.End + {.#End} function.identity - {#.Item singleton #.End} + {.#Item singleton {.#End}} singleton - {#.Item head tail} + {.#Item head tail} (function.composite (fuse tail) head))) diff --git a/lux-jvm/source/luxc/lang/host/jvm/inst.lux b/lux-jvm/source/luxc/lang/host/jvm/inst.lux index bbeffb023..64113cd68 100644 --- a/lux-jvm/source/luxc/lang/host/jvm/inst.lux +++ b/lux-jvm/source/luxc/lang/host/jvm/inst.lux @@ -152,7 +152,7 @@ (def: .public make_label (All (_ s) (Operation s org/objectweb/asm/Label)) (function (_ state) - {#try.Success [state (org/objectweb/asm/Label::new)]})) + {try.#Success [state (org/objectweb/asm/Label::new)]})) (def: .public (with_label action) (All (_ a) (-> (-> org/objectweb/asm/Label a) a)) @@ -414,10 +414,10 @@ (def: .public (array elementT) (-> (Type Value) Inst) (case (type.primitive? elementT) - {#.Left elementT} + {.#Left elementT} (ANEWARRAY elementT) - {#.Right elementT} + {.#Right elementT} (NEWARRAY elementT))) (template [<name> <boolean> <byte> <short> <int> <long> <float> <double> <char>] @@ -459,11 +459,11 @@ (def: .public (fuse insts) (-> (List Inst) Inst) (case insts - #.End + {.#End} function.identity - {#.Item singleton #.End} + {.#Item singleton {.#End}} singleton - {#.Item head tail} + {.#Item head tail} (function.composite (fuse tail) head))) diff --git a/lux-jvm/source/luxc/lang/synthesis/variable.lux b/lux-jvm/source/luxc/lang/synthesis/variable.lux index 685eaae92..f580ceec7 100644 --- a/lux-jvm/source/luxc/lang/synthesis/variable.lux +++ b/lux-jvm/source/luxc/lang/synthesis/variable.lux @@ -11,10 +11,11 @@ (def: (bound-vars path) (-> ls.Path (List Variable)) (case path - {#ls.BindP register} + {ls.#BindP register} (list (.int register)) - (^or {#ls.SeqP pre post} {#ls.AltP pre post}) + (^or {ls.#SeqP pre post} + {ls.#AltP pre post}) (list/composite (bound-vars pre) (bound-vars post)) _ @@ -23,13 +24,13 @@ (def: (path-bodies path) (-> ls.Path (List ls.Synthesis)) (case path - {#ls.ExecP body} + {ls.#ExecP body} (list body) - {#ls.SeqP pre post} + {ls.#SeqP pre post} (path-bodies post) - {#ls.AltP pre post} + {ls.#AltP pre post} (list/composite (path-bodies pre) (path-bodies post)) _ @@ -49,40 +50,40 @@ (let [tracker (loop [exprS exprS tracker (list/mix s.has init-tracker bound)] (case exprS - {#ls.Variable var} + {ls.#Variable var} (if (non-arg? current-arity var) (s.lacks var tracker) tracker) - {#ls.Variant tag last? memberS} + {ls.#Variant tag last? memberS} (recur memberS tracker) - {#ls.Tuple membersS} + {ls.#Tuple membersS} (list/mix recur tracker membersS) - {#ls.Call funcS argsS} + {ls.#Call funcS argsS} (list/mix recur (recur funcS tracker) argsS) - (^or {#ls.Recur argsS} - {#ls.Procedure name argsS}) + (^or {ls.#Recur argsS} + {ls.#Procedure name argsS}) (list/mix recur tracker argsS) - {#ls.Let offset inputS outputS} + {ls.#Let offset inputS outputS} (|> tracker (recur inputS) (recur outputS)) - {#ls.If testS thenS elseS} + {ls.#If testS thenS elseS} (|> tracker (recur testS) (recur thenS) (recur elseS)) - {#ls.Loop offset initsS bodyS} + {ls.#Loop offset initsS bodyS} (recur bodyS (list/mix recur tracker initsS)) - {#ls.Case inputS outputPS} + {ls.#Case inputS outputPS} (let [tracker' (list/mix s.has (recur inputS tracker) (bound-vars outputPS))] (list/mix recur tracker' (path-bodies outputPS))) - {#ls.Function arity env bodyS} + {ls.#Function arity env bodyS} (list/mix s.lacks tracker env) _ diff --git a/lux-jvm/source/luxc/lang/translation/jvm.lux b/lux-jvm/source/luxc/lang/translation/jvm.lux index 6a641f0ee..a44bc67e3 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm.lux @@ -83,20 +83,20 @@ (def: (class_value class_name class) (-> Text (java/lang/Class java/lang/Object) (Try Any)) (case (java/lang/Class::getField ..value_field class) - {#try.Success field} - (case (java/lang/reflect/Field::get #.None field) - {#try.Success ?value} + {try.#Success field} + (case (java/lang/reflect/Field::get {.#None} field) + {try.#Success ?value} (case ?value - {#.Some value} - {#try.Success value} + {.#Some value} + {try.#Success value} - #.None + {.#None} (exception.except ..invalid_value class_name)) - {#try.Failure error} + {try.#Failure error} (exception.except ..cannot_load [class_name error])) - {#try.Failure error} + {try.#Failure error} (exception.except ..invalid_field [class_name ..value_field error]))) (def: class_path_separator ".") @@ -116,14 +116,14 @@ (-> Library java/lang/ClassLoader generation.Context Inst (Try [Any Definition])) (let [eval_class (..class_name context) bytecode_name (..bytecode_name eval_class) - bytecode (def.class #jvm.V1_6 - #jvm.Public jvm.noneC + bytecode (def.class {jvm.#V1_6} + {jvm.#Public} jvm.noneC bytecode_name (list) $Value (list) - (|>> (def.field #jvm.Public ($_ jvm.++F jvm.finalF jvm.staticF) + (|>> (def.field {jvm.#Public} ($_ jvm.++F jvm.finalF jvm.staticF) ..value_field ..$Value) - (def.method #jvm.Public ($_ jvm.++M jvm.staticM jvm.strictM) + (def.method {jvm.#Public} ($_ jvm.++M jvm.staticM jvm.strictM) "<clinit>" (type.method [(list) (list) type.void (list)]) (|>> valueI diff --git a/lux-jvm/source/luxc/lang/translation/jvm/case.lux b/lux-jvm/source/luxc/lang/translation/jvm/case.lux index 0959130a3..04a9571a9 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/case.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/case.lux @@ -103,21 +103,21 @@ (def: (path' stack_depth @else @end phase archive path) (-> Nat Label Label Phase Archive Path (Operation Inst)) (.case path - #synthesis.Pop + {synthesis.#Pop} (operation@in ..popI) - {#synthesis.Bind register} + {synthesis.#Bind register} (operation@in (|>> peekI (_.ASTORE register))) - {#synthesis.Bit_Fork when thenP elseP} + {synthesis.#Bit_Fork when thenP elseP} (do phase.monad [thenG (path' stack_depth @else @end phase archive thenP) elseG (.case elseP - {#.Some elseP} + {.#Some elseP} (path' stack_depth @else @end phase archive elseP) - #.None + {.#None} (in (_.GOTO @else))) .let [ifI (.if when _.IFEQ _.IFNE)]] (in (<| _.with_label (function (_ @else)) @@ -146,17 +146,17 @@ elseG))))) (|>> <pop> (_.GOTO @else)) - {#.Item cons}))] + {.#Item cons}))] (in (|>> peekI <unwrap> forkG)))]) - ([#synthesis.I64_Fork (_.unwrap type.long) _.DUP2 _.POP2 (|>> .int _.long) _.LCMP _.IFNE] - [#synthesis.F64_Fork (_.unwrap type.double) _.DUP2 _.POP2 _.double _.DCMPL _.IFNE] - [#synthesis.Text_Fork (|>) _.DUP _.POP _.string + ([synthesis.#I64_Fork (_.unwrap type.long) _.DUP2 _.POP2 (|>> .int _.long) _.LCMP _.IFNE] + [synthesis.#F64_Fork (_.unwrap type.double) _.DUP2 _.POP2 _.double _.DCMPL _.IFNE] + [synthesis.#Text_Fork (|>) _.DUP _.POP _.string (_.INVOKEVIRTUAL (type.class "java.lang.Object" (list)) "equals" ..equalsJT) _.IFEQ]) - {#synthesis.Then bodyS} + {synthesis.#Then bodyS} (do phase.monad [bodyI (phase archive bodyS)] (in (|>> (pop_altI stack_depth) @@ -202,14 +202,14 @@ ([synthesis.member/left ..left_projection] [synthesis.member/right ..right_projection]) - {#synthesis.Seq leftP rightP} + {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)] (in (|>> leftI rightI))) - {#synthesis.Alt leftP rightP} + {synthesis.#Alt leftP rightP} (do phase.monad [@alt_else _.make_label leftI (path' (++ stack_depth) @alt_else @end phase archive leftP) @@ -268,10 +268,10 @@ [recordG (phase archive recordS)] (in (list@mix (function (_ step so_far) (.let [next (.case step - {#.Left lefts} + {.#Left lefts} (..left_projection lefts) - {#.Right lefts} + {.#Right lefts} (..right_projection lefts))] (|>> so_far next))) recordG diff --git a/lux-jvm/source/luxc/lang/translation/jvm/common.lux b/lux-jvm/source/luxc/lang/translation/jvm/common.lux index 2dade7a97..456a20694 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/common.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/common.lux @@ -31,22 +31,22 @@ ... (def: .public (with-artifacts action) ... (All (_ a) (-> (Meta a) (Meta [Artifacts a]))) ... (function (_ state) -... (case (action (revised@ #.host +... (case (action (revised@ .#host ... (|>> (:coerce Host) ... (with@ #artifacts (dictionary.new text.hash)) ... (:coerce Nothing)) ... state)) -... {#try.Success [state' output]} -... {#try.Success [(revised@ #.host +... {try.#Success [state' output]} +... {try.#Success [(revised@ .#host ... (|>> (:coerce Host) -... (with@ #artifacts (|> (value@ #.host state) (:coerce Host) (value@ #artifacts))) +... (with@ #artifacts (|> (value@ .#host state) (:coerce Host) (value@ #artifacts))) ... (:coerce Nothing)) ... state') -... [(|> state' (value@ #.host) (:coerce Host) (value@ #artifacts)) +... [(|> state' (value@ .#host) (:coerce Host) (value@ #artifacts)) ... output]]} -... {#try.Failure error} -... {#try.Failure error}))) +... {try.#Failure error} +... {try.#Failure error}))) ... (def: .public (load-definition state) ... (-> Lux (-> Name Binary (Try Any))) @@ -59,14 +59,14 @@ ... class (..load-class class-name)] ... (case (do try.monad ... [field (Class::getField [..value-field] class)] -... (Field::get [#.None] field)) -... {#try.Success {#.Some def-value}} +... (Field::get [{.#None}] field)) +... {try.#Success {.#Some def-value}} ... (wrap def-value) -... {#try.Success #.None} +... {try.#Success {.#None}} ... (phase.throw invalid-definition-value (%name def-name)) -... {#try.Failure error} +... {try.#Failure error} ... (phase.throw cannot-load-definition ... (format "Definition: " (%name def-name) "\n" ... "Error:\n" diff --git a/lux-jvm/source/luxc/lang/translation/jvm/expression.lux b/lux-jvm/source/luxc/lang/translation/jvm/expression.lux index a460ad96b..55e81812d 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/expression.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/expression.lux @@ -72,5 +72,5 @@ (^ (synthesis.function/abstraction data)) (function.function translate archive data) - {#synthesis.Extension extension} + {synthesis.#Extension extension} (extension.apply archive translate extension))) diff --git a/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux b/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux index 8d92a68eb..78048379c 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux @@ -48,10 +48,10 @@ Handler)) (function (_ extension_name phase archive input) (case (<s>.result parser input) - {#try.Success input'} + {try.#Success input'} (handler extension_name phase archive input') - {#try.Failure error} + {try.#Failure error} (phase.except extension.invalid_syntax [extension_name %synthesis input])))) (import: java/lang/Double 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 5eda6443d..930e219a5 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux @@ -96,15 +96,15 @@ (do <>.monad [arrayJT (<text>.then parser.array <synthesis>.text)] (case (parser.array? arrayJT) - {#.Some elementJT} + {.#Some elementJT} (case (parser.object? elementJT) - {#.Some elementJT} + {.#Some elementJT} (in elementJT) - #.None + {.#None} (<>.failure (exception.error ..not_an_object_array [arrayJT]))) - #.None + {.#None} (undefined)))) (template [<name> <inst>] @@ -629,10 +629,10 @@ (do phase.monad [] (case (dictionary.value unboxed ..primitives) - {#.Some primitive} + {.#Some primitive} (in (_.GETSTATIC (type.class class (list)) field primitive)) - #.None + {.#None} (in (_.GETSTATIC (type.class class (list)) field (type.class unboxed (list)))))))])) (def: put::static @@ -644,12 +644,12 @@ [valueI (generate archive valueS) .let [$class (type.class class (list))]] (case (dictionary.value unboxed ..primitives) - {#.Some primitive} + {.#Some primitive} (in (|>> valueI (_.PUTSTATIC $class field primitive) (_.string synthesis.unit))) - #.None + {.#None} (in (|>> valueI (_.CHECKCAST $class) (_.PUTSTATIC $class field $class) @@ -664,10 +664,10 @@ [objectI (generate archive objectS) .let [$class (type.class class (list)) getI (case (dictionary.value unboxed ..primitives) - {#.Some primitive} + {.#Some primitive} (_.GETFIELD $class field primitive) - #.None + {.#None} (_.GETFIELD $class field (type.class unboxed (list))))]] (in (|>> objectI (_.CHECKCAST $class) @@ -683,10 +683,10 @@ objectI (generate archive objectS) .let [$class (type.class class (list)) putI (case (dictionary.value unboxed ..primitives) - {#.Some primitive} + {.#Some primitive} (_.PUTFIELD $class field primitive) - #.None + {.#None} (let [$unboxed (type.class unboxed (list))] (|>> (_.CHECKCAST $unboxed) (_.PUTFIELD $class field $unboxed))))]] @@ -709,10 +709,10 @@ (do phase.monad [valueI (generate archive valueS)] (case (type.primitive? valueT) - {#.Right valueT} + {.#Right valueT} (in [valueT valueI]) - {#.Left valueT} + {.#Left valueT} (in [valueT (|>> valueI (_.CHECKCAST valueT))])))) @@ -722,10 +722,10 @@ (def: (prepare_output outputT) (-> (Type Return) Inst) (case (type.void? outputT) - {#.Right outputT} + {.#Right outputT} ..voidI - {#.Left outputT} + {.#Left outputT} function.identity)) (def: invoke::static @@ -814,26 +814,26 @@ [0 _] body [1 _] body - [2 {#synthesis.Control {#synthesis.Branch {#synthesis.Let _ 2 hidden}}}] + [2 {synthesis.#Control {synthesis.#Branch {synthesis.#Let _ 2 hidden}}}] hidden - [_ {#synthesis.Control {#synthesis.Branch {#synthesis.Case _ path}}}] + [_ {synthesis.#Control {synthesis.#Branch {synthesis.#Case _ path}}}] (loop [path path] (case path - (^or #synthesis.Pop - {#synthesis.Access _} - {#synthesis.Bind _} - {#synthesis.Bit_Fork _} - {#synthesis.I64_Fork _} - {#synthesis.F64_Fork _} - {#synthesis.Text_Fork _} - {#synthesis.Alt _}) + (^or {synthesis.#Pop} + {synthesis.#Access _} + {synthesis.#Bind _} + {synthesis.#Bit_Fork _} + {synthesis.#I64_Fork _} + {synthesis.#F64_Fork _} + {synthesis.#Text_Fork _} + {synthesis.#Alt _}) body - {#synthesis.Seq _ next} + {synthesis.#Seq _ next} (recur next) - {#synthesis.Then hidden} + {synthesis.#Then hidden} hidden)) _ @@ -875,18 +875,18 @@ (^template [<tag>] [(^ {<tag> leftP rightP}) {<tag> (recur leftP) (recur rightP)}]) - ([#synthesis.Alt] - [#synthesis.Seq]) + ([synthesis.#Alt] + [synthesis.#Seq]) (^template [<tag>] - [(^ {<tag> value}) + [(^ {<tag> _}) path]) - ([#synthesis.Pop] - [#synthesis.Bind] - [#synthesis.Access]) + ([synthesis.#Pop] + [synthesis.#Bind] + [synthesis.#Access]) - {#synthesis.Bit_Fork when then else} - {#synthesis.Bit_Fork when (recur then) (maybe\each recur else)} + {synthesis.#Bit_Fork when then else} + {synthesis.#Bit_Fork when (recur then) (maybe\each recur else)} (^template [<tag>] [{<tag> [[test then] elses]} @@ -894,16 +894,16 @@ (list\each (function (_ [else_test else_then]) [else_test (recur else_then)]) elses)]}]) - ([#synthesis.I64_Fork] - [#synthesis.F64_Fork] - [#synthesis.Text_Fork]) + ([synthesis.#I64_Fork] + [synthesis.#F64_Fork] + [synthesis.#Text_Fork]) ))) (def: (normalize_method_body mapping) (-> (Dictionary Synthesis Variable) Synthesis Synthesis) (function (recur body) (case body - (^ {#synthesis.Primitive value}) + (^ {synthesis.#Primitive value}) body (^ (synthesis.constant value)) @@ -957,8 +957,8 @@ (^ (synthesis.function/apply [functionS inputsS+])) (synthesis.function/apply [(recur functionS) (list\each recur inputsS+)]) - {#synthesis.Extension [name inputsS+]} - {#synthesis.Extension [name (list\each recur inputsS+)]}))) + {synthesis.#Extension [name inputsS+]} + {synthesis.#Extension [name (list\each recur inputsS+)]}))) (def: $Object (type.class "java.lang.Object" (list))) @@ -999,14 +999,14 @@ (def: (prepare_argument lux_register argumentT jvm_register) (-> Register (Type Value) Register [Register Inst]) (case (type.primitive? argumentT) - {#.Left argumentT} + {.#Left argumentT} [(n.+ 1 jvm_register) (if (n.= lux_register jvm_register) (|>>) (|>> (_.ALOAD jvm_register) (_.ASTORE lux_register)))] - {#.Right argumentT} + {.#Right argumentT} (template.let [(wrap_primitive <shift> <load> <type>) [[(n.+ <shift> jvm_register) (|>> (<load> jvm_register) @@ -1040,21 +1040,21 @@ (def: .public (returnI returnT) (-> (Type Return) Inst) (case (type.void? returnT) - {#.Right returnT} + {.#Right returnT} _.RETURN - {#.Left returnT} + {.#Left returnT} (case (type.primitive? returnT) - {#.Left returnT} + {.#Left returnT} (case (type.class? returnT) - {#.Some class_name} + {.#Some class_name} (|>> (_.CHECKCAST returnT) _.ARETURN) - #.None + {.#None} _.ARETURN) - {#.Right returnT} + {.#Right returnT} (template.let [(unwrap_primitive <return> <type>) [(|>> (_.unwrap <type>) <return>)]] @@ -1102,7 +1102,7 @@ ... Give them names as "foreign" variables. list.enumeration (list\each (function (_ [id capture]) - [capture {#variable.Foreign id}])) + [capture {variable.#Foreign id}])) (dictionary.of_list synthesis.hash)) normalized_methods (list\each (function (_ [environment [ownerT name @@ -1150,7 +1150,7 @@ (..with_anonymous_init class total_environment super_class inputsTI) method_definitions))]] _ (generation.execute! directive) - _ (generation.save! artifact_id #.None directive)] + _ (generation.save! artifact_id {.#None} directive)] (..anonymous_instance generate archive class total_environment)))])) (def: class_bundle diff --git a/lux-jvm/source/luxc/lang/translation/jvm/function.lux b/lux-jvm/source/luxc/lang/translation/jvm/function.lux index 7630191e9..458683ec2 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/function.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/function.lux @@ -308,14 +308,14 @@ (do [! phase.monad] [@begin _.make_label [function_context bodyI] (case forced_context - {#.Some function_context} + {.#Some function_context} (do ! [without_context (generation.with_anchor [@begin 1] (generate archive bodyS))] (in [function_context without_context])) - #.None + {.#None} (generation.with_new_context archive (generation.with_anchor [@begin 1] (generate archive bodyS)))) @@ -328,16 +328,16 @@ functionD)]] _ (generation.execute! directive) _ (case forced_context - #.None - (generation.save! (product.right function_context) #.None directive) + {.#None} + (generation.save! (product.right function_context) {.#None} directive) - {#.Some function_context} + {.#Some function_context} (in []))] (in instanceI))) (def: .public function (Generator Abstraction) - (..function' #.None)) + (..function' {.#None})) (def: .public (call generate archive [functionS argsS]) (Generator Apply) diff --git a/lux-jvm/source/luxc/lang/translation/jvm/program.lux b/lux-jvm/source/luxc/lang/translation/jvm/program.lux index 1db9028d1..266938286 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/program.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/program.lux @@ -79,12 +79,12 @@ (list)]) class (artifact_name context)] [class - ($d.class #_.V1_6 - #_.Public _.finalC + ($d.class {_.#V1_6} + {_.#Public} _.finalC class (list) ..^Object (list) - (|>> ($d.method #_.Public _.staticM "main" main_type + (|>> ($d.method {_.#Public} _.staticM "main" main_type (|>> programI prepare_input_listI feed_inputsI diff --git a/lux-jvm/source/luxc/lang/translation/jvm/reference.lux b/lux-jvm/source/luxc/lang/translation/jvm/reference.lux index 3c76f44c0..1c1beda17 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/reference.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/reference.lux @@ -53,10 +53,10 @@ (def: .public (variable archive variable) (-> Archive Variable (Operation Inst)) (case variable - {#variable.Local variable} + {variable.#Local variable} (operation@in (local variable)) - {#variable.Foreign variable} + {variable.#Foreign variable} (foreign archive variable))) (def: .public (constant archive name) diff --git a/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux b/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux index 8deac8430..995d82e47 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux @@ -364,8 +364,8 @@ directive [runtime_class bytecode]] (do phase.monad [_ (generation.execute! directive) - _ (generation.save! ..runtime_id #.None directive)] - (in [..runtime_id #.None bytecode])))) + _ (generation.save! ..runtime_id {.#None} directive)] + (in [..runtime_id {.#None} bytecode])))) (def: function_id 1) @@ -401,8 +401,8 @@ directive [function_class bytecode]] (do phase.monad [_ (generation.execute! directive) - _ (generation.save! ..function_id #.None directive)] - (in [..function_id #.None bytecode])))) + _ (generation.save! ..function_id {.#None} directive)] + (in [..function_id {.#None} bytecode])))) (def: .public translate (Operation [Registry Output]) |