From bd446b6123e0b077a48e9f1e836affac78822f44 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Mon, 4 Sep 2023 20:47:52 +0200 Subject: chore: rename internal states as well See the previous commit. --- src/tokenizer/machine.rs | 32 ++++++++++++++++---------------- src/tokenizer/machine/utils.rs | 12 ++++++------ 2 files changed, 22 insertions(+), 22 deletions(-) (limited to 'src/tokenizer') diff --git a/src/tokenizer/machine.rs b/src/tokenizer/machine.rs index faf1ea8..944eb01 100644 --- a/src/tokenizer/machine.rs +++ b/src/tokenizer/machine.rs @@ -114,14 +114,14 @@ where } None => Ok(ControlToken::Eof), }, - State::RcData => match slf.read_char()? { + State::Rcdata => match slf.read_char()? { Some('&') => { - slf.return_state = Some(State::RcData); + slf.return_state = Some(State::Rcdata); slf.state = State::CharacterReference; Ok(ControlToken::Continue) } Some('<') => { - slf.state = State::RcDataLessThanSign; + slf.state = State::RcdataLessThanSign; Ok(ControlToken::Continue) } Some('\0') => { @@ -135,7 +135,7 @@ where } None => Ok(ControlToken::Eof), }, - State::RawText => match slf.read_char()? { + State::Rawtext => match slf.read_char()? { Some('<') => { slf.state = State::RawTextLessThanSign; Ok(ControlToken::Continue) @@ -167,7 +167,7 @@ where } None => Ok(ControlToken::Eof), }, - State::PlainText => match slf.read_char()? { + State::Plaintext => match slf.read_char()? { Some('\0') => { slf.emit_error(Error::UnexpectedNullCharacter); slf.emit_char_for_source_char('\u{fffd}', '\0'); @@ -270,34 +270,34 @@ where Ok(ControlToken::Eof) } }, - State::RcDataLessThanSign => match slf.read_char()? { + State::RcdataLessThanSign => match slf.read_char()? { Some('/') => { slf.temporary_buffer.clear(); - slf.state = State::RcDataEndTagOpen; + slf.state = State::RcdataEndTagOpen; Ok(ControlToken::Continue) } c => { slf.emit_char('<'); - slf.state = State::RcData; + slf.state = State::Rcdata; slf.unread_char(c); Ok(ControlToken::Continue) } }, - State::RcDataEndTagOpen => match slf.read_char()? { + State::RcdataEndTagOpen => match slf.read_char()? { Some(x) if x.is_ascii_alphabetic() => { slf.init_end_tag(); - slf.state = State::RcDataEndTagName; + slf.state = State::RcdataEndTagName; slf.unread_char(Some(x)); Ok(ControlToken::Continue) } c => { slf.emit_chars(b" match slf.read_char()? { + State::RcdataEndTagName => match slf.read_char()? { Some(whitespace_pat!()) if slf.current_end_tag_is_appropriate() => { slf.state = State::BeforeAttributeName; Ok(ControlToken::Continue) @@ -320,7 +320,7 @@ where slf.emit_chars(b" { slf.emit_char('<'); - slf.state = State::RawText; + slf.state = State::Rawtext; slf.unread_char(c); Ok(ControlToken::Continue) } @@ -347,7 +347,7 @@ where } c => { slf.emit_chars(b"