(.module: [library [lux (#- Definition Type) [ffi (#+ import:)] [abstract monad] [control ["<>" parser ["<.>" code]]] [data [binary (#+ Binary)] [collection ["." list ("#/." functor)]]] [macro ["." code] [syntax (#+ syntax:)]] [target [jvm ["." type (#+ Type) [category (#+ Class)]]]] [tool [compiler [reference [variable (#+ Register)]] [language [lux ["." generation]]] [meta [archive (#+ Archive)]]]]]]) (import: org/objectweb/asm/MethodVisitor) (import: org/objectweb/asm/ClassWriter) (import: org/objectweb/asm/Label ["#::." (new [])]) (type: #export Def (-> org/objectweb/asm/ClassWriter org/objectweb/asm/ClassWriter)) (type: #export Inst (-> org/objectweb/asm/MethodVisitor org/objectweb/asm/MethodVisitor)) (type: #export Label org/objectweb/asm/Label) (type: #export Visibility #Public #Protected #Private #Default) (type: #export Version #V1_1 #V1_2 #V1_3 #V1_4 #V1_5 #V1_6 #V1_7 #V1_8) (type: #export ByteCode Binary) (type: #export Definition [Text ByteCode]) (type: #export Anchor [Label Register]) (type: #export Host (generation.Host Inst Definition)) (template [ ] [(type: #export ( ..Anchor ..Inst ..Definition))] [State generation.State] [Operation generation.Operation] [Phase generation.Phase] [Handler generation.Handler] [Bundle generation.Bundle] [Extender generation.Extender] ) (type: #export (Generator i) (-> Phase Archive i (Operation Inst))) (syntax: (config: {type .local_identifier} {none .local_identifier} {++ .local_identifier} {options (.tuple (<>.many .local_identifier))}) (let [g!type (code.local_identifier type) g!none (code.local_identifier none) g!tags+ (list/map code.local_tag options) g!_left (code.local_identifier "_left") g!_right (code.local_identifier "_right") g!options+ (list/map (function (_ option) (` (def: (~' #export) (~ (code.local_identifier option)) (~ g!type) (|> (~ g!none) (set@ (~ (code.local_tag option)) #1))))) options)] (in (list& (` (type: (~' #export) (~ g!type) (~ (code.record (list/map (function (_ tag) [tag (` .Bit)]) g!tags+))))) (` (def: (~' #export) (~ g!none) (~ g!type) (~ (code.record (list/map (function (_ tag) [tag (` #0)]) g!tags+))))) (` (def: (~' #export) ((~ (code.local_identifier ++)) (~ g!_left) (~ g!_right)) (-> (~ g!type) (~ g!type) (~ g!type)) (~ (code.record (list/map (function (_ tag) [tag (` (or (get@ (~ tag) (~ g!_left)) (get@ (~ tag) (~ g!_right))))]) g!tags+))))) g!options+)))) (config: Class_Config noneC ++C [finalC]) (config: Method_Config noneM ++M [finalM staticM synchronizedM strictM]) (config: Field_Config noneF ++F [finalF staticF transientF volatileF]) (def: #export new_label (-> Any Label) (function (_ _) (org/objectweb/asm/Label::new))) (def: #export (simple_class name) (-> Text (Type Class)) (type.class name (list)))