Add char::is_eof()

This commit is contained in:
Eryn Wells 2016-12-25 14:33:26 -07:00
parent 7f19c78127
commit a74228d11a

View file

@ -14,6 +14,7 @@ pub trait Lexable {
fn is_boolean_true(&self) -> bool;
fn is_boolean_false(&self) -> bool;
fn is_newline(&self) -> bool;
fn is_eof(&self) -> bool;
fn is_comment_initial(&self) -> bool;
}
@ -54,6 +55,10 @@ impl Lexable for char {
*self == '\n'
}
fn is_eof(&self) -> bool {
*self == '\0'
}
fn is_comment_initial(&self) -> bool {
*self == ';'
}