From 257bea66cb71ecdb9f85b5c656411d7d8685dd61 Mon Sep 17 00:00:00 2001 From: Wolfgang Grieskamp Date: Thu, 26 Oct 2023 09:33:22 -0700 Subject: [PATCH] Addressing reviewer comments #4 --- third_party/move/move-binary-format/src/deserializer.rs | 4 ++-- third_party/move/move-binary-format/src/file_format.rs | 4 ++-- third_party/move/move-compiler/src/parser/syntax.rs | 8 ++------ 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/third_party/move/move-binary-format/src/deserializer.rs b/third_party/move/move-binary-format/src/deserializer.rs index 161fb37bb11e52..c83393eb838e67 100644 --- a/third_party/move/move-binary-format/src/deserializer.rs +++ b/third_party/move/move-binary-format/src/deserializer.rs @@ -1746,8 +1746,8 @@ impl SerializedType { #[repr(u8)] #[derive(Clone, Copy, Debug)] pub enum DeprecatedNominalResourceFlag { - NOMINAL_RESOURCE = 0x1, - NORMAL_STRUCT = 0x2, + NOMINAL_RESOURCE = 0x1, + NORMAL_STRUCT = 0x2, } impl DeprecatedNominalResourceFlag { diff --git a/third_party/move/move-binary-format/src/file_format.rs b/third_party/move/move-binary-format/src/file_format.rs index 60b99164e9e548..aaf3f335fab6b6 100644 --- a/third_party/move/move-binary-format/src/file_format.rs +++ b/third_party/move/move-binary-format/src/file_format.rs @@ -882,7 +882,7 @@ pub struct AccessSpecifier { pub negated: bool, /// The resource specifier. pub resource: ResourceSpecifier, - /// The address where the resource is stored. Other fields can have wildcards. + /// The address where the resource is stored. pub address: AddressSpecifier, } @@ -907,7 +907,7 @@ impl AccessKind { } } - /// Tries to join two kinds, returns None of no intersection. + /// Tries to join two kinds, returns None if no intersection. pub fn try_join(self, other: Self) -> Option { use AccessKind::*; match (self, other) { diff --git a/third_party/move/move-compiler/src/parser/syntax.rs b/third_party/move/move-compiler/src/parser/syntax.rs index 7b3c613030e836..7b1a9ce9d9d24b 100644 --- a/third_party/move/move-compiler/src/parser/syntax.rs +++ b/third_party/move/move-compiler/src/parser/syntax.rs @@ -328,12 +328,8 @@ fn parse_leading_name_access_<'a, F: FnOnce() -> &'a str>( Ok(sp(loc, LeadingNameAccess_::Name(n))) }, Tok::Star if allow_wildcard => { - let loc = current_token_loc(context.tokens); - context.tokens.advance()?; - Ok(sp( - loc, - LeadingNameAccess_::Name(Name::new(loc, Symbol::from("*"))), - )) + let name = advance_wildcard_name(context)?; + Ok(sp(name.loc, LeadingNameAccess_::Name(name))) }, Tok::NumValue => { let sp!(loc, addr) = parse_address_bytes(context)?;