improve byte_array parsing

This commit is contained in:
vms 2020-07-17 10:55:35 +03:00
parent bb9e4dbdfc
commit b65b34b0f6
2 changed files with 13 additions and 1 deletions

View File

@ -325,6 +325,18 @@ impl<'a> Parse<'a> for Instruction {
parser.parse::<keyword::string_size>()?;
Ok(Instruction::StringSize)
} else if lookahead.peek::<keyword::byte_array_lift_memory>() {
parser.parse::<keyword::byte_array_lift_memory>()?;
Ok(Instruction::ByteArrayLiftMemory)
} else if lookahead.peek::<keyword::byte_array_lower_memory>() {
parser.parse::<keyword::byte_array_lower_memory>()?;
Ok(Instruction::ByteArrayLowerMemory)
} else if lookahead.peek::<keyword::byte_array_size>() {
parser.parse::<keyword::byte_array_size>()?;
Ok(Instruction::ByteArraySize)
} else if lookahead.peek::<keyword::record_lift>() {
parser.parse::<keyword::record_lift>()?;

View File

@ -73,7 +73,7 @@ impl ToString for &InterfaceType {
InterfaceType::F32 => "f32".to_string(),
InterfaceType::F64 => "f64".to_string(),
InterfaceType::String => "string".to_string(),
InterfaceType::ByteArray => "byteArray".to_string(),
InterfaceType::ByteArray => "byte_array".to_string(),
InterfaceType::Anyref => "anyref".to_string(),
InterfaceType::I32 => "i32".to_string(),
InterfaceType::I64 => "i64".to_string(),