aboutsummaryrefslogtreecommitdiffstats
path: root/src/tokenizer.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-10 13:44:09 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-10 13:44:09 +0200
commit30e5f806277d14d5dcab708ccd0ce07a4894c1f9 (patch)
tree6a7ab8f589c9144b4efcd7ec66b12913e0d16fdc /src/tokenizer.rs
parent29e08c059addb2529637613f7122c573cfc46f6a (diff)
downloadmarkdown-rs-30e5f806277d14d5dcab708ccd0ce07a4894c1f9.tar.gz
markdown-rs-30e5f806277d14d5dcab708ccd0ce07a4894c1f9.tar.bz2
markdown-rs-30e5f806277d14d5dcab708ccd0ce07a4894c1f9.zip
Refactor some code for document parsing
Diffstat (limited to 'src/tokenizer.rs')
-rw-r--r--src/tokenizer.rs16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/tokenizer.rs b/src/tokenizer.rs
index dff97dd..7b8c9a5 100644
--- a/src/tokenizer.rs
+++ b/src/tokenizer.rs
@@ -203,12 +203,11 @@ pub enum StateName {
DestinationRawEscape,
DocumentStart,
- DocumentLineStart,
DocumentContainerExistingBefore,
DocumentContainerExistingAfter,
- DocumentContainerExistingMissing,
DocumentContainerNewBefore,
DocumentContainerNewBeforeNotBlockQuote,
+ DocumentContainerNewBeforeNotList,
DocumentContainerNewAfter,
DocumentContainersAfter,
DocumentFlowInside,
@@ -476,8 +475,6 @@ pub struct TokenizeState<'a> {
/// To do.
pub document_continued: usize,
/// To do.
- pub document_interrupt_before: bool,
- /// To do.
pub document_paragraph_before: bool,
/// To do.
pub document_data_index: Option<usize>,
@@ -575,8 +572,6 @@ pub struct Tokenizer<'a> {
///
/// Used when tokenizing [text content][crate::content::text].
pub media_list: Vec<Media>,
- /// Current container state.
- pub container: Option<ContainerState>,
/// Whether we would be interrupting something.
///
/// Used when tokenizing [flow content][crate::content::flow].
@@ -613,7 +608,6 @@ impl<'a> Tokenizer<'a> {
connect: false,
document_container_stack: vec![],
document_continued: 0,
- document_interrupt_before: false,
document_paragraph_before: false,
document_data_index: None,
document_child_state: None,
@@ -647,7 +641,6 @@ impl<'a> Tokenizer<'a> {
label_start_stack: vec![],
label_start_list_loose: vec![],
media_list: vec![],
- container: None,
interrupt: false,
concrete: false,
lazy: false,
@@ -1200,16 +1193,15 @@ fn call_impl(tokenizer: &mut Tokenizer, name: StateName) -> State {
StateName::DestinationRawEscape => construct::partial_destination::raw_escape,
StateName::DocumentStart => content::document::start,
- StateName::DocumentLineStart => content::document::line_start,
StateName::DocumentContainerExistingBefore => content::document::container_existing_before,
StateName::DocumentContainerExistingAfter => content::document::container_existing_after,
- StateName::DocumentContainerExistingMissing => {
- content::document::container_existing_missing
- }
StateName::DocumentContainerNewBefore => content::document::container_new_before,
StateName::DocumentContainerNewBeforeNotBlockQuote => {
content::document::container_new_before_not_block_quote
}
+ StateName::DocumentContainerNewBeforeNotList => {
+ content::document::container_new_before_not_list
+ }
StateName::DocumentContainerNewAfter => content::document::container_new_after,
StateName::DocumentContainersAfter => content::document::containers_after,
StateName::DocumentFlowEnd => content::document::flow_end,