diff --git a/lexer/src/chars.rs b/lexer/src/chars.rs index 6ef0375..f1507b1 100644 --- a/lexer/src/chars.rs +++ b/lexer/src/chars.rs @@ -11,6 +11,7 @@ pub trait Lexable { fn is_exactness(&self) -> bool; fn is_radix(&self) -> bool; + fn is_hash(&self) -> bool; } impl Lexable for char { @@ -42,6 +43,10 @@ impl Lexable for char { let radishes = &['b', 'd', 'o', 'x']; radishes.contains(self) } + + fn is_hash(&self) -> bool { + *self == '#' + } } trait LexableSpecial { diff --git a/lexer/src/states/begin.rs b/lexer/src/states/begin.rs index b4d9732..670b0dc 100644 --- a/lexer/src/states/begin.rs +++ b/lexer/src/states/begin.rs @@ -29,11 +29,3 @@ impl State for Begin { Ok(None) } } - -trait BeginLexable { - fn is_hash(&self) -> bool; -} - -impl BeginLexable for char { - fn is_hash(&self) -> bool { *self == '#' } -}