diff --git a/src/tokenizer/token.rs b/src/tokenizer/token.rs index d86c67e..ac0729e 100644 --- a/src/tokenizer/token.rs +++ b/src/tokenizer/token.rs @@ -50,7 +50,7 @@ impl<$t> From<&$t str> for $type { token } else )* - {todo!("Unexpected input: {value:#?}")} + {todo!("Unexpected input: {value:#?} (Tokenization failure)")} } } }; @@ -221,7 +221,7 @@ regex_impl! {<'text> Token<'text> { regex!(Type::Directive = r"^\.\w+( .*)?") } pub fn expect_identifier(text: &str) -> Option { - regex!(Type::Identifier = r"^[A-Za-z_]\w+") + regex!(Type::Identifier = r"^[A-Za-z_]\w*") } pub fn expect_separator(text: &str) -> Option { regex!(Type::Separator = r"^,")