MCPcopy Create free account
hub / github.com/WheretIB/nullc / strconv_comment

Function strconv_comment

external/pugixml/pugixml.cpp:1585–1611  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1583 #define ENDSWITH(c, e) ((c) == (e) || ((c) == 0 && endch == (e)))
1584
1585 char_t* strconv_comment(char_t* s, char_t endch)
1586 {
1587 gap g;
1588
1589 while (true)
1590 {
1591 while (!IS_CHARTYPE(*s, ct_parse_comment)) ++s;
1592
1593 if (*s == '\r') // Either a single 0x0d or 0x0d 0x0a pair
1594 {
1595 *s++ = '\n'; // replace first one with 0x0a
1596
1597 if (*s == '\n') g.push(s, 1);
1598 }
1599 else if (s[0] == '-' && s[1] == '-' && ENDSWITH(s[2], '>')) // comment ends here
1600 {
1601 *g.flush(s) = 0;
1602
1603 return s + (s[2] == '>' ? 3 : 2);
1604 }
1605 else if (*s == 0)
1606 {
1607 return 0;
1608 }
1609 else ++s;
1610 }
1611 }
1612
1613 char_t* strconv_cdata(char_t* s, char_t endch)
1614 {

Callers 1

parse_exclamationMethod · 0.85

Calls 2

pushMethod · 0.80
flushMethod · 0.45

Tested by

no test coverage detected