diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/meta/target/jvm/attribute.lux | 43 |
1 files changed, 35 insertions, 8 deletions
diff --git a/stdlib/source/library/lux/meta/target/jvm/attribute.lux b/stdlib/source/library/lux/meta/target/jvm/attribute.lux index f3410723a..04d68cb41 100644 --- a/stdlib/source/library/lux/meta/target/jvm/attribute.lux +++ b/stdlib/source/library/lux/meta/target/jvm/attribute.lux @@ -27,7 +27,8 @@ ["[2][0]" pool (.only Pool Resource) (.use "[1]#[0]" monad)]]] ["[0]" / ["[1][0]" constant (.only Constant)] - ["[1][0]" code]]) + ["[1][0]" code] + ["[1][0]" line_number_table (.only Line_Number_Table)]]) (type .public (Info about) (Record @@ -62,7 +63,8 @@ {#Constant (Info (Constant Any))} {#Code (Info <Code>)} {#Signature (Info (Index UTF8))} - {#Source_File (Info (Index UTF8))}))) + {#Source_File (Info (Index UTF8))} + {#Line_Number_Table (Info Line_Number_Table)}))) (type .public Code <Code>) @@ -77,6 +79,7 @@ (info_equivalence (/code.equivalence equivalence)) (info_equivalence //index.equivalence) (info_equivalence //index.equivalence) + (info_equivalence /line_number_table.equivalence) )))) (def common_attribute_length @@ -96,7 +99,8 @@ ([#Constant] [#Code] [#Signature] - [#Source_File]))) + [#Source_File] + [#Line_Number_Table]))) ... TODO: Inline ASAP (def (constant' index @name) @@ -136,9 +140,10 @@ (def .public (signature it) (All (_ category) (-> (Signature category) (Resource Attribute))) - (do [! //pool.monad] + (do //pool.monad [it (|> it //signature.signature //pool.utf8)] - (at ! each (signature' it) (//pool.utf8 "Signature")))) + (//pool#each (signature' it) + (//pool.utf8 "Signature")))) ... TODO: Inline ASAP (def (source_file' it @name) @@ -152,9 +157,28 @@ (def .public (source_file it) (-> Text (Resource Attribute)) - (do [! //pool.monad] + (do //pool.monad [it (//pool.utf8 it)] - (at ! each (source_file' it) (//pool.utf8 "SourceFile")))) + (//pool#each (source_file' it) + (//pool.utf8 "SourceFile")))) + +... TODO: Inline ASAP +(def (line_number_table' it @name) + (-> Line_Number_Table (Index UTF8) + Attribute) + {#Line_Number_Table [#name @name + ... https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.7.12 + #length (|> it + /line_number_table.length + //unsigned.u4 + try.trusted) + #info it]}) + +(def .public (line_number_table it) + (-> Line_Number_Table + (Resource Attribute)) + (//pool#each (line_number_table' it) + (//pool.utf8 "LineNumberTable"))) (def .public (format it) (Format Attribute) @@ -169,4 +193,7 @@ ((info_format //index.format) it) {#Source_File it} - ((info_format //index.format) it))) + ((info_format //index.format) it) + + {#Line_Number_Table it} + ((info_format /line_number_table.format) it))) |