| 1 | use craterust-analyzer cargo xml-rs 0.8.19 crate/::readerrust-analyzer cargo xml-rs 0.8.19 reader/::errorrust-analyzer cargo xml-rs 0.8.19 reader/error/::SyntaxErrorrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#; |
| 2 | use craterust-analyzer cargo xml-rs 0.8.19 crate/::readerrust-analyzer cargo xml-rs 0.8.19 reader/::lexerrust-analyzer cargo xml-rs 0.8.19 reader/lexer/::Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#; |
| 3 | use craterust-analyzer cargo xml-rs 0.8.19 crate/::{commonrust-analyzer cargo xml-rs 0.8.19 common/::is_whitespace_charrust-analyzer cargo xml-rs 0.8.19 common/is_whitespace_char()., readerrust-analyzer cargo xml-rs 0.8.19 reader/::eventsrust-analyzer cargo xml-rs 0.8.19 reader/events/::XmlEventrust-analyzer cargo xml-rs 0.8.19 reader/events/XmlEvent#}; |
| 4 | |
| 5 | use superrust-analyzer cargo xml-rs 0.8.19 reader/parser/::{PullParserrust-analyzer cargo xml-rs 0.8.19 reader/parser/PullParser#, Resultrust-analyzer cargo xml-rs 0.8.19 reader/parser/Result#, Staterust-analyzer cargo xml-rs 0.8.19 reader/parser/State#}; |
| 6 | |
| 7 | impl PullParserrust-analyzer cargo xml-rs 0.8.19 reader/parser/PullParser# { |
| 8 | pub fn inside_cdatarust-analyzer cargo xml-rs 0.8.19 reader/parser/inside_cdata/impl#[PullParser]inside_cdata().(&mut self, t: Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Resultrust-analyzer cargo xml-rs 0.8.19 reader/parser/Result#> { |
| 9 | match t { |
| 10 | Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#::CDataEndrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#CDataEnd# => { |
| 11 | let event = if self.configrust-analyzer cargo xml-rs 0.8.19 reader/parser/PullParser#config..crust-analyzer cargo xml-rs 0.8.19 reader/config/ParserConfig2#c..cdata_to_charactersrust-analyzer cargo xml-rs 0.8.19 reader/config/ParserConfig#cdata_to_characters. { |
| 12 | // start called push_pos, but there will be no event to pop it |
| 13 | if self.bufrust-analyzer cargo xml-rs 0.8.19 reader/parser/PullParser#buf..is_emptyrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]is_empty().() { |
| 14 | self.next_posrust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]next_pos().(); |
| 15 | } |
| 16 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 17 | } else { |
| 18 | let data = self.take_bufrust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]take_buf().(); |
| 19 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(XmlEventrust-analyzer cargo xml-rs 0.8.19 reader/events/XmlEvent#::CDatarust-analyzer cargo xml-rs 0.8.19 reader/events/XmlEvent#CData#(data))) |
| 20 | }; |
| 21 | self.into_staterust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]into_state().(Staterust-analyzer cargo xml-rs 0.8.19 reader/parser/State#::OutsideTagrust-analyzer cargo xml-rs 0.8.19 reader/parser/State#OutsideTag#, event) |
| 22 | } |
| 23 | |
| 24 | Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#::Characterrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#Character#(c) if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.is_valid_xml_charrust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]is_valid_xml_char().(c) => { |
| 25 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(self.errorrust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]error().(SyntaxErrorrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#::InvalidCharacterEntityrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#InvalidCharacterEntity#(c as u32))) |
| 26 | }, |
| 27 | Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#::Characterrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#Character#(c) => { |
| 28 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().is_whitespace_charrust-analyzer cargo xml-rs 0.8.19 common/is_whitespace_char().(c) { |
| 29 | self.inside_whitespacerust-analyzer cargo xml-rs 0.8.19 reader/parser/PullParser#inside_whitespace. = false; |
| 30 | } |
| 31 | self.bufrust-analyzer cargo xml-rs 0.8.19 reader/parser/PullParser#buf..pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().(c); |
| 32 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 33 | } |
| 34 | |
| 35 | _ => unreachablerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/unreachable!!(), |
| 36 | } |
| 37 | } |
| 38 | } |