diff options
Diffstat (limited to 'src/tokenizer.rs')
-rw-r--r-- | src/tokenizer.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/tokenizer.rs b/src/tokenizer.rs index b68cc14..508daee 100644 --- a/src/tokenizer.rs +++ b/src/tokenizer.rs @@ -106,9 +106,9 @@ impl Iterator for TokenIterator { let full = take(&mut self.source); let suffix = take(&mut self.suffix); let mut error = None; - let mut parse_hex_lit = |v| { + let mut parse_padding_value = |v| { parse_short(v).or_else(|| { - error = Some(Error::InvalidHexadecimalLiteral); Some(0) + error = Some(Error::InvalidPaddingValue); Some(0) }).unwrap() }; @@ -116,13 +116,13 @@ impl Iterator for TokenIterator { '(' => { SyntacticTokenType::Comment } '@' => { SyntacticTokenType::LabelDefinition({self.label=suffix.clone(); suffix}) } '&' => { SyntacticTokenType::LabelDefinition(format!("{}/{}", self.label, suffix)) } - '$' => { SyntacticTokenType::Pad(parse_hex_lit(&suffix)) } + '$' => { SyntacticTokenType::Padding(parse_padding_value(&suffix)) } '~' => { SyntacticTokenType::Reference(format!("{}/{}", self.label, suffix)) } '%' => { SyntacticTokenType::MacroDefinition(suffix) } _ => { - if ";" == &full { SyntacticTokenType::MacroTerminator } - else if let Some(value) = parse_byte_lit(&full) { SyntacticTokenType::Byte(value) } - else if let Some(value) = parse_short_lit(&full) { SyntacticTokenType::Short(value) } + if ";" == &full { SyntacticTokenType::MacroDefinitionTerminator } + else if let Some(value) = parse_byte_lit(&full) { SyntacticTokenType::ByteLiteral(value) } + else if let Some(value) = parse_short_lit(&full) { SyntacticTokenType::ShortLiteral(value) } else if let Some(value) = parse_instruction(&full) { SyntacticTokenType::Instruction(value) } else { SyntacticTokenType::Reference(full.clone()) } } |