From 13135666fac476f3cd6f059147f496533b304097 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Mon, 15 Aug 2022 11:33:05 +0200 Subject: Refactor to move some things to `parser` --- src/content/document.rs | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) (limited to 'src/content/document.rs') 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 { - 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 -- cgit