diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-08-11 15:23:45 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-08-11 15:23:45 +0200 |
commit | cf9f0039911597cd5c9bc8e98f61b5df09b02130 (patch) | |
tree | 43fcec13b338fd64b800df1f72c8cec01adc8581 /src/resolve.rs | |
parent | d87dc75500a2e73d9521135054b42c18e6eae987 (diff) | |
download | markdown-rs-cf9f0039911597cd5c9bc8e98f61b5df09b02130.tar.gz markdown-rs-cf9f0039911597cd5c9bc8e98f61b5df09b02130.tar.bz2 markdown-rs-cf9f0039911597cd5c9bc8e98f61b5df09b02130.zip |
Remove boxes around resolvers
Diffstat (limited to 'src/resolve.rs')
-rw-r--r-- | src/resolve.rs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/resolve.rs b/src/resolve.rs new file mode 100644 index 0000000..e72b2a2 --- /dev/null +++ b/src/resolve.rs @@ -0,0 +1,34 @@ +use crate::construct; +use crate::content; +use crate::tokenizer::Tokenizer; + +/// Names of functions to move to. +#[derive(Debug, Clone, Copy, PartialEq)] +pub enum Name { + Label, + Attention, + HeadingAtx, + HeadingSetext, + List, + Paragraph, + Data, + String, + Text, +} + +/// Call the corresponding function for a state name. +pub fn call(tokenizer: &mut Tokenizer, name: Name) { + let func = match name { + Name::Label => construct::label_end::resolve, + Name::Attention => construct::attention::resolve, + Name::HeadingAtx => construct::heading_atx::resolve, + Name::HeadingSetext => construct::heading_setext::resolve, + Name::List => construct::list::resolve, + Name::Paragraph => construct::paragraph::resolve, + Name::Data => construct::partial_data::resolve, + Name::String => content::string::resolve, + Name::Text => content::text::resolve, + }; + + func(tokenizer); +} |