Break apart is_boolean test into true/false variants

This commit is contained in:
Eryn Wells 2016-12-25 12:24:31 -07:00
parent acbde03786
commit c925939faf

View file

@ -11,7 +11,8 @@ pub trait Lexable {
fn is_identifier_subsequent(&self) -> bool; fn is_identifier_subsequent(&self) -> bool;
fn is_identifier_single(&self) -> bool; fn is_identifier_single(&self) -> bool;
fn is_hash(&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; fn is_newline(&self) -> bool;
} }
@ -40,8 +41,12 @@ impl Lexable for char {
*self == '#' *self == '#'
} }
fn is_boolean(&self) -> bool { fn is_boolean_true(&self) -> bool {
*self == 't' || *self == 'f' *self == 't'
}
fn is_boolean_false(&self) -> bool {
*self == 'f'
} }
fn is_newline(&self) -> bool { fn is_newline(&self) -> bool {