From 5b8a7fe05e15f9a3f6d018a64c03fd1f4a4941a4 Mon Sep 17 00:00:00 2001 From: Ryan Jones-Ward Date: Wed, 17 Jul 2024 15:45:23 +0100 Subject: [PATCH] Update properties to better reflect their purposes. --- redox-core/src/compiling/compiler.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/redox-core/src/compiling/compiler.rs b/redox-core/src/compiling/compiler.rs index fd7e562..29654f2 100644 --- a/redox-core/src/compiling/compiler.rs +++ b/redox-core/src/compiling/compiler.rs @@ -13,7 +13,7 @@ pub struct Compiler { /// A vector containing the compiled bytecode. bytes: Vec, - local_labels: Vec, + code_labels: Vec, data_labels: Vec, global_labels: Vec, label_positions: HashMap, @@ -23,7 +23,7 @@ impl Compiler { pub fn new() -> Self { Self { bytes: Vec::new(), - local_labels: Vec::new(), + code_labels: Vec::new(), data_labels: Vec::new(), global_labels: Vec::new(), label_positions: HashMap::new(), @@ -139,7 +139,7 @@ impl Compiler { /// * `instructions` - A slice of [`Instruction`]s that correspond to the instructions to be compiled. #[inline] fn load_code_labels(&mut self, instructions: &[Instruction]) { - self.local_labels = instructions + self.code_labels = instructions .iter() .filter_map(|i| { if let Instruction::Label(l) = i { @@ -164,7 +164,7 @@ impl Compiler { // If a label is specified that doesn't exist then that is a syntax error. if self.global_labels.contains(label) { todo!(); - } else if self.local_labels.contains(label) { + } else if self.code_labels.contains(label) { let label_position = self.label_positions.get(label).unwrap(); *ins = match ins {