aboutsummaryrefslogtreecommitdiff
path: root/lib/xixanta/src/errors.rs
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2024-09-26 15:53:57 +0200
committerMiquel Sabaté Solà <mikisabate@gmail.com>2024-12-12 07:41:30 +0100
commit184c39579227c0add80a61d489c242120001d6b6 (patch)
tree48737e0e00b5fb655090a1c9a4fc216dcf278cc0 /lib/xixanta/src/errors.rs
parent54e1239fcccb2383e5caa88844a7229b5441c31e (diff)
downloadtools.nes-184c39579227c0add80a61d489c242120001d6b6.tar.gz
tools.nes-184c39579227c0add80a61d489c242120001d6b6.zip
Re-work the parser from scratch
The initial implementation was incredibly naive on how complex an assembler can actually be. Because of this, it never bothered to define and produce a proper AST, and hence it was overall extremely fragile on (not so) corner cases. This commit re-writes everything from scratch for the parser, and it should really be the last fundamental change to the parser other than minor additions/features here and there. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'lib/xixanta/src/errors.rs')
-rw-r--r--lib/xixanta/src/errors.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/xixanta/src/errors.rs b/lib/xixanta/src/errors.rs
index d9a12cd..6c99f57 100644
--- a/lib/xixanta/src/errors.rs
+++ b/lib/xixanta/src/errors.rs
@@ -1,10 +1,12 @@
use std::fmt;
// TODO: global error
+// TODO: more errors, the `parse` thing is a hack!
#[derive(Debug, Clone, PartialEq)]
pub struct ParseError {
pub line: usize,
pub message: String,
+ pub parse: bool,
}
impl std::error::Error for ParseError {}
@@ -15,6 +17,7 @@ impl From<std::io::Error> for ParseError {
ParseError {
line: 0,
message: err.to_string(),
+ parse: true,
}
}
}