From a74228d11ac2511f4672c3d58c51bb9c83ed3916 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sun, 25 Dec 2016 14:33:26 -0700 Subject: [PATCH] Add char::is_eof() --- src/lexer/char.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lexer/char.rs b/src/lexer/char.rs index b1fa92d..5b6e61a 100644 --- a/src/lexer/char.rs +++ b/src/lexer/char.rs @@ -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 == ';' }