Lex hashes and booleans
This commit is contained in:
parent
e9b0eab38a
commit
43054b3f49
4 changed files with 30 additions and 3 deletions
|
@ -10,6 +10,8 @@ pub trait Lexable {
|
|||
fn is_identifier_initial(&self) -> bool;
|
||||
fn is_identifier_subsequent(&self) -> bool;
|
||||
fn is_identifier_single(&self) -> bool;
|
||||
fn is_hash(&self) -> bool;
|
||||
fn is_boolean(&self) -> bool;
|
||||
fn is_newline(&self) -> bool;
|
||||
}
|
||||
|
||||
|
@ -34,6 +36,14 @@ impl Lexable for char {
|
|||
charset::identifier_singles().contains(&self)
|
||||
}
|
||||
|
||||
fn is_hash(&self) -> bool {
|
||||
*self == '#'
|
||||
}
|
||||
|
||||
fn is_boolean(&self) -> bool {
|
||||
*self == 't' || *self == 'f'
|
||||
}
|
||||
|
||||
fn is_newline(&self) -> bool {
|
||||
*self == '\n'
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue