Add char::is_eof()
This commit is contained in:
parent
7f19c78127
commit
a74228d11a
1 changed files with 5 additions and 0 deletions
|
@ -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 == ';'
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue