aboutsummaryrefslogtreecommitdiffstats
path: root/src/tokenizer.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-09 15:01:46 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-09 15:01:46 +0200
commit021d5f989ae41ae39a9b937b498141d9dc70d894 (patch)
tree8009a01d69cbd4f8200ffd34fc4031265b67406e /src/tokenizer.rs
parent344c3db875056d4aec509f24fb2dbeaf7e2a14b6 (diff)
downloadmarkdown-rs-021d5f989ae41ae39a9b937b498141d9dc70d894.tar.gz
markdown-rs-021d5f989ae41ae39a9b937b498141d9dc70d894.tar.bz2
markdown-rs-021d5f989ae41ae39a9b937b498141d9dc70d894.zip
Add basic subtokenization, string content in fenced code
Diffstat (limited to 'src/tokenizer.rs')
-rw-r--r--src/tokenizer.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/tokenizer.rs b/src/tokenizer.rs
index faee8d9..35e768e 100644
--- a/src/tokenizer.rs
+++ b/src/tokenizer.rs
@@ -177,16 +177,12 @@ pub struct Tokenizer {
impl Tokenizer {
/// Create a new tokenizer.
- pub fn new() -> Tokenizer {
+ pub fn new(point: Point, index: usize) -> Tokenizer {
Tokenizer {
current: Code::None,
- index: 0,
+ index,
consumed: true,
- point: Point {
- line: 1,
- column: 1,
- offset: 0,
- },
+ point,
stack: vec![],
events: vec![],
}
@@ -499,6 +495,11 @@ impl Tokenizer {
}
}
+ match state {
+ State::Ok => {}
+ _ => unreachable!("expected final state to be `State::Ok`"),
+ }
+
check_statefn_result((state, None))
}
}