diff --git a/third_party/move/move-compiler/src/parser/ast.rs b/third_party/move/move-compiler/src/parser/ast.rs index 12daf5172746c0..8bba74f9206cc0 100644 --- a/third_party/move/move-compiler/src/parser/ast.rs +++ b/third_party/move/move-compiler/src/parser/ast.rs @@ -249,10 +249,15 @@ pub type AccessSpecifier = Spanned; /// An address specifier specifies the address at which a resource is accessed. #[derive(Debug, Clone, PartialEq)] pub enum AddressSpecifier_ { + /// Represents that now address was specicied, as in `Resource` Empty, + /// Represents that the specified address is a wildcard, as in `Resource(*)`. Any, + /// Represents the precise address. Literal(NumericalAddress), + /// Represents a parameter name. Name(Name), + /// Represents a function applied to a parameter name. Call(NameAccessChain, Option>, Name), } @@ -281,10 +286,6 @@ pub enum FunctionBody_ { pub type FunctionBody = Spanned; #[derive(PartialEq, Debug, Clone)] -// (public?) foo(x1: t1, ..., xn: tn): t1 * ... * tn { -// body -// } -// (public?) native foo(x1: t1, ..., xn: tn): t1 * ... * tn; pub struct Function { pub attributes: Vec, pub loc: Loc, diff --git a/third_party/move/move-model/src/builder/module_builder.rs b/third_party/move/move-model/src/builder/module_builder.rs index b436200ec937a4..3d1879de4a294c 100644 --- a/third_party/move/move-model/src/builder/module_builder.rs +++ b/third_party/move/move-model/src/builder/module_builder.rs @@ -79,7 +79,7 @@ pub(crate) struct ModuleBuilder<'env, 'translator> { /// Translated function definitions, if we are compiling Move code pub fun_defs: BTreeMap, /// Translated access specifiers, if we are compiling Move code - pub access_specifiers: BTreeMap>, + pub fun_access_specifiers: BTreeMap>, /// Translated struct specifications. pub struct_specs: BTreeMap, /// Translated module spec @@ -154,7 +154,7 @@ impl<'env, 'translator> ModuleBuilder<'env, 'translator> { spec_vars: vec![], fun_specs: BTreeMap::new(), fun_defs: BTreeMap::new(), - access_specifiers: BTreeMap::new(), + fun_access_specifiers: BTreeMap::new(), struct_specs: BTreeMap::new(), module_spec: Spec::default(), spec_block_infos: Default::default(), @@ -1270,7 +1270,7 @@ impl<'env, 'translator> ModuleBuilder<'env, 'translator> { .is_none()); if let Some(specifiers) = access_specifiers { assert!(self - .access_specifiers + .fun_access_specifiers .insert(full_name.symbol, specifiers) .is_none()); } @@ -3600,7 +3600,7 @@ impl<'env, 'translator> ModuleBuilder<'env, 'translator> { // New function let spec = self.fun_specs.remove(&name.symbol).unwrap_or_default(); let def = self.fun_defs.remove(&name.symbol); - let access_specifiers = self.access_specifiers.remove(&name.symbol); + let access_specifiers = self.fun_access_specifiers.remove(&name.symbol); let data = FunctionData { name: name.symbol, loc: entry.loc.clone(),