diff --git a/assembly/src/assembler/context.rs b/assembly/src/assembler/context.rs index ce86923e41..aa828afbe2 100644 --- a/assembly/src/assembler/context.rs +++ b/assembly/src/assembler/context.rs @@ -265,11 +265,12 @@ impl ProcedureContext { self.visibility.is_syscall() } - pub fn into_procedure(self, code: MastNodeId) -> Box { - let procedure = Procedure::new(self.name, self.visibility, self.num_locals as u32, code) - .with_span(self.span) - .with_source_file(self.source_file) - .with_callset(self.callset); + pub fn into_procedure(self, body_node_id: MastNodeId) -> Box { + let procedure = + Procedure::new(self.name, self.visibility, self.num_locals as u32, body_node_id) + .with_span(self.span) + .with_source_file(self.source_file) + .with_callset(self.callset); Box::new(procedure) } } diff --git a/assembly/src/assembler/mod.rs b/assembly/src/assembler/mod.rs index 6a6015a8fd..0ca2709e3f 100644 --- a/assembly/src/assembler/mod.rs +++ b/assembly/src/assembler/mod.rs @@ -568,7 +568,7 @@ impl Assembler { } }); - let proc_code_node = &mast_forest[proc.code()]; + let proc_code_node = &mast_forest[proc.body_node_id()]; exports.push(proc_code_node.digest()); } @@ -592,7 +592,7 @@ impl Assembler { // Compile the module graph rooted at the entrypoint let entry_procedure = self.compile_subgraph(entrypoint, true, context, mast_forest)?; - mast_forest.set_entrypoint(entry_procedure.code()); + mast_forest.set_entrypoint(entry_procedure.body_node_id()); Ok(()) } diff --git a/assembly/src/assembler/procedure.rs b/assembly/src/assembler/procedure.rs index 80c4505f35..88224396da 100644 --- a/assembly/src/assembler/procedure.rs +++ b/assembly/src/assembler/procedure.rs @@ -29,7 +29,7 @@ pub struct Procedure { visibility: Visibility, num_locals: u32, /// The MAST node id for the root of this procedure - code: MastNodeId, + body_node_id: MastNodeId, /// The set of MAST roots called by this procedure callset: CallSet, } @@ -40,7 +40,7 @@ impl Procedure { path: FullyQualifiedProcedureName, visibility: Visibility, num_locals: u32, - code: MastNodeId, + body_node_id: MastNodeId, ) -> Self { Self { span: SourceSpan::default(), @@ -48,7 +48,7 @@ impl Procedure { path, visibility, num_locals, - code, + body_node_id, callset: Default::default(), } } @@ -104,13 +104,13 @@ impl Procedure { /// Returns the root of this procedure's MAST. pub fn mast_root(&self, mast_forest: &MastForest) -> RpoDigest { - let code_node = &mast_forest[self.code]; - code_node.digest() + let body_node = &mast_forest[self.body_node_id]; + body_node.digest() } /// Returns a reference to the MAST node ID of this procedure. - pub fn code(&self) -> MastNodeId { - self.code + pub fn body_node_id(&self) -> MastNodeId { + self.body_node_id } /// Returns a reference to a set of all procedures (identified by their MAST roots) which may diff --git a/core/src/mast/mod.rs b/core/src/mast/mod.rs index 5a4efba65e..daf789efa9 100644 --- a/core/src/mast/mod.rs +++ b/core/src/mast/mod.rs @@ -46,8 +46,8 @@ pub struct MastForest { /// The "entrypoint", when set, is the root of the entire forest, i.e. a path exists from this /// node to all other roots in the forest. This corresponds to the executable entry point. - /// Whether or not the entrypoint is set distinguishes a MAST which is executable, versus a MAST - /// which represents a library. + /// Whether or not the entrypoint is set distinguishes a MAST which is executable, versus a + /// MAST which represents a library. entrypoint: Option, kernel: Kernel, }