From 30e5f806277d14d5dcab708ccd0ce07a4894c1f9 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Wed, 10 Aug 2022 13:44:09 +0200 Subject: Refactor some code for document parsing --- src/construct/list.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/construct/list.rs') diff --git a/src/construct/list.rs b/src/construct/list.rs index 36c1dac..d726c73 100644 --- a/src/construct/list.rs +++ b/src/construct/list.rs @@ -275,7 +275,9 @@ pub fn after(tokenizer: &mut Tokenizer) -> State { prefix += 1; } - let container = tokenizer.container.as_mut().unwrap(); + let container = &mut tokenizer.tokenize_state.document_container_stack + [tokenizer.tokenize_state.document_continued]; + container.blank_initial = blank; container.size = prefix; @@ -309,7 +311,8 @@ pub fn cont_start(tokenizer: &mut Tokenizer) -> State { /// | b /// ``` pub fn cont_blank(tokenizer: &mut Tokenizer) -> State { - let container = tokenizer.container.as_ref().unwrap(); + let container = &mut tokenizer.tokenize_state.document_container_stack + [tokenizer.tokenize_state.document_continued]; let size = container.size; if container.blank_initial { @@ -329,7 +332,8 @@ pub fn cont_blank(tokenizer: &mut Tokenizer) -> State { /// ^ /// ``` pub fn cont_filled(tokenizer: &mut Tokenizer) -> State { - let container = tokenizer.container.as_mut().unwrap(); + let container = &mut tokenizer.tokenize_state.document_container_stack + [tokenizer.tokenize_state.document_continued]; let size = container.size; container.blank_initial = false; -- cgit