diff options
Diffstat (limited to 'stdlib/source/lux/target/jvm/attribute/code.lux')
-rw-r--r-- | stdlib/source/lux/target/jvm/attribute/code.lux | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/stdlib/source/lux/target/jvm/attribute/code.lux b/stdlib/source/lux/target/jvm/attribute/code.lux index a52d32538..de7ce719a 100644 --- a/stdlib/source/lux/target/jvm/attribute/code.lux +++ b/stdlib/source/lux/target/jvm/attribute/code.lux @@ -4,11 +4,12 @@ [abstract ["." equivalence (#+ Equivalence)]] [control - ["<>" parser]] + ["<>" parser + ["<2>" binary (#+ Parser)]]] [data ["." binary (#+ Binary)] [format - [".F" binary (#+ Reader Writer) ("#@." monoid)]] + [".F" binary (#+ Writer) ("#@." monoid)]] [collection ["." row (#+ Row) ("#@." functor fold)]]]] ["." /// #_ @@ -63,7 +64,7 @@ ## https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.3 (def: #export (reader reader) - (All [Attribute] (-> (Reader Attribute) (Reader (Code Attribute)))) + (All [Attribute] (-> (Parser Attribute) (Parser (Code Attribute)))) (let [u2-reader (get@ #binaryF.reader ///unsigned.u2-format)] ($_ <>.and @@ -73,19 +74,14 @@ u2-reader ## u4 code_length; ## u1 code[code_length]; - (get@ #binaryF.reader - binaryF.binary/32) + <2>.binary/32 ## u2 exception_table_length; ## exception_table[exception_table_length]; - (get@ #binaryF.reader - (binaryF.row/16 /exception.format)) + (<2>.row/16 (get@ #binaryF.reader + /exception.format)) ## u2 attributes_count; ## attribute_info attributes[attributes_count]; - (get@ #binaryF.reader - (binaryF.row/16 {#binaryF.reader reader - ## TODO: Get rid of this dirty hack ASAP - #binaryF.writer (function (_ _value) - binaryF.no-op)})) + (<2>.row/16 reader) ))) (def: #export (writer writer code) @@ -111,7 +107,7 @@ #binaryF.reader (:share [Attribute] {(Writer Attribute) writer} - {(Reader Attribute) + {(Parser Attribute) (<>.fail "")}) #binaryF.writer writer})) (get@ #attributes code)) |