From 464b6e8f5e6c62f58fa8c7ff61ab2ad215e98bd1 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 9 Aug 2021 23:02:01 -0400 Subject: Improved single-line comment syntax (from "##" to "..."). --- lux-jvm/source/luxc/lang/directive/jvm.lux | 20 ++-- lux-jvm/source/luxc/lang/host/jvm/def.lux | 2 +- lux-jvm/source/luxc/lang/host/jvm/inst.lux | 58 +++++----- lux-jvm/source/luxc/lang/synthesis/variable.lux | 14 +-- lux-jvm/source/luxc/lang/translation/jvm/case.lux | 4 +- .../source/luxc/lang/translation/jvm/common.lux | 126 ++++++++++----------- .../luxc/lang/translation/jvm/extension/common.lux | 2 +- .../luxc/lang/translation/jvm/extension/host.lux | 14 +-- .../source/luxc/lang/translation/jvm/function.lux | 2 +- lux-jvm/source/luxc/lang/translation/jvm/loop.lux | 16 +-- .../source/luxc/lang/translation/jvm/primitive.lux | 10 +- .../source/luxc/lang/translation/jvm/reference.lux | 2 +- .../source/luxc/lang/translation/jvm/runtime.lux | 58 +++++----- .../source/luxc/lang/translation/jvm/structure.lux | 2 +- lux-jvm/source/program.lux | 22 ++-- lux-jvm/source/test/program.lux | 2 +- lux-jvm/test/test/luxc/lang/analysis/host.jvm.lux | 4 +- 17 files changed, 179 insertions(+), 179 deletions(-) (limited to 'lux-jvm') diff --git a/lux-jvm/source/luxc/lang/directive/jvm.lux b/lux-jvm/source/luxc/lang/directive/jvm.lux index 000a5808f..8a06289da 100644 --- a/lux-jvm/source/luxc/lang/directive/jvm.lux +++ b/lux-jvm/source/luxc/lang/directive/jvm.lux @@ -1,6 +1,6 @@ (.module: [library - [lux (#- Type static) + [lux (#- Type static local) ["." ffi (#+ Inheritance Privacy State import:)] [abstract ["." monad (#+ do)]] @@ -539,7 +539,7 @@ (as_is jvm.Definition) (as_is )] (type: Handler' - ## (generation.Handler jvm.Anchor (/.Bytecode Inst /.Label) jvm.Definition) + ... (generation.Handler jvm.Anchor (/.Bytecode Inst /.Label) jvm.Definition) (-> extension.Name (phase.Phase [(extension.Bundle ) (generation.State )] @@ -858,7 +858,7 @@ (\ /type.equivalence = /type.float primitiveT) _.FCONST_0 - ## (\ /type.equivalence = /type.double primitiveT) + ... (\ /type.equivalence = /type.double primitiveT) _.DCONST_0))) (def: (header_return returnT) @@ -890,7 +890,7 @@ (|>> (header_value primitiveT) _.FRETURN) - ## (\ /type.equivalence = /type.double primitiveT) + ... (\ /type.equivalence = /type.double primitiveT) (|>> (header_value primitiveT) _.DRETURN))))) @@ -1147,11 +1147,11 @@ )) (template: (method_body ) - (<| synthesis.function/abstraction [_ _] - synthesis.loop/scope [_ _] - synthesis.tuple - (list _) - )) + [(<| synthesis.function/abstraction [_ _] + synthesis.loop/scope [_ _] + synthesis.tuple + (list _) + )]) (def: (constructor_method_synthesis archive method) (-> Archive (Constructor Analysis) (Operation (Constructor Synthesis))) @@ -1420,7 +1420,7 @@ inheritance fields methodsC)] - ## Necessary for reflection to work properly during analysis. + ... Necessary for reflection to work properly during analysis. _ (directive.lift_generation (generation.execute! header)) .let [supers (: (List (Type Class)) diff --git a/lux-jvm/source/luxc/lang/host/jvm/def.lux b/lux-jvm/source/luxc/lang/host/jvm/def.lux index 939a8cb91..064224c6e 100644 --- a/lux-jvm/source/luxc/lang/host/jvm/def.lux +++ b/lux-jvm/source/luxc/lang/host/jvm/def.lux @@ -160,7 +160,7 @@ Int ($_ i.+ (org/objectweb/asm/ClassWriter::COMPUTE_MAXS) - ## (org/objectweb/asm/ClassWriter::COMPUTE_FRAMES) + ... (org/objectweb/asm/ClassWriter::COMPUTE_FRAMES) )) (def: binary_name (|>> name.internal name.read)) diff --git a/lux-jvm/source/luxc/lang/host/jvm/inst.lux b/lux-jvm/source/luxc/lang/host/jvm/inst.lux index 1a2c811a3..f7a8e6b18 100644 --- a/lux-jvm/source/luxc/lang/host/jvm/inst.lux +++ b/lux-jvm/source/luxc/lang/host/jvm/inst.lux @@ -40,7 +40,7 @@ (def: descriptor (|>> type.descriptor descriptor.descriptor)) (def: reflection (|>> type.reflection reflection.reflection)) -## [Host] +... [Host] (import: java/lang/Object) (import: java/lang/String) @@ -53,26 +53,26 @@ ["#::." (#static NOP int) - ## Conversion + ... Conversion (~~ (declare D2F D2I D2L F2D F2I F2L I2B I2C I2D I2F I2L I2S L2D L2F L2I)) - ## Primitive + ... Primitive (~~ (declare T_BOOLEAN T_CHAR T_FLOAT T_DOUBLE T_BYTE T_SHORT T_INT T_LONG)) - ## Class + ... Class (~~ (declare CHECKCAST NEW INSTANCEOF)) - ## Stack + ... Stack (~~ (declare DUP DUP_X1 DUP_X2 DUP2 DUP2_X1 DUP2_X2 POP POP2 SWAP)) - ## Jump + ... Jump (~~ (declare IF_ICMPEQ IF_ICMPGT IF_ICMPLT IF_ICMPNE IF_ICMPGE IF_ICMPLE IF_ACMPEQ IF_ACMPNE IFNULL IFNONNULL @@ -86,22 +86,22 @@ DCONST_0 DCONST_1)) (#static ACONST_NULL int) - ## Var + ... Var (~~ (declare IINC ILOAD LLOAD FLOAD DLOAD ALOAD ISTORE LSTORE FSTORE DSTORE ASTORE)) - ## Arithmetic + ... Arithmetic (~~ (declare IADD ISUB IMUL IDIV IREM INEG LADD LSUB LMUL LDIV LREM LNEG LCMP FADD FSUB FMUL FDIV FREM FNEG FCMPG FCMPL DADD DSUB DMUL DDIV DREM DNEG DCMPG DCMPL)) - ## Bit-wise + ... Bit-wise (~~ (declare IAND IOR IXOR ISHL ISHR IUSHR LAND LOR LXOR LSHL LSHR LUSHR)) - ## Array + ... Array (~~ (declare ARRAYLENGTH NEWARRAY ANEWARRAY AALOAD AASTORE BALOAD BASTORE @@ -112,16 +112,16 @@ DALOAD DASTORE CALOAD CASTORE)) - ## Member + ... Member (~~ (declare GETSTATIC PUTSTATIC GETFIELD PUTFIELD INVOKESTATIC INVOKESPECIAL INVOKEVIRTUAL INVOKEINTERFACE)) (#static ATHROW int) - ## Concurrency + ... Concurrency (~~ (declare MONITORENTER MONITOREXIT)) - ## Return + ... Return (~~ (declare RETURN IRETURN LRETURN FRETURN DRETURN ARETURN))] )) @@ -148,7 +148,7 @@ (visitTableSwitchInsn [int int org/objectweb/asm/Label [org/objectweb/asm/Label]] void) ]) -## [Insts] +... [Insts] (def: .public make_label (All [s] (Operation s org/objectweb/asm/Label)) (function (_ state) @@ -174,7 +174,7 @@ ) (template: (!prefix short) - (`` ((~~ (template.identifier ["org/objectweb/asm/Opcodes::" short]))))) + [(`` ((~~ (template.identifier ["org/objectweb/asm/Opcodes::" short]))))]) (template [] [(def: .public @@ -215,38 +215,38 @@ [NOP] - ## Stack + ... Stack [DUP] [DUP_X1] [DUP_X2] [DUP2] [DUP2_X1] [DUP2_X2] [POP] [POP2] [SWAP] - ## Conversions + ... Conversions [D2F] [D2I] [D2L] [F2D] [F2I] [F2L] [I2B] [I2C] [I2D] [I2F] [I2L] [I2S] [L2D] [L2F] [L2I] - ## Integer arithmetic + ... Integer arithmetic [IADD] [ISUB] [IMUL] [IDIV] [IREM] [INEG] - ## Integer bitwise + ... Integer bitwise [IAND] [IOR] [IXOR] [ISHL] [ISHR] [IUSHR] - ## Long arithmetic + ... Long arithmetic [LADD] [LSUB] [LMUL] [LDIV] [LREM] [LNEG] [LCMP] - ## Long bitwise + ... Long bitwise [LAND] [LOR] [LXOR] [LSHL] [LSHR] [LUSHR] - ## Float arithmetic + ... Float arithmetic [FADD] [FSUB] [FMUL] [FDIV] [FREM] [FNEG] [FCMPG] [FCMPL] - ## Double arithmetic + ... Double arithmetic [DADD] [DSUB] [DMUL] [DDIV] [DREM] [DNEG] [DCMPG] [DCMPL] - ## Array + ... Array [ARRAYLENGTH] [AALOAD] [AASTORE] [BALOAD] [BASTORE] @@ -257,13 +257,13 @@ [DALOAD] [DASTORE] [CALOAD] [CASTORE] - ## Exceptions + ... Exceptions [ATHROW] - ## Concurrency + ... Concurrency [MONITORENTER] [MONITOREXIT] - ## Return + ... Return [RETURN] [IRETURN] [LRETURN] [FRETURN] [DRETURN] [ARETURN] ) @@ -330,7 +330,7 @@ [type.float org/objectweb/asm/Opcodes::T_FLOAT] [type.double org/objectweb/asm/Opcodes::T_DOUBLE] [type.char org/objectweb/asm/Opcodes::T_CHAR])) - ## else + ... else (undefined))))))) (template [ ] @@ -434,7 +434,7 @@ [type.float ] [type.double ] [type.char ])) - ## else + ... else (undefined))))] [primitive_wrapper diff --git a/lux-jvm/source/luxc/lang/synthesis/variable.lux b/lux-jvm/source/luxc/lang/synthesis/variable.lux index 33f359239..11fbaae51 100644 --- a/lux-jvm/source/luxc/lang/synthesis/variable.lux +++ b/lux-jvm/source/luxc/lang/synthesis/variable.lux @@ -90,10 +90,10 @@ ))] (s.to-list tracker))) -## (def: (optimize-register-use current-arity [pathS bodyS]) -## (-> ls.Arity [ls.Path ls.Synthesis] [ls.Path ls.Synthesis]) -## (let [bound (bound-vars pathS) -## unused (unused-vars current-arity bound bodyS) -## adjusted (adjust-vars unused bound)] -## [(|> pathS (clean-pattern adjusted) simplify-pattern) -## (clean-expression adjusted bodyS)])) +... (def: (optimize-register-use current-arity [pathS bodyS]) +... (-> ls.Arity [ls.Path ls.Synthesis] [ls.Path ls.Synthesis]) +... (let [bound (bound-vars pathS) +... unused (unused-vars current-arity bound bodyS) +... adjusted (adjust-vars unused bound)] +... [(|> pathS (clean-pattern adjusted) simplify-pattern) +... (clean-expression adjusted bodyS)])) diff --git a/lux-jvm/source/luxc/lang/translation/jvm/case.lux b/lux-jvm/source/luxc/lang/translation/jvm/case.lux index a863f9113..d3f6a29c1 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/case.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/case.lux @@ -41,7 +41,7 @@ 0 function.identity 1 _.POP 2 _.POP2 - _ ## (n.> 2) + _ ... (n.> 2) (|>> _.POP2 (pop_altI (n.- 2 stack_depth))))) @@ -183,7 +183,7 @@ ([synthesis.side/left false] [synthesis.side/right true]) - ## Extra optimization + ... Extra optimization (^template [ ] [(^ ( lefts)) (operation@in (|>> peekI diff --git a/lux-jvm/source/luxc/lang/translation/jvm/common.lux b/lux-jvm/source/luxc/lang/translation/jvm/common.lux index 65714f909..283081608 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/common.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/common.lux @@ -1,73 +1,73 @@ (.module: [library [lux #* - ## [abstract - ## [monad (#+ do)]] - ## [control - ## ["." try (#+ Try)] - ## ["ex" exception (#+ exception:)] - ## ["." io]] - ## [data - ## [binary (#+ Binary)] - ## ["." text ("#/." hash) - ## format] - ## [collection - ## ["." dictionary (#+ Dictionary)]]] - ## ["." macro] - ## [host (#+ import:)] - ## [tool - ## [compiler - ## [reference (#+ Register)] - ## ["." name] - ## ["." phase]]] + ... [abstract + ... [monad (#+ do)]] + ... [control + ... ["." try (#+ Try)] + ... ["ex" exception (#+ exception:)] + ... ["." io]] + ... [data + ... [binary (#+ Binary)] + ... ["." text ("#/." hash) + ... format] + ... [collection + ... ["." dictionary (#+ Dictionary)]]] + ... ["." macro] + ... [host (#+ import:)] + ... [tool + ... [compiler + ... [reference (#+ Register)] + ... ["." name] + ... ["." phase]]] ]] - ## [luxc - ## [lang - ## [host - ## ["." jvm - ## [type]]]]] + ... [luxc + ... [lang + ... [host + ... ["." jvm + ... [type]]]]] ) -## (def: .public (with-artifacts action) -## (All [a] (-> (Meta a) (Meta [Artifacts a]))) -## (function (_ state) -## (case (action (update@ #.host -## (|>> (:coerce Host) -## (set@ #artifacts (dictionary.new text.hash)) -## (:coerce Nothing)) -## state)) -## (#try.Success [state' output]) -## (#try.Success [(update@ #.host -## (|>> (:coerce Host) -## (set@ #artifacts (|> (get@ #.host state) (:coerce Host) (get@ #artifacts))) -## (:coerce Nothing)) -## state') -## [(|> state' (get@ #.host) (:coerce Host) (get@ #artifacts)) -## output]]) +... (def: .public (with-artifacts action) +... (All [a] (-> (Meta a) (Meta [Artifacts a]))) +... (function (_ state) +... (case (action (update@ #.host +... (|>> (:coerce Host) +... (set@ #artifacts (dictionary.new text.hash)) +... (:coerce Nothing)) +... state)) +... (#try.Success [state' output]) +... (#try.Success [(update@ #.host +... (|>> (:coerce Host) +... (set@ #artifacts (|> (get@ #.host state) (:coerce Host) (get@ #artifacts))) +... (:coerce Nothing)) +... state') +... [(|> state' (get@ #.host) (:coerce Host) (get@ #artifacts)) +... output]]) -## (#try.Failure error) -## (#try.Failure error)))) +... (#try.Failure error) +... (#try.Failure error)))) -## (def: .public (load-definition state) -## (-> Lux (-> Name Binary (Try Any))) -## (function (_ (^@ def-name [def-module def-name]) def-bytecode) -## (let [normal-name (format (name.normalize def-name) (%n (text/hash def-name))) -## class-name (format (text.replace-all "/" "." def-module) "." normal-name)] -## (<| (macro.run state) -## (do macro.monad -## [_ (..store-class class-name def-bytecode) -## class (..load-class class-name)] -## (case (do try.monad -## [field (Class::getField [..value-field] class)] -## (Field::get [#.None] field)) -## (#try.Success (#.Some def-value)) -## (wrap def-value) +... (def: .public (load-definition state) +... (-> Lux (-> Name Binary (Try Any))) +... (function (_ (^@ def-name [def-module def-name]) def-bytecode) +... (let [normal-name (format (name.normalize def-name) (%n (text/hash def-name))) +... class-name (format (text.replace-all "/" "." def-module) "." normal-name)] +... (<| (macro.run state) +... (do macro.monad +... [_ (..store-class class-name def-bytecode) +... class (..load-class class-name)] +... (case (do try.monad +... [field (Class::getField [..value-field] class)] +... (Field::get [#.None] field)) +... (#try.Success (#.Some def-value)) +... (wrap def-value) -## (#try.Success #.None) -## (phase.throw invalid-definition-value (%name def-name)) +... (#try.Success #.None) +... (phase.throw invalid-definition-value (%name def-name)) -## (#try.Failure error) -## (phase.throw cannot-load-definition -## (format "Definition: " (%name def-name) "\n" -## "Error:\n" -## error)))))))) +... (#try.Failure error) +... (phase.throw cannot-load-definition +... (format "Definition: " (%name def-name) "\n" +... "Error:\n" +... error)))))))) 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 8c6d96283..14d31d4e2 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux @@ -84,7 +84,7 @@ (def: unitI Inst (_.string synthesis.unit)) -## TODO: Get rid of this ASAP +... TODO: Get rid of this ASAP (def: lux::syntax_char_case! (..custom [($_ <>.and .any 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 069f23fae..2d94e822c 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux @@ -590,7 +590,7 @@ [box.float type.float] [box.double type.double] [box.char type.char])) - ## else + ... else (in valueI)))) _ @@ -1024,7 +1024,7 @@ [1 _.FLOAD type.float] [2 _.LLOAD type.long])) - ## (\ type.equivalence = type.double argumentT) + ... (\ type.equivalence = type.double argumentT) (wrap_primitive 2 _.DLOAD type.double)))))) (def: .public (prepare_arguments offset types) @@ -1070,7 +1070,7 @@ [_.FRETURN type.float] [_.LRETURN type.long])) - ## (\ type.equivalence = type.double returnT) + ... (\ type.equivalence = type.double returnT) (unwrap_primitive _.DRETURN type.double))))))) (def: class::anonymous @@ -1091,15 +1091,15 @@ anonymous_class_name (///.class_name context) class (type.class anonymous_class_name (list)) total_environment (|> overriden_methods - ## Get all the environments. + ... Get all the environments. (list\map product.left) - ## Combine them. + ... Combine them. list\join - ## Remove duplicates. + ... Remove duplicates. (set.of_list synthesis.hash) set.list) global_mapping (|> total_environment - ## Give them names as "foreign" variables. + ... Give them names as "foreign" variables. list.enumeration (list\map (function (_ [id capture]) [capture (#variable.Foreign id)])) diff --git a/lux-jvm/source/luxc/lang/translation/jvm/function.lux b/lux-jvm/source/luxc/lang/translation/jvm/function.lux index ac2adaaaa..b39157480 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/function.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/function.lux @@ -233,7 +233,7 @@ (applysI (inc args_to_completion) args_left) _.ARETURN)) - ## (i.< over_extent (.int stage)) + ... (i.< over_extent (.int stage)) (let [env_size (list.size env) load_capturedI (|> (case env_size 0 (list) diff --git a/lux-jvm/source/luxc/lang/translation/jvm/loop.lux b/lux-jvm/source/luxc/lang/translation/jvm/loop.lux index bd1e29d0f..85187815d 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/loop.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/loop.lux @@ -44,14 +44,14 @@ list.enumeration (list@map (function (_ [register argument]) [(n.+ start register) argument])))] - ## It may look weird that first I compile the values separately, - ## and then I compile the stores/allocations. - ## It must be done that way in order to avoid a potential bug. - ## Let's say that you'll recur with 2 expressions: X and Y. - ## If Y depends on the value of X, and you don't compile values - ## and stores separately, then by the time Y is evaluated, it - ## will refer to the new value of X, instead of the old value, and - ## shouldn't be the case. + ... It may look weird that first I compile the values separately, + ... and then I compile the stores/allocations. + ... It must be done that way in order to avoid a potential bug. + ... Let's say that you'll recur with 2 expressions: X and Y. + ... If Y depends on the value of X, and you don't compile values + ... and stores separately, then by the time Y is evaluated, it + ... will refer to the new value of X, instead of the old value, and + ... shouldn't be the case. valuesI+ (monad.map @ (function (_ [register argS]) (: (Operation Inst) (if (invariant? register argS) diff --git a/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux b/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux index 313c12f9b..359406e7e 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux @@ -46,8 +46,8 @@ [ (operation@in (|>> _.I2L (_.wrap type.long)))]) ([-1 _.ICONST_M1] - ## [+0 _.ICONST_0] - ## [+1 _.ICONST_1] + ... [+0 _.ICONST_0] + ... [+1 _.ICONST_1] [+2 _.ICONST_2] [+3 _.ICONST_3] [+4 _.ICONST_4] @@ -62,7 +62,7 @@ (i.<= (java/lang/Short::MAX_VALUE) value)) (|>> (_.SIPUSH value) _.I2L) - ## else + ... else (|> value .int _.long))] (operation@in (|>> constantI (_.wrap type.long)))))) @@ -91,8 +91,8 @@ [ (operation@in (|>> _.I2D (_.wrap type.double)))]) ([-1.0 _.ICONST_M1] - ## [+0.0 _.ICONST_0] - ## [+1.0 _.ICONST_1] + ... [+0.0 _.ICONST_0] + ... [+1.0 _.ICONST_1] [+2.0 _.ICONST_2] [+3.0 _.ICONST_3] [+4.0 _.ICONST_4] diff --git a/lux-jvm/source/luxc/lang/translation/jvm/reference.lux b/lux-jvm/source/luxc/lang/translation/jvm/reference.lux index f23fb56a3..a62dc5eea 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/reference.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/reference.lux @@ -1,6 +1,6 @@ (.module: [library - [lux #* + [lux (#- local) [abstract [monad (#+ do)]] [data diff --git a/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux b/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux index 13c5fe074..4d97535d1 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux @@ -205,11 +205,11 @@ ::last? (variant_partI 1) ::value (variant_partI 2) - super_nested_tag (|>> _.SWAP ## variant::tag, tag + super_nested_tag (|>> _.SWAP ... variant::tag, tag _.ISUB) - super_nested (|>> super_nested_tag ## super_tag - $variant ::last? ## super_tag, super_last - $variant ::value ## super_tag, super_last, super_value + super_nested (|>> super_nested_tag ... super_tag + $variant ::last? ... super_tag, super_last + $variant ::value ... super_tag, super_last, super_value ..variantI) update_$tag _.ISUB @@ -223,28 +223,28 @@ (_.GOTO @loop)))) not_found _.NULL]) - (|>> $tag ## tag + (|>> $tag ... tag (_.label @loop) - $variant ::tag ## tag, variant::tag - _.DUP2 (_.IF_ICMPEQ @tags_match!) ## tag, variant::tag - _.DUP2 (_.IF_ICMPGT @maybe_nested) ## tag, variant::tag - $last? (_.IFNULL @mismatch!) ## tag, variant::tag - super_nested ## super_variant + $variant ::tag ... tag, variant::tag + _.DUP2 (_.IF_ICMPEQ @tags_match!) ... tag, variant::tag + _.DUP2 (_.IF_ICMPGT @maybe_nested) ... tag, variant::tag + $last? (_.IFNULL @mismatch!) ... tag, variant::tag + super_nested ... super_variant _.ARETURN - (_.label @tags_match!) ## tag, variant::tag - $last? ## tag, variant::tag, last? - $variant ::last? ## tag, variant::tag, last?, variant::last? - (_.IF_ACMPEQ @perfect_match!) ## tag, variant::tag - (_.label @maybe_nested) ## tag, variant::tag - $variant ::last? ## tag, variant::tag, variant::last? - (_.IFNULL @mismatch!) ## tag, variant::tag + (_.label @tags_match!) ... tag, variant::tag + $last? ... tag, variant::tag, last? + $variant ::last? ... tag, variant::tag, last?, variant::last? + (_.IF_ACMPEQ @perfect_match!) ... tag, variant::tag + (_.label @maybe_nested) ... tag, variant::tag + $variant ::last? ... tag, variant::tag, variant::last? + (_.IFNULL @mismatch!) ... tag, variant::tag (iterate! @loop) - (_.label @perfect_match!) ## tag, variant::tag - ## _.POP2 + (_.label @perfect_match!) ... tag, variant::tag + ... _.POP2 $variant ::value _.ARETURN - (_.label @mismatch!) ## tag, variant::tag - ## _.POP2 + (_.label @mismatch!) ... tag, variant::tag + ... _.POP2 not_found _.ARETURN))) ($d.method #$.Public $.staticM "tuple_left" (type.method [(list) (list //.$Tuple $Index) $Value (list)]) @@ -256,7 +256,7 @@ left_accessI _.ARETURN (_.label @recursive) - ## Recursive + ... Recursive (recurI @loop)))) ($d.method #$.Public $.staticM "tuple_right" (type.method [(list) (list //.$Tuple $Index) $Value (list)]) (<| _.with_label (function (_ @loop)) @@ -279,12 +279,12 @@ (|>> (_.label @loop) last_rightI right_indexI _.DUP2 (_.IF_ICMPNE @not_tail) - ## _.POP + ... _.POP right_accessI _.ARETURN (_.label @not_tail) (_.IF_ICMPGT @slice) - ## Must recurse + ... Must recurse (recurI @loop) (_.label @slice) sub_rightI @@ -322,11 +322,11 @@ _.ARETURN (_.label @to) (_.label @handler) - string_writerI ## TW - _.DUP2 ## TWTW - print_writerI ## TWTP - (_.INVOKEVIRTUAL $Throwable "printStackTrace" (type.method [(list) (list (type.class "java.io.PrintWriter" (list))) type.void (list)])) ## TW - (_.INVOKEVIRTUAL StringWriter "toString" (type.method [(list) (list) $Text (list)])) ## TS + string_writerI ... TW + _.DUP2 ... TWTW + print_writerI ... TWTP + (_.INVOKEVIRTUAL $Throwable "printStackTrace" (type.method [(list) (list (type.class "java.io.PrintWriter" (list))) type.void (list)])) ... TW + (_.INVOKEVIRTUAL StringWriter "toString" (type.method [(list) (list) $Text (list)])) ... TS _.SWAP _.POP leftI _.ARETURN))) ))) diff --git a/lux-jvm/source/luxc/lang/translation/jvm/structure.lux b/lux-jvm/source/luxc/lang/translation/jvm/structure.lux index 00a3539ca..ce9c56aed 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/structure.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/structure.lux @@ -92,7 +92,7 @@ (i.<= (java/lang/Short::MAX_VALUE) tag)) (_.SIPUSH tag) - ## else + ... else (_.int tag))))) (def: .public leftI _.NULL) diff --git a/lux-jvm/source/program.lux b/lux-jvm/source/program.lux index e5be7649c..e14cfbb27 100644 --- a/lux-jvm/source/program.lux +++ b/lux-jvm/source/program.lux @@ -46,15 +46,15 @@ [extension (#+ Phase Bundle Operation Handler Extender) ["." analysis #_ ["#" jvm]] - ## ["." generation #_ - ## ["#" jvm]] - ## ["." directive #_ - ## ["#" jvm]] + ... ["." generation #_ + ... ["#" jvm]] + ... ["." directive #_ + ... ["#" jvm]] ] [generation ["." jvm #_ ["#/." runtime] - ## ["#/." host] + ... ["#/." host] ]]]]]]]]] [program ["/" compositor @@ -227,25 +227,25 @@ apply_method))))))) (def: .public platform - ## (IO (Platform Anchor (Bytecode Any) Definition)) + ... (IO (Platform Anchor (Bytecode Any) Definition)) (IO [java/lang/ClassLoader (Platform _.Anchor _.Inst _.Definition)]) (do io.monad - [## host jvm/host.host + [... host jvm/host.host [loader host] jvm.host] (in [loader {#platform.&file_system (file.async file.default) #platform.host host - ## #platform.phase jvm.generate + ... #platform.phase jvm.generate #platform.phase expression.translate - ## #platform.runtime runtime.generate + ... #platform.runtime runtime.generate #platform.runtime runtime.translate #platform.phase_wrapper ..phase_wrapper #platform.write product.right}]))) (def: (extender phase_wrapper) (-> platform.Phase_Wrapper Extender) - ## TODO: Stop relying on coercions ASAP. + ... TODO: Stop relying on coercions ASAP. (<| (:as Extender) (function (@self handler)) (:as Handler) @@ -290,7 +290,7 @@ ..expander (analysis.bundle loader) (io.io platform) - ## generation.bundle + ... generation.bundle translation.bundle (|>> ..extender (directive.bundle loader)) (jvm/program.program jvm/runtime.class_name) diff --git a/lux-jvm/source/test/program.lux b/lux-jvm/source/test/program.lux index 270f9005d..46e2a2b71 100644 --- a/lux-jvm/source/test/program.lux +++ b/lux-jvm/source/test/program.lux @@ -13,6 +13,6 @@ (program: args (<| io.io _.run! - ## (_.times 100) + ... (_.times 100) (_.seed 1985013625126912890) (compositor.spec /.jvm /.bundle /.expander /.program))) diff --git a/lux-jvm/test/test/luxc/lang/analysis/host.jvm.lux b/lux-jvm/test/test/luxc/lang/analysis/host.jvm.lux index f9905c8bc..aad3955cf 100644 --- a/lux-jvm/test/test/luxc/lang/analysis/host.jvm.lux +++ b/lux-jvm/test/test/luxc/lang/analysis/host.jvm.lux @@ -35,7 +35,7 @@ [(def: ( procedure params output-type) (-> Text (List Code) Type Bit) (|> (do Monad - [## runtime-bytecode @runtime.translate + [... runtime-bytecode @runtime.translate ] (default.with-scope (typeA.with-type output-type @@ -56,7 +56,7 @@ [(def: ( syntax output-type) (-> Code Type Bit) (|> (do Monad - [## runtime-bytecode @runtime.translate + [... runtime-bytecode @runtime.translate ] (default.with-scope (typeA.with-type output-type -- cgit v1.2.3