diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-08-15 11:33:05 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-08-15 11:33:05 +0200 |
commit | 13135666fac476f3cd6f059147f496533b304097 (patch) | |
tree | 527c4ffd77b7a8c3aa54b88fd41d756fe80dbf47 /src/content/document.rs | |
parent | 6e20c3e79d4270fafb13a63af51eaffaa45c11e1 (diff) | |
download | markdown-rs-13135666fac476f3cd6f059147f496533b304097.tar.gz markdown-rs-13135666fac476f3cd6f059147f496533b304097.tar.bz2 markdown-rs-13135666fac476f3cd6f059147f496533b304097.zip |
Refactor to move some things to `parser`
Diffstat (limited to 'src/content/document.rs')
-rw-r--r-- | src/content/document.rs | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/src/content/document.rs b/src/content/document.rs index f90aea7..9def6c5 100644 --- a/src/content/document.rs +++ b/src/content/document.rs @@ -8,10 +8,9 @@ //! * [Block quote][crate::construct::block_quote] //! * [List][crate::construct::list_item] -use crate::event::{Content, Event, Kind, Link, Name, Point}; -use crate::parser::ParseState; +use crate::event::{Content, Event, Kind, Link, Name}; use crate::state::{Name as StateName, State}; -use crate::subtokenize::{divide_events, subtokenize}; +use crate::subtokenize::divide_events; use crate::tokenizer::{Container, ContainerState, Tokenizer}; use crate::util::skip; @@ -46,26 +45,6 @@ enum Phase { Eof, } -/// Parse a document. -pub fn document(parse_state: &mut ParseState, point: Point) -> Vec<Event> { - let mut tokenizer = Tokenizer::new(point, parse_state); - - let state = tokenizer.push( - (0, 0), - (parse_state.bytes.len(), 0), - State::Next(StateName::DocumentStart), - ); - tokenizer.flush(state, true); - - let mut events = tokenizer.events; - - parse_state.definitions = tokenizer.tokenize_state.definitions; - - while !subtokenize(&mut events, parse_state) {} - - events -} - /// Start of document, at an optional BOM. /// /// ```markdown |