diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-06-09 15:01:46 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-06-09 15:01:46 +0200 |
commit | 021d5f989ae41ae39a9b937b498141d9dc70d894 (patch) | |
tree | 8009a01d69cbd4f8200ffd34fc4031265b67406e /src/tokenizer.rs | |
parent | 344c3db875056d4aec509f24fb2dbeaf7e2a14b6 (diff) | |
download | markdown-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.rs | 15 |
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)) } } |