diff options
Diffstat (limited to 'stdlib/source/lux/host/jvm/modifier.lux')
-rw-r--r-- | stdlib/source/lux/host/jvm/modifier.lux | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/stdlib/source/lux/host/jvm/modifier.lux b/stdlib/source/lux/host/jvm/modifier.lux index 5c9280164..0263fc1ec 100644 --- a/stdlib/source/lux/host/jvm/modifier.lux +++ b/stdlib/source/lux/host/jvm/modifier.lux @@ -34,41 +34,42 @@ (syntax: #export (modifiers: {options (parser.many ..modifier)}) (with-gensyms [g!parameter g!subject g!<name> g!<code>] - (let [nameC (' Modifier) - combineC (' combine) - emptyC (' empty) - typeC (` (abstract.abstract: (~' #export) (~ nameC) + (let [g!name (' Modifier) + g!combine (' combine) + g!empty (' empty) + g!format (' modifier-format) + typeC (` (abstract.abstract: (~' #export) (~ g!name) {} //encoding.U2 (.def: (~' #export) (~' code) - (.-> (~ nameC) //encoding.U2) + (.-> (~ g!name) //encoding.U2) (.|>> (~' :representation))) - (.def: (~' #export) ((~ combineC) (~ g!parameter) (~ g!subject)) - (.-> (~ nameC) (~ nameC) (~ nameC)) + (.def: (~' #export) ((~ g!combine) (~ g!parameter) (~ g!subject)) + (.-> (~ g!name) (~ g!name) (~ g!name)) ((~' :abstraction) (//encoding.to-u2 (i64.and (//encoding.from-u2 ((~' :representation) (~ g!parameter))) (//encoding.from-u2 ((~' :representation) (~ g!subject))))))) (.do-template [(~ g!<code>) (~ g!<name>)] [(.def: (~' #export) (~ g!<name>) - (~ nameC) + (~ g!name) (.|> (number.hex (~ g!<code>)) //encoding.to-u2 (~' :abstraction)))] - ["0000" (~ emptyC)] + ["0000" (~ g!empty)] (~+ (list/map ..code options)) ) - (.def: (~' #export) (~' format) - (binary.Format (~ nameC)) + (.def: (~' #export) (~ g!format) + (binary.Format (~ g!name)) (.let [(.^open "_/.") //encoding.u2-format] {#binary.reader (|> (~' _/reader) (:: parser.Functor<Parser> (~' map) (|>> (~' :abstraction)))) #binary.writer (|>> (~' :representation) (~' _/writer))})))) - monoidC (` (.structure: (~' #export) (~' _) (monoid.Monoid (~ nameC)) - (.def: (~' identity) (~ emptyC)) - (.def: (~' compose) (~ combineC))))] + monoidC (` (.structure: (~' #export) (~' _) (monoid.Monoid (~ g!name)) + (.def: (~' identity) (~ g!empty)) + (.def: (~' compose) (~ g!combine))))] (wrap (list typeC monoidC))))) |