mirror of
https://github.com/fluencelabs/parity-wasm
synced 2025-05-30 16:11:41 +00:00
additional module info
This commit is contained in:
parent
56351f8155
commit
f9832b046b
@ -15,23 +15,25 @@ fn main() {
|
|||||||
println!("Module sections: {}", module.sections().len());
|
println!("Module sections: {}", module.sections().len());
|
||||||
|
|
||||||
for section in module.sections() {
|
for section in module.sections() {
|
||||||
match section {
|
match *section {
|
||||||
&Section::Import(ref import_section) => {
|
Section::Import(ref import_section) => {
|
||||||
println!(" Imports: {}", import_section.entries().len());
|
println!(" Imports: {}", import_section.entries().len());
|
||||||
|
import_section.entries().iter().map(|e| println!(" {}.{}", e.module(), e.field())).count();
|
||||||
},
|
},
|
||||||
&Section::Export(ref exports_section) => {
|
Section::Export(ref exports_section) => {
|
||||||
println!(" Exports: {}", exports_section.entries().len());
|
println!(" Exports: {}", exports_section.entries().len());
|
||||||
|
exports_section.entries().iter().map(|e| println!(" {}", e.field())).count();
|
||||||
},
|
},
|
||||||
&Section::Function(ref function_section) => {
|
Section::Function(ref function_section) => {
|
||||||
println!(" Functions: {}", function_section.entries().len());
|
println!(" Functions: {}", function_section.entries().len());
|
||||||
},
|
},
|
||||||
&Section::Type(ref type_section) => {
|
Section::Type(ref type_section) => {
|
||||||
println!(" Types: {}", type_section.types().len());
|
println!(" Types: {}", type_section.types().len());
|
||||||
},
|
},
|
||||||
&Section::Global(ref globals_section) => {
|
Section::Global(ref globals_section) => {
|
||||||
println!(" Globals: {}", globals_section.entries().len());
|
println!(" Globals: {}", globals_section.entries().len());
|
||||||
},
|
},
|
||||||
&Section::Data(ref data_section) if data_section.entries().len() > 0 => {
|
Section::Data(ref data_section) if data_section.entries().len() > 0 => {
|
||||||
let data = &data_section.entries()[0];
|
let data = &data_section.entries()[0];
|
||||||
println!(" Data size: {}", data.value().len());
|
println!(" Data size: {}", data.value().len());
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user