From 90969231bfcdfcd09bae646abba17d832b633376 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Thu, 11 Aug 2022 17:00:07 +0200 Subject: Refactor to handle definitions when parsing --- src/tokenizer.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/tokenizer.rs') diff --git a/src/tokenizer.rs b/src/tokenizer.rs index 8ff19c3..fdca6c5 100644 --- a/src/tokenizer.rs +++ b/src/tokenizer.rs @@ -165,6 +165,9 @@ pub struct TokenizeState<'a> { /// Used when tokenizing [text content][crate::content::text]. pub media_list: Vec, + /// List of defined identifiers. + pub definitions: Vec, + /// Whether to connect tokens. pub connect: bool, /// Marker. @@ -274,18 +277,18 @@ impl<'a> Tokenizer<'a> { document_data_index: None, document_child_state: None, document_child: None, + definitions: vec![], + end: 0, + label_start_stack: vec![], + label_start_list_loose: vec![], marker: 0, marker_b: 0, markers: &[], + media_list: vec![], seen: false, size: 0, size_b: 0, size_c: 0, - start: 0, - end: 0, - label_start_stack: vec![], - label_start_list_loose: vec![], - media_list: vec![], space_or_tab_eol_content_type: None, space_or_tab_eol_connect: false, space_or_tab_eol_ok: false, @@ -295,6 +298,7 @@ impl<'a> Tokenizer<'a> { space_or_tab_max: 0, space_or_tab_size: 0, space_or_tab_token: Name::SpaceOrTab, + start: 0, token_1: Name::Data, token_2: Name::Data, token_3: Name::Data, -- cgit