summaryrefslogtreecommitdiff
path: root/src/tokeniser.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tokeniser.rs')
-rw-r--r--src/tokeniser.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tokeniser.rs b/src/tokeniser.rs
index 0061e7a..0350afe 100644
--- a/src/tokeniser.rs
+++ b/src/tokeniser.rs
@@ -5,7 +5,7 @@ use std::path::PathBuf;
/// Break a character stream down into individual tokens.
pub struct Tokeniser {
- /// Characters waiting to be parsed.
+ /// All characters to be parsed, characters are never removed.
pub chars: Vec<char>,
/// Path of the whole source file.
pub source_path: Option<PathBuf>,
@@ -154,7 +154,7 @@ impl Tokeniser {
/// Returns true if the remainder of the line is whitespace.
pub fn end_of_line(&self) -> bool {
- for c in self.chars.iter().rev() {
+ for c in &self.chars[self.mark.i..] {
if *c == '\n' {
return true;
}