From afa81e9ae6a56efe2eae2990e09c672b74328715 Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Mon, 8 May 2023 12:05:57 +1200 Subject: Added detection of cyclic macro references, and made assembler binary usable --- src/syntactic_token.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/syntactic_token.rs') diff --git a/src/syntactic_token.rs b/src/syntactic_token.rs index ee473e2..4a50e8a 100644 --- a/src/syntactic_token.rs +++ b/src/syntactic_token.rs @@ -5,16 +5,18 @@ pub enum SyntacticTokenType { LabelDefinition(String), MacroDefinition(String), - MacroTerminator, + MacroDefinitionTerminator, - Pad(u16), - Byte(u8), - Short(u16), + Padding(u16), + ByteLiteral(u8), + ShortLiteral(u16), Instruction(u8), Comment, } + + pub struct SyntacticToken { pub r#type: SyntacticTokenType, pub source_location: SourceLocation, @@ -32,12 +34,10 @@ impl SyntacticToken { _ => (), }; } - pub fn set_error(&mut self, error: Error) { self.error = Some(error); } - pub fn is_macro_terminator(&self) -> bool { - if let SyntacticTokenType::MacroTerminator = self.r#type {true} else {false} + if let SyntacticTokenType::MacroDefinitionTerminator = self.r#type {true} else {false} } } -- cgit v1.2.3-70-g09d2