summaryrefslogtreecommitdiff
path: root/src/parse/parser.rs
diff options
context:
space:
mode:
authorMartin Haug <mhaug@live.de>2021-11-07 19:43:01 +0100
committerMartin Haug <mhaug@live.de>2021-11-07 19:43:01 +0100
commit0663758fbb42651a08bfcd46c27b5cdeab90fb75 (patch)
treed2c80591ba4bd233bc01181884f51fafc98b836e /src/parse/parser.rs
parenteba7fc34effbec3bcc6d5c40d831b1e15af77c4d (diff)
Tests
- length updates - dealing with keywords and comments
Diffstat (limited to 'src/parse/parser.rs')
-rw-r--r--src/parse/parser.rs9
1 files changed, 2 insertions, 7 deletions
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