all opcodes

This commit is contained in:
NikVolf
2017-03-31 05:22:49 +03:00
parent 210d9f4f02
commit 5b93ee2236
4 changed files with 321 additions and 4 deletions

View File

@ -231,6 +231,11 @@ pub struct Local {
value_type: ValueType,
}
impl Local {
pub fn count(&self) -> u32 { self.count }
pub fn value_type(&self) -> ValueType { self.value_type }
}
impl Deserialize for Local {
type Error = Error;
@ -246,6 +251,11 @@ pub struct FunctionBody {
opcodes: Opcodes,
}
impl FunctionBody {
pub fn locals(&self) -> &[Local] { &self.locals }
pub fn code(&self) -> &Opcodes { &self.opcodes }
}
impl Deserialize for FunctionBody {
type Error = Error;