From 92b42e06f943338ce8b54b7e22cbb116ff598fa6 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Thu, 7 Jul 2022 18:56:06 +0200 Subject: Refactor to move token types to `token` --- src/content/flow.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/content/flow.rs') diff --git a/src/content/flow.rs b/src/content/flow.rs index f406685..e52f113 100644 --- a/src/content/flow.rs +++ b/src/content/flow.rs @@ -26,7 +26,8 @@ use crate::construct::{ html_flow::start as html_flow, paragraph::start as paragraph, thematic_break::start as thematic_break, }; -use crate::tokenizer::{Code, State, StateFnResult, TokenType, Tokenizer}; +use crate::token::Token; +use crate::tokenizer::{Code, State, StateFnResult, Tokenizer}; /// Before flow. /// @@ -88,9 +89,9 @@ fn blank_line_after(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { match code { Code::None => (State::Ok, None), Code::CarriageReturnLineFeed | Code::Char('\n' | '\r') => { - tokenizer.enter(TokenType::BlankLineEnding); + tokenizer.enter(Token::BlankLineEnding); tokenizer.consume(code); - tokenizer.exit(TokenType::BlankLineEnding); + tokenizer.exit(Token::BlankLineEnding); // Feel free to interrupt. tokenizer.interrupt = false; (State::Fn(Box::new(start)), None) @@ -112,9 +113,9 @@ fn after(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { match code { Code::None => (State::Ok, None), Code::CarriageReturnLineFeed | Code::Char('\n' | '\r') => { - tokenizer.enter(TokenType::LineEnding); + tokenizer.enter(Token::LineEnding); tokenizer.consume(code); - tokenizer.exit(TokenType::LineEnding); + tokenizer.exit(Token::LineEnding); (State::Fn(Box::new(start)), None) } _ => unreachable!("expected eol/eof"), -- cgit