From 184c39579227c0add80a61d489c242120001d6b6 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Thu, 26 Sep 2024 15:53:57 +0200 Subject: Re-work the parser from scratch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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à --- lib/xixanta/src/errors.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/xixanta/src/errors.rs') 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 for ParseError { ParseError { line: 0, message: err.to_string(), + parse: true, } } } -- cgit v1.2.3