[lexer] move char::is_hash() to chars::Lexable

This commit is contained in:
Eryn Wells 2018-09-03 15:48:48 -07:00
parent dc8f5a7686
commit 663ae3a9f1
2 changed files with 5 additions and 8 deletions

View file

@ -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 {

View file

@ -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 == '#' }
}