diff --git a/src/ir/operation.rs b/src/ir/operation.rs index 13072b05..6533cde3 100644 --- a/src/ir/operation.rs +++ b/src/ir/operation.rs @@ -44,7 +44,7 @@ pub struct Operation { results: Vec, result_types: Vec, region: Arc>, - parent_block: Option>>, + parent: Option>>, } impl Operation { @@ -55,7 +55,7 @@ impl Operation { results: Vec, result_types: Vec, region: Arc>, - parent_block: Option>>, + parent: Option>>, ) -> Self { Self { name, @@ -64,7 +64,7 @@ impl Operation { results, result_types, region, - parent_block, + parent, } } pub fn operands(&self) -> Arc> { @@ -110,8 +110,8 @@ impl Operation { self } /// Get the parent block (this is called `getBlock` in MLIR). - fn parent_block(&self) -> Option<&Pin>> { - self.parent_block.as_ref() + fn parent(&self) -> Option<&Pin>> { + self.parent.as_ref() } pub fn rename(&mut self, name: String) { self.name = OperationName::new(name); @@ -164,7 +164,7 @@ impl Default for Operation { results: vec![], result_types: vec![], region: Arc::new(RwLock::new(Region::default())), - parent_block: None, + parent: None, } } } diff --git a/src/parser/scanner.rs b/src/parser/scanner.rs index 8f4df195..bc3667f1 100644 --- a/src/parser/scanner.rs +++ b/src/parser/scanner.rs @@ -84,16 +84,6 @@ impl Scanner { let location = Location::new(self.line, column, self.start); self.tokens.push(Token::new(kind, lexeme, location)); } - fn match_next(&mut self, expected: char) -> bool { - if self.is_at_end() { - return false; - } - if self.peek() != expected { - return false; - } - self.current += 1; - true - } fn number(&mut self) -> Result<()> { while self.peek().is_digit(10) { self.advance();