diff options
Diffstat (limited to 'stdlib/source/lux/target/jvm/attribute.lux')
-rw-r--r-- | stdlib/source/lux/target/jvm/attribute.lux | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/stdlib/source/lux/target/jvm/attribute.lux b/stdlib/source/lux/target/jvm/attribute.lux index 5f8892631..083ebaa15 100644 --- a/stdlib/source/lux/target/jvm/attribute.lux +++ b/stdlib/source/lux/target/jvm/attribute.lux @@ -49,7 +49,7 @@ (with-expansions [<Code> (as-is (/code.Code Attribute))] (type: #export #rec Attribute - (#Constant (Info Constant)) + (#Constant (Info (Constant Any))) (#Code (Info <Code>))) (type: #export Code @@ -64,7 +64,7 @@ (info-equivalence /constant.equivalence) (info-equivalence (/code.equivalence equivalence)))))) -(def: fixed-attribute-length +(def: common-attribute-length ($_ n.+ ## u2 attribute_name_index; //unsigned.bytes/2 @@ -77,25 +77,23 @@ (case attribute (^template [<tag>] (<tag> [name length info]) - (|> length //unsigned.value (n.+ fixed-attribute-length))) + (|> length //unsigned.value (n.+ ..common-attribute-length))) ([#Constant] [#Code]))) -(def: constant-name "ConstantValue") - +## TODO: Inline ASAP (def: (constant' @name index) - (-> (Index UTF8) Constant Attribute) + (-> (Index UTF8) (Constant Any) Attribute) (#Constant {#name @name #length (|> /constant.length //unsigned.u4 try.assume) #info index})) (def: #export (constant index) - (-> Constant (Resource Attribute)) + (-> (Constant Any) (Resource Attribute)) (do //constant/pool.monad - [@name (//constant/pool.utf8 ..constant-name)] + [@name (//constant/pool.utf8 "ConstantValue")] (wrap (constant' @name index)))) -(def: code-name "Code") - +## TODO: Inline ASAP (def: (code' @name specification) (-> (Index UTF8) Code Attribute) (#Code {#name @name @@ -109,7 +107,7 @@ (def: #export (code specification) (-> Code (Resource Attribute)) (do //constant/pool.monad - [@name (//constant/pool.utf8 ..code-name)] + [@name (//constant/pool.utf8 "Code")] (wrap (code' @name specification)))) (def: #export (writer value) |