mirror of
https://github.com/Noratrieb/m8db.git
synced 2026-01-16 08:15:02 +01:00
remove impl std::fmt::Display for Stmt
This commit is contained in:
parent
fc974548ab
commit
0c201410b7
1 changed files with 1 additions and 15 deletions
16
src/stmt.rs
16
src/stmt.rs
|
|
@ -1,6 +1,5 @@
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::fmt::Formatter;
|
ouse std::num::ParseIntError;
|
||||||
use std::num::ParseIntError;
|
|
||||||
|
|
||||||
/// A span referencing the line where a statement came from. Starts at 0
|
/// A span referencing the line where a statement came from. Starts at 0
|
||||||
#[derive(Debug, Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash)]
|
#[derive(Debug, Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash)]
|
||||||
|
|
@ -234,16 +233,3 @@ fn parse_line(line: &str) -> Result<IrStmt, String> {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
impl std::fmt::Display for Stmt {
|
|
||||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
|
||||||
match self {
|
|
||||||
Stmt::Inc(r) => write!(f, "INC {}", r)?,
|
|
||||||
Stmt::Dec(r) => write!(f, "DEC {}", r)?,
|
|
||||||
Stmt::IsZero(r, line) => write!(f, "IS_ZERO {} {}", r, line)?,
|
|
||||||
Stmt::Jump(r) => write!(f, "JUMP {}", r)?,
|
|
||||||
Stmt::Stop => write!(f, "STOP")?,
|
|
||||||
}
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue