Pass over whitespace and count lines
This commit is contained in:
parent
f7c28c6732
commit
8140e3c5e6
2 changed files with 13 additions and 0 deletions
|
@ -10,6 +10,7 @@ pub trait Lexable {
|
|||
fn is_identifier_initial(&self) -> bool;
|
||||
fn is_identifier_subsequent(&self) -> bool;
|
||||
fn is_identifier_single(&self) -> bool;
|
||||
fn is_newline(&self) -> bool;
|
||||
}
|
||||
|
||||
impl Lexable for char {
|
||||
|
@ -32,5 +33,9 @@ impl Lexable for char {
|
|||
fn is_identifier_single(&self) -> bool {
|
||||
charset::identifier_singles().contains(&self)
|
||||
}
|
||||
|
||||
fn is_newline(&self) -> bool {
|
||||
*self == '\n'
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue