diff --git a/src/tokenizer/token.rs b/src/tokenizer/token.rs index ac0729e..232c4b6 100644 --- a/src/tokenizer/token.rs +++ b/src/tokenizer/token.rs @@ -4,6 +4,7 @@ //! A [Token] represents all valid sequences of characters, //! sorted by meaning +use crate::Error; use regex::Regex; use std::{ fmt::{Debug, Display}, @@ -56,8 +57,6 @@ impl<$t> From<&$t str> for $type { }; } -use crate::Error; - #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct Token<'text> { /// The type of this token @@ -194,7 +193,7 @@ regex_impl! {<'text> Token<'text> { regex!(Type::RadixMarkerBin = r"(?i)^0b") } pub fn expect_number(text: &str) -> Option { - regex!(Type::Number = r"^+?[[:xdigit:]]{1,5}") + regex!(Type::Number = r"^+?[[:xdigit:]]+") } pub fn expect_minus(text: &str) -> Option { regex!(Type::Minus = r"^-")