diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-08-12 17:12:03 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-08-12 17:12:03 +0200 |
commit | 1234de9c22343fc4e1fe9e3e1127d2db01e96c2f (patch) | |
tree | 85d5115fbe549246d2cf798853f5600ee0e8d9b2 /src/tokenizer.rs | |
parent | 037fb65633edaad1a75a707eee7c223471d7fb00 (diff) | |
download | markdown-rs-1234de9c22343fc4e1fe9e3e1127d2db01e96c2f.tar.gz markdown-rs-1234de9c22343fc4e1fe9e3e1127d2db01e96c2f.tar.bz2 markdown-rs-1234de9c22343fc4e1fe9e3e1127d2db01e96c2f.zip |
Refactor to improve some names
Diffstat (limited to '')
-rw-r--r-- | src/tokenizer.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/tokenizer.rs b/src/tokenizer.rs index 3f60b86..4a9fa01 100644 --- a/src/tokenizer.rs +++ b/src/tokenizer.rs @@ -64,12 +64,12 @@ pub struct LabelStart { pub inactive: bool, } -/// Media we found. +/// Valid label. #[derive(Debug)] -pub struct Media { - /// Indices of where the media’s label start starts and ends in `events`. +pub struct Label { + /// Indices of label start. pub start: (usize, usize), - /// Indices of where the media’s label end starts and ends in `events`. + /// Indices of label end. pub end: (usize, usize), } @@ -152,18 +152,18 @@ pub struct TokenizeState<'a> { pub space_or_tab_token: Name, // Couple of media related fields. - /// Stack of label (start) that could form images and links. + /// List of usable label starts. /// /// Used when tokenizing [text content][crate::content::text]. - pub label_start_stack: Vec<LabelStart>, - /// Stack of label (start) that cannot form images and links. + pub label_starts: Vec<LabelStart>, + /// List of unusable label starts. /// /// Used when tokenizing [text content][crate::content::text]. - pub label_start_list_loose: Vec<LabelStart>, + pub label_starts_loose: Vec<LabelStart>, /// Stack of images and links. /// /// Used when tokenizing [text content][crate::content::text]. - pub media_list: Vec<Media>, + pub labels: Vec<Label>, /// List of defined identifiers. pub definitions: Vec<String>, @@ -279,12 +279,12 @@ impl<'a> Tokenizer<'a> { document_child: None, definitions: vec![], end: 0, - label_start_stack: vec![], - label_start_list_loose: vec![], + label_starts: vec![], + label_starts_loose: vec![], marker: 0, marker_b: 0, markers: &[], - media_list: vec![], + labels: vec![], seen: false, size: 0, size_b: 0, |