MCPcopy Create free account
hub / github.com/Florob/RustyXML / in_cdata_opening

Method in_cdata_opening

src/parser.rs:576–589  ·  view source on GitHub ↗

Opening sequence of Event::CDATA 'C' 'D' 'A' 'T' 'A' '[' => InCDATA

(&mut self, c: char)

Source from the content-addressed store, hash-verified

574 // Opening sequence of Event::CDATA
575 // 'C' 'D' 'A' 'T' 'A' '[' => InCDATA
576 fn in_cdata_opening(&mut self, c: char) -> Result<Option<Event>, ParserError> {
577 static CDATA_PATTERN: [char; 6] = ['C', 'D', 'A', 'T', 'A', '['];
578 if c == CDATA_PATTERN[self.level as usize] {
579 self.level += 1;
580 } else {
581 return self.error("Invalid CDATA opening sequence");
582 }
583
584 if self.level == 6 {
585 self.level = 0;
586 self.st = State::InCDATA;
587 }
588 Ok(None)
589 }
590
591 // Inside CDATA
592 // ']' ']' '>' => OutsideTag, producing Event::CDATA

Callers 1

parse_characterMethod · 0.80

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected