Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rikhuijzer committed Sep 24, 2024
1 parent ea17c93 commit f72210d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
12 changes: 6 additions & 6 deletions src/ir/operation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub struct Operation {
results: Vec<Value>,
result_types: Vec<Type>,
region: Arc<RwLock<Region>>,
parent_block: Option<Pin<Box<Block>>>,
parent: Option<Pin<Box<Block>>>,
}

impl Operation {
Expand All @@ -55,7 +55,7 @@ impl Operation {
results: Vec<Value>,
result_types: Vec<Type>,
region: Arc<RwLock<Region>>,
parent_block: Option<Pin<Box<Block>>>,
parent: Option<Pin<Box<Block>>>,
) -> Self {
Self {
name,
Expand All @@ -64,7 +64,7 @@ impl Operation {
results,
result_types,
region,
parent_block,
parent,
}
}
pub fn operands(&self) -> Arc<Vec<Value>> {
Expand Down Expand Up @@ -110,8 +110,8 @@ impl Operation {
self
}
/// Get the parent block (this is called `getBlock` in MLIR).
fn parent_block(&self) -> Option<&Pin<Box<Block>>> {
self.parent_block.as_ref()
fn parent(&self) -> Option<&Pin<Box<Block>>> {
self.parent.as_ref()
}
pub fn rename(&mut self, name: String) {
self.name = OperationName::new(name);
Expand Down Expand Up @@ -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,
}
}
}
Expand Down
10 changes: 0 additions & 10 deletions src/parser/scanner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit f72210d

Please sign in to comment.