From 0663758fbb42651a08bfcd46c27b5cdeab90fb75 Mon Sep 17 00:00:00 2001 From: Martin Haug Date: Sun, 7 Nov 2021 19:43:01 +0100 Subject: Tests - length updates - dealing with keywords and comments --- src/parse/parser.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/parse/parser.rs') diff --git a/src/parse/parser.rs b/src/parse/parser.rs index f391c473..451e18f1 100644 --- a/src/parse/parser.rs +++ b/src/parse/parser.rs @@ -27,8 +27,8 @@ pub struct Parser<'s> { impl<'s> Parser<'s> { /// Create a new parser for the source string. - pub fn new(src: &'s str) -> Self { - let mut tokens = Tokens::new(src, TokenMode::Markup); + pub fn new(src: &'s str, mode: TokenMode) -> Self { + let mut tokens = Tokens::new(src, mode); let current = tokens.next(); Self { tokens, @@ -202,11 +202,6 @@ impl<'s> Parser<'s> { self.tokens.scanner().column(index) } - /// Set the tokenizer's mode. - pub fn set_mode(&mut self, mode: TokenMode) { - self.tokens.set_mode(mode); - } - /// Continue parsing in a group. /// /// When the end delimiter of the group is reached, all subsequent calls to -- cgit v1.2.3