summaryrefslogtreecommitdiff
path: root/src/tokenizer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tokenizer.rs')
-rw-r--r--src/tokenizer.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/tokenizer.rs b/src/tokenizer.rs
index 03609b2..1fdb994 100644
--- a/src/tokenizer.rs
+++ b/src/tokenizer.rs
@@ -142,7 +142,11 @@ impl Iterator for TokenIterator {
'&' => { SyntacticTokenType::LabelDefinition(format!("{}/{}", self.label, suffix)) }
'$' => { SyntacticTokenType::Padding(parse_padding_value(&suffix)) }
'~' => { SyntacticTokenType::Reference(format!("{}/{}", self.label, suffix)) }
- '%' => { SyntacticTokenType::MacroDefinition(suffix) }
+ '%' => if let Some(("", sublabel)) = suffix.split_once("~") {
+ SyntacticTokenType::MacroDefinition(format!("{}/{}", self.label, sublabel))
+ } else {
+ SyntacticTokenType::MacroDefinition(suffix)
+ }
_ => {
if ";" == &full { SyntacticTokenType::MacroDefinitionTerminator }
else if let Some(value) = parse_byte_lit(&full) { SyntacticTokenType::ByteLiteral(value) }