From 16f0bd430e0864a3bbd0139803e476be413cb3cb Mon Sep 17 00:00:00 2001 From: Laurenz Date: Thu, 1 Oct 2020 11:05:16 +0200 Subject: =?UTF-8?q?Rename=20CharParser=20to=20Scanner=20=E2=9C=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/syntax/lines.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/syntax') diff --git a/src/syntax/lines.rs b/src/syntax/lines.rs index 7f7ee049..6ea223c4 100644 --- a/src/syntax/lines.rs +++ b/src/syntax/lines.rs @@ -3,7 +3,7 @@ use std::fmt::{self, Debug, Display, Formatter}; use super::Pos; -use crate::parse::{is_newline_char, CharParser}; +use crate::parse::{is_newline_char, Scanner}; /// Enables conversion of byte position to locations. pub struct LineMap<'s> { @@ -15,11 +15,11 @@ impl<'s> LineMap<'s> { /// Create a new line map for a source string. pub fn new(src: &'s str) -> Self { let mut line_starts = vec![Pos::ZERO]; - let mut p = CharParser::new(src); + let mut s = Scanner::new(src); - while let Some(c) = p.eat_merging_crlf() { + while let Some(c) = s.eat_merging_crlf() { if is_newline_char(c) { - line_starts.push(p.index().into()); + line_starts.push(s.index().into()); } } -- cgit v1.2.3