diff options
author | Eduardo Julian | 2019-06-20 02:22:09 -0400 |
---|---|---|
committer | Eduardo Julian | 2019-06-20 02:22:09 -0400 |
commit | b9f13c4f981c34f1e8bc0096b024d0f8d6699c44 (patch) | |
tree | 8cf31bb2ec7fcfa48d76301d01c4881cb487794f /stdlib/source/lux/target/jvm/field.lux | |
parent | 34c2eff22a81db42fe94becb0c07f8ac62834274 (diff) |
Improved the design of modifiers.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/target/jvm/field.lux | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/stdlib/source/lux/target/jvm/field.lux b/stdlib/source/lux/target/jvm/field.lux index 2e0082fe2..062b38ac6 100644 --- a/stdlib/source/lux/target/jvm/field.lux +++ b/stdlib/source/lux/target/jvm/field.lux @@ -18,14 +18,20 @@ [abstract (#+)]]] ["." // #_ [encoding (#+)] - [modifier (#+ modifiers:)] + ["." modifier (#+ Modifier modifiers:)] ["#." constant (#+ UTF8) ["#/." pool (#+ Pool)]] ["#." index (#+ Index)] ["#." attribute (#+ Attribute)] ["#." descriptor (#+ Descriptor Value)]]) -(modifiers: +(type: #export #rec Field + {#modifier (Modifier Field) + #name (Index UTF8) + #descriptor (Index (Descriptor (Value Any))) + #attributes (Row Attribute)}) + +(modifiers: Field ["0001" public] ["0002" private] ["0004" protected] @@ -37,16 +43,10 @@ ["4000" enum] ) -(type: #export Field - {#modifier Modifier - #name (Index UTF8) - #descriptor (Index (Descriptor (Value Any))) - #attributes (Row Attribute)}) - (def: #export equivalence (Equivalence Field) ($_ equivalence.product - ..modifier-equivalence + modifier.equivalence //index.equivalence //index.equivalence (row.equivalence //attribute.equivalence))) @@ -54,7 +54,7 @@ (def: #export (reader pool) (-> Pool (Reader Field)) ($_ <>.and - (get@ #binaryF.reader ..modifier-format) + (get@ #binaryF.reader modifier.format) (get@ #binaryF.reader //index.format) (get@ #binaryF.reader //index.format) (get@ #binaryF.reader @@ -72,14 +72,14 @@ (~~ (template [<format> <slot>] [((get@ #binaryF.writer <format>) (get@ <slot> field))] - [..modifier-format #modifier] + [modifier.format #modifier] [//index.format #name] [//index.format #descriptor] [(binaryF.row/16 attribute-format) #attributes])) )))) (def: #export (field modifier name descriptor attributes) - (-> Modifier UTF8 (Descriptor (Value Any)) (Row Attribute) + (-> (Modifier Field) UTF8 (Descriptor (Value Any)) (Row Attribute) (State Pool Field)) (do state.monad [@name (//constant/pool.utf8 name) |