assembler: start refactoring/rewriting tokeniser
This commit is contained in:
@@ -59,12 +59,18 @@ pub enum AssembleErrorKind {
|
||||
IO(std::io::Error),
|
||||
/// Errors emitted from the [`Tokeniser`].
|
||||
Tokenise(TokeniserError),
|
||||
/// Returned for code where the functionality has not yet been implemented but we
|
||||
/// don't want the program to panic.
|
||||
Unimplemented(String),
|
||||
}
|
||||
|
||||
impl Display for AssembleErrorKind {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Self::Tokenise(why) => write!(f, "tokeniser error: {why}"),
|
||||
Self::Unimplemented(why) => write!(f, "used unimplemented feature: {why}"),
|
||||
Self::IO(why) => write!(f, "problem occurred with I/O: {why}"),
|
||||
#[expect(unreachable_patterns)]
|
||||
_ => write!(
|
||||
f,
|
||||
"unhandled error type in Display implementation! See error.rs!"
|
||||
|
||||
Reference in New Issue
Block a user