classfile,passes,jar: model PermittedSubclasses, normalize interface flags, name class in write errors
This commit is contained in:
parent
e9d5e44b9e
commit
9a33cef9b1
11 changed files with 299 additions and 85 deletions
|
|
@ -46,7 +46,13 @@ pub fn save(program: &Program) -> Result<Vec<Entry>, JarError> {
|
|||
|
||||
for class in &program.classes {
|
||||
let name = format!("{}.class", class.this_class);
|
||||
entries.push(Entry::new(name, format::write(class)?));
|
||||
let bytes = format::write(class).map_err(|error| {
|
||||
JarError::Classfile(noxis_classfile::ClassfileError::Write(format!(
|
||||
"{}: {error}",
|
||||
class.this_class
|
||||
)))
|
||||
})?;
|
||||
entries.push(Entry::new(name, bytes));
|
||||
}
|
||||
for resource in &program.resources {
|
||||
entries.push(Entry::new(resource.path.clone(), resource.data.clone()));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue