summaryrefslogtreecommitdiff
path: root/src/syntactic_token.rs
diff options
context:
space:
mode:
authorBen Bridle <bridle.benjamin@gmail.com>2023-05-08 12:05:57 +1200
committerBen Bridle <bridle.benjamin@gmail.com>2023-05-08 12:05:57 +1200
commitafa81e9ae6a56efe2eae2990e09c672b74328715 (patch)
treee13ceca3104a8f4bded3668f8efd743bcfbe4e35 /src/syntactic_token.rs
parente38f108921c61e1e66d65a368f2a67a763d61e69 (diff)
downloadbedrock-asm-afa81e9ae6a56efe2eae2990e09c672b74328715.zip
Added detection of cyclic macro references, and made assembler binary usable
Diffstat (limited to 'src/syntactic_token.rs')
-rw-r--r--src/syntactic_token.rs14
1 files changed, 7 insertions, 7 deletions
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}
}
}