diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-07-07 18:56:06 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-07-07 18:56:06 +0200 |
commit | 92b42e06f943338ce8b54b7e22cbb116ff598fa6 (patch) | |
tree | ff51df093f52dc33bfac5e1c236b41cfbd21c220 /src/construct/hard_break_escape.rs | |
parent | fdb1f1694f44cfbc59d303a10371300b48d74627 (diff) | |
download | markdown-rs-92b42e06f943338ce8b54b7e22cbb116ff598fa6.tar.gz markdown-rs-92b42e06f943338ce8b54b7e22cbb116ff598fa6.tar.bz2 markdown-rs-92b42e06f943338ce8b54b7e22cbb116ff598fa6.zip |
Refactor to move token types to `token`
Diffstat (limited to '')
-rw-r--r-- | src/construct/hard_break_escape.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/construct/hard_break_escape.rs b/src/construct/hard_break_escape.rs index 212d276..4fb87bf 100644 --- a/src/construct/hard_break_escape.rs +++ b/src/construct/hard_break_escape.rs @@ -26,8 +26,8 @@ //! //! ## Tokens //! -//! * [`HardBreakEscape`][TokenType::HardBreakEscape] -//! * [`HardBreakEscapeMarker`][TokenType::HardBreakEscapeMarker] +//! * [`HardBreakEscape`][Token::HardBreakEscape] +//! * [`HardBreakEscapeMarker`][Token::HardBreakEscapeMarker] //! //! ## References //! @@ -40,7 +40,8 @@ //! [hard_break_trailing]: crate::construct::hard_break_trailing //! [html]: https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-br-element -use crate::tokenizer::{Code, State, StateFnResult, TokenType, Tokenizer}; +use crate::token::Token; +use crate::tokenizer::{Code, State, StateFnResult, Tokenizer}; /// Start of a hard break (escape). /// @@ -50,10 +51,10 @@ use crate::tokenizer::{Code, State, StateFnResult, TokenType, Tokenizer}; pub fn start(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { match code { Code::Char('\\') => { - tokenizer.enter(TokenType::HardBreakEscape); - tokenizer.enter(TokenType::HardBreakEscapeMarker); + tokenizer.enter(Token::HardBreakEscape); + tokenizer.enter(Token::HardBreakEscapeMarker); tokenizer.consume(code); - tokenizer.exit(TokenType::HardBreakEscapeMarker); + tokenizer.exit(Token::HardBreakEscapeMarker); (State::Fn(Box::new(inside)), None) } _ => (State::Nok, None), @@ -68,7 +69,7 @@ pub fn start(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { fn inside(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { match code { Code::CarriageReturnLineFeed | Code::Char('\n' | '\r') => { - tokenizer.exit(TokenType::HardBreakEscape); + tokenizer.exit(Token::HardBreakEscape); (State::Ok, Some(vec![code])) } _ => (State::Nok, None), |