diff --git a/src/simplified_representation/emitter.rs b/src/simplified_representation/emitter.rs index bec032f..7982f3f 100644 --- a/src/simplified_representation/emitter.rs +++ b/src/simplified_representation/emitter.rs @@ -131,9 +131,16 @@ impl AstConverting for SrEmitter { fn emit_meta_identifier( &mut self, _mode: TreeTraversalMode, - _node: &NodeMetaIdentifier, + node: &NodeMetaIdentifier, ) -> Result { - Ok(TraversalResult::Continue) + match node { + NodeMetaIdentifier::ByteString => { + let symbol = SrIdentifier::new("ByStr".to_string(), SrIdentifierKind::Unknown); + self.stack.push(StackObject::IrIdentifier(symbol)); + Ok(TraversalResult::SkipChildren) + } + _ => Ok(TraversalResult::Continue), + } } fn emit_variable_identifier( &mut self, diff --git a/src/type.rs b/src/type.rs index f4a556a..79d2f6d 100644 --- a/src/type.rs +++ b/src/type.rs @@ -85,7 +85,6 @@ impl From for Type { "Uint256" => Type::Uint256, "String" => Type::String, "ByStr" => Type::ByStr, - "ByStrX" => todo!(), "BNum" => Type::BNum, "Bool" => Type::Bool, // TODO: Remove unwrap diff --git a/tests/contracts/ByStr.scilla b/tests/contracts/ByStr.scilla index c07c2e2..f98c0e0 100644 --- a/tests/contracts/ByStr.scilla +++ b/tests/contracts/ByStr.scilla @@ -2,6 +2,7 @@ scilla_version 0 contract AllByStrVariants ( + bystr : ByStr, bystr32 : ByStr32, raw_address: ByStr20, library_address : ByStr20 with library end, diff --git a/tests/full_contract_tests.rs b/tests/full_contract_tests.rs index 3ed4511..41ecffe 100644 --- a/tests/full_contract_tests.rs +++ b/tests/full_contract_tests.rs @@ -26,6 +26,7 @@ fn test_bystr_contract_parse() { Contract { name: "AllByStrVariants".to_string(), init_params: FieldList(vec![ + Field::new("bystr", Type::ByStr), Field::new("bystr32", Type::ByStrX(32)), Field::new("raw_address", Type::ByStr20), Field::new(