classfile,passes: model runtime-visible annotations, rewrite their descriptors
This commit is contained in:
parent
4b14eeb40f
commit
48a5bc23a9
13 changed files with 527 additions and 4 deletions
|
|
@ -8,6 +8,7 @@ use ristretto_classfile::attributes::{
|
|||
LocalVariableTypeTable as RtLocalType, Record as RtRecord,
|
||||
};
|
||||
|
||||
use super::annotations::annotation;
|
||||
use super::helpers;
|
||||
use super::pool::Pool;
|
||||
use crate::error::ClassfileError;
|
||||
|
|
@ -178,6 +179,20 @@ pub(super) fn convert(attr: &Attribute, pool: &mut Pool) -> Result<RtAttr, Class
|
|||
.map(|param| helpers::method_param(param, pool))
|
||||
.collect::<Result<_, _>>()?,
|
||||
},
|
||||
Attribute::RuntimeVisibleAnnotations(annos) => RtAttr::RuntimeVisibleAnnotations {
|
||||
name_index: pool.utf8("RuntimeVisibleAnnotations")?,
|
||||
annotations: annos
|
||||
.iter()
|
||||
.map(|anno| annotation(anno, pool))
|
||||
.collect::<Result<_, _>>()?,
|
||||
},
|
||||
Attribute::RuntimeInvisibleAnnotations(annos) => RtAttr::RuntimeInvisibleAnnotations {
|
||||
name_index: pool.utf8("RuntimeInvisibleAnnotations")?,
|
||||
annotations: annos
|
||||
.iter()
|
||||
.map(|anno| annotation(anno, pool))
|
||||
.collect::<Result<_, _>>()?,
|
||||
},
|
||||
Attribute::Raw { name, data } => RtAttr::Unknown {
|
||||
name_index: pool.utf8(name)?,
|
||||
info: data.clone(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue