Break apart is_boolean test into true/false variants
This commit is contained in:
parent
acbde03786
commit
c925939faf
1 changed files with 8 additions and 3 deletions
|
@ -11,7 +11,8 @@ pub trait Lexable {
|
|||
fn is_identifier_subsequent(&self) -> bool;
|
||||
fn is_identifier_single(&self) -> bool;
|
||||
fn is_hash(&self) -> bool;
|
||||
fn is_boolean(&self) -> bool;
|
||||
fn is_boolean_true(&self) -> bool;
|
||||
fn is_boolean_false(&self) -> bool;
|
||||
fn is_newline(&self) -> bool;
|
||||
}
|
||||
|
||||
|
@ -40,8 +41,12 @@ impl Lexable for char {
|
|||
*self == '#'
|
||||
}
|
||||
|
||||
fn is_boolean(&self) -> bool {
|
||||
*self == 't' || *self == 'f'
|
||||
fn is_boolean_true(&self) -> bool {
|
||||
*self == 't'
|
||||
}
|
||||
|
||||
fn is_boolean_false(&self) -> bool {
|
||||
*self == 'f'
|
||||
}
|
||||
|
||||
fn is_newline(&self) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue