diff options
Diffstat (limited to 'src/construct/code_text.rs')
-rw-r--r-- | src/construct/code_text.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/construct/code_text.rs b/src/construct/code_text.rs index 150f63b..b36a208 100644 --- a/src/construct/code_text.rs +++ b/src/construct/code_text.rs @@ -98,9 +98,9 @@ pub fn start(tokenizer: &mut Tokenizer) -> State { let len = tokenizer.events.len(); match tokenizer.current { - Some('`') + Some(b'`') if tokenizer.parse_state.constructs.code_text - && (tokenizer.previous != Some('`') + && (tokenizer.previous != Some(b'`') || (len > 0 && tokenizer.events[len - 1].token_type == Token::CharacterEscape)) => { @@ -119,7 +119,7 @@ pub fn start(tokenizer: &mut Tokenizer) -> State { /// ^ /// ``` fn sequence_open(tokenizer: &mut Tokenizer, size: usize) -> State { - if let Some('`') = tokenizer.current { + if let Some(b'`') = tokenizer.current { tokenizer.consume(); State::Fn(Box::new(move |t| sequence_open(t, size + 1))) } else { @@ -137,13 +137,13 @@ fn sequence_open(tokenizer: &mut Tokenizer, size: usize) -> State { fn between(tokenizer: &mut Tokenizer, size_open: usize) -> State { match tokenizer.current { None => State::Nok, - Some('\n') => { + Some(b'\n') => { tokenizer.enter(Token::LineEnding); tokenizer.consume(); tokenizer.exit(Token::LineEnding); State::Fn(Box::new(move |t| between(t, size_open))) } - Some('`') => { + Some(b'`') => { tokenizer.enter(Token::CodeTextSequence); sequence_close(tokenizer, size_open, 0) } @@ -162,7 +162,7 @@ fn between(tokenizer: &mut Tokenizer, size_open: usize) -> State { /// ``` fn data(tokenizer: &mut Tokenizer, size_open: usize) -> State { match tokenizer.current { - None | Some('\n' | '`') => { + None | Some(b'\n' | b'`') => { tokenizer.exit(Token::CodeTextData); between(tokenizer, size_open) } @@ -181,7 +181,7 @@ fn data(tokenizer: &mut Tokenizer, size_open: usize) -> State { /// ``` fn sequence_close(tokenizer: &mut Tokenizer, size_open: usize, size: usize) -> State { match tokenizer.current { - Some('`') => { + Some(b'`') => { tokenizer.consume(); State::Fn(Box::new(move |t| sequence_close(t, size_open, size + 1))) } |