diff options
Diffstat (limited to 'src/machine.rs')
-rw-r--r-- | src/machine.rs | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/src/machine.rs b/src/machine.rs index aa07900..e6f439b 100644 --- a/src/machine.rs +++ b/src/machine.rs @@ -124,7 +124,7 @@ pub fn consume<R: Reader, E: Emitter<R>>( Ok(ControlToken::Continue) } Some(x) if x.is_ascii_alphabetic() => { - slf.emitter.init_start_tag(&slf.reader); + slf.init_start_tag(); slf.state = State::TagName; slf.unread_char(Some(x)); Ok(ControlToken::Continue) @@ -151,7 +151,7 @@ pub fn consume<R: Reader, E: Emitter<R>>( }, State::EndTagOpen => match slf.read_char()? { Some(x) if x.is_ascii_alphabetic() => { - slf.emitter.init_end_tag(&slf.reader); + slf.init_end_tag(); slf.state = State::TagName; slf.unread_char(Some(x)); Ok(ControlToken::Continue) @@ -185,16 +185,16 @@ pub fn consume<R: Reader, E: Emitter<R>>( } Some('>') => { slf.state = State::Data; - slf.emitter.emit_current_tag(); + slf.emit_current_tag(); Ok(ControlToken::Continue) } Some('\0') => { slf.emit_error(Error::UnexpectedNullCharacter); - slf.emitter.push_tag_name("\u{fffd}"); + slf.push_tag_name("\u{fffd}"); Ok(ControlToken::Continue) } Some(x) => { - slf.emitter.push_tag_name(ctostr!(x.to_ascii_lowercase())); + slf.push_tag_name(ctostr!(x.to_ascii_lowercase())); Ok(ControlToken::Continue) } None => { @@ -217,7 +217,7 @@ pub fn consume<R: Reader, E: Emitter<R>>( }, State::RcDataEndTagOpen => match slf.read_char()? { Some(x) if x.is_ascii_alphabetic() => { - slf.emitter.init_end_tag(&slf.reader); + slf.init_end_tag(); slf.state = State::RcDataEndTagName; slf.unread_char(Some(x)); Ok(ControlToken::Continue) @@ -230,21 +230,21 @@ pub fn consume<R: Reader, E: Emitter<R>>( } }, State::RcDataEndTagName => match slf.read_char()? { - Some(whitespace_pat!()) if slf.emitter.current_is_appropriate_end_tag_token() => { + Some(whitespace_pat!()) if slf.current_end_tag_is_appropriate() => { slf.state = State::BeforeAttributeName; Ok(ControlToken::Continue) } - Some('/') if slf.emitter.current_is_appropriate_end_tag_token() => { + Some('/') if slf.current_end_tag_is_appropriate() => { slf.state = State::SelfClosingStartTag; Ok(ControlToken::Continue) } - Some('>') if slf.emitter.current_is_appropriate_end_tag_token() => { + Some('>') if slf.current_end_tag_is_appropriate() => { slf.state = State::Data; - slf.emitter.emit_current_tag(); + slf.emit_current_tag(); Ok(ControlToken::Continue) } Some(x) if x.is_ascii_alphabetic() => { - slf.emitter.push_tag_name(ctostr!(x.to_ascii_lowercase())); + slf.push_tag_name(ctostr!(x.to_ascii_lowercase())); slf.temporary_buffer.push(x); Ok(ControlToken::Continue) } @@ -272,7 +272,7 @@ pub fn consume<R: Reader, E: Emitter<R>>( }, State::RawTextEndTagOpen => match slf.read_char()? { Some(x) if x.is_ascii_alphabetic() => { - slf.emitter.init_end_tag(&slf.reader); + slf.init_end_tag(); slf.state = State::RawTextEndTagName; slf.unread_char(Some(x)); Ok(ControlToken::Continue) @@ -285,21 +285,21 @@ pub fn consume<R: Reader, E: Emitter<R>>( } }, State::RawTextEndTagName => match slf.read_char()? { - Some(whitespace_pat!()) if slf.emitter.current_is_appropriate_end_tag_token() => { + Some(whitespace_pat!()) if slf.current_end_tag_is_appropriate() => { slf.state = State::BeforeAttributeName; Ok(ControlToken::Continue) } - Some('/') if slf.emitter.current_is_appropriate_end_tag_token() => { + Some('/') if slf.current_end_tag_is_appropriate() => { slf.state = State::SelfClosingStartTag; Ok(ControlToken::Continue) } - Some('>') if slf.emitter.current_is_appropriate_end_tag_token() => { + Some('>') if slf.current_end_tag_is_appropriate() => { slf.state = State::Data; - slf.emitter.emit_current_tag(); + slf.emit_current_tag(); Ok(ControlToken::Continue) } Some(x) if x.is_ascii_alphabetic() => { - slf.emitter.push_tag_name(ctostr!(x.to_ascii_lowercase())); + slf.push_tag_name(ctostr!(x.to_ascii_lowercase())); slf.temporary_buffer.push(x); Ok(ControlToken::Continue) } @@ -332,7 +332,7 @@ pub fn consume<R: Reader, E: Emitter<R>>( }, State::ScriptDataEndTagOpen => match slf.read_char()? { Some(x) if x.is_ascii_alphabetic() => { - slf.emitter.init_end_tag(&slf.reader); + slf.init_end_tag(); slf.state = State::ScriptDataEndTagName; slf.unread_char(Some(x)); Ok(ControlToken::Continue) @@ -345,21 +345,21 @@ pub fn consume<R: Reader, E: Emitter<R>>( } }, State::ScriptDataEndTagName => match slf.read_char()? { - Some(whitespace_pat!()) if slf.emitter.current_is_appropriate_end_tag_token() => { + Some(whitespace_pat!()) if slf.current_end_tag_is_appropriate() => { slf.state = State::BeforeAttributeName; Ok(ControlToken::Continue) } - Some('/') if slf.emitter.current_is_appropriate_end_tag_token() => { + Some('/') if slf.current_end_tag_is_appropriate() => { slf.state = State::SelfClosingStartTag; Ok(ControlToken::Continue) } - Some('>') if slf.emitter.current_is_appropriate_end_tag_token() => { + Some('>') if slf.current_end_tag_is_appropriate() => { slf.state = State::Data; - slf.emitter.emit_current_tag(); + slf.emit_current_tag(); Ok(ControlToken::Continue) } Some(x) if x.is_ascii_alphabetic() => { - slf.emitter.push_tag_name(ctostr!(x.to_ascii_lowercase())); + slf.push_tag_name(ctostr!(x.to_ascii_lowercase())); slf.temporary_buffer.push(x.to_ascii_lowercase()); Ok(ControlToken::Continue) } @@ -497,7 +497,7 @@ pub fn consume<R: Reader, E: Emitter<R>>( }, State::ScriptDataEscapedEndTagOpen => match slf.read_char()? { Some(x) if x.is_ascii_alphabetic() => { - slf.emitter.init_end_tag(&slf.reader); + slf.init_end_tag(); slf.state = State::ScriptDataEscapedEndTagName; slf.unread_char(Some(x)); Ok(ControlToken::Continue) @@ -510,21 +510,21 @@ pub fn consume<R: Reader, E: Emitter<R>>( } }, State::ScriptDataEscapedEndTagName => match slf.read_char()? { - Some(whitespace_pat!()) if slf.emitter.current_is_appropriate_end_tag_token() => { + Some(whitespace_pat!()) if slf.current_end_tag_is_appropriate() => { slf.state = State::BeforeAttributeName; Ok(ControlToken::Continue) } - Some('/') if slf.emitter.current_is_appropriate_end_tag_token() => { + Some('/') if slf.current_end_tag_is_appropriate() => { slf.state = State::SelfClosingStartTag; Ok(ControlToken::Continue) } - Some('>') if slf.emitter.current_is_appropriate_end_tag_token() => { + Some('>') if slf.current_end_tag_is_appropriate() => { slf.state = State::Data; - slf.emitter.emit_current_tag(); + slf.emit_current_tag(); Ok(ControlToken::Continue) } Some(x) if x.is_ascii_alphabetic() => { - slf.emitter.push_tag_name(ctostr!(x.to_ascii_lowercase())); + slf.push_tag_name(ctostr!(x.to_ascii_lowercase())); slf.temporary_buffer.push(x); Ok(ControlToken::Continue) } @@ -735,7 +735,7 @@ pub fn consume<R: Reader, E: Emitter<R>>( } Some('>') => { slf.state = State::Data; - slf.emitter.emit_current_tag(); + slf.emit_current_tag(); Ok(ControlToken::Continue) } None => { @@ -764,7 +764,7 @@ pub fn consume<R: Reader, E: Emitter<R>>( Some('>') => { slf.emit_error(Error::MissingAttributeValue); slf.state = State::Data; - slf.emitter.emit_current_tag(); + slf.emit_current_tag(); Ok(ControlToken::Continue) } c => { @@ -834,7 +834,7 @@ pub fn consume<R: Reader, E: Emitter<R>>( } Some('>') => { slf.state = State::Data; - slf.emitter.emit_current_tag(); + slf.emit_current_tag(); Ok(ControlToken::Continue) } Some('\0') => { @@ -867,7 +867,7 @@ pub fn consume<R: Reader, E: Emitter<R>>( } Some('>') => { slf.state = State::Data; - slf.emitter.emit_current_tag(); + slf.emit_current_tag(); Ok(ControlToken::Continue) } None => { @@ -885,7 +885,7 @@ pub fn consume<R: Reader, E: Emitter<R>>( Some('>') => { slf.emitter.set_self_closing(&slf.reader); slf.state = State::Data; - slf.emitter.emit_current_tag(); + slf.emit_current_tag(); Ok(ControlToken::Continue) } None => { |