Parses a character inside a character class. There are fewer special characters here than in the rest of the regexp. Sets *s to span the remainder of the string. Sets *rp to the character.
| 1856 | // Sets *s to span the remainder of the string. |
| 1857 | // Sets *rp to the character. |
| 1858 | bool Regexp::ParseState::ParseCCCharacter(StringPiece* s, Rune *rp, |
| 1859 | const StringPiece& whole_class, |
| 1860 | RegexpStatus* status) { |
| 1861 | if (s->empty()) { |
| 1862 | status->set_code(kRegexpMissingBracket); |
| 1863 | status->set_error_arg(whole_class); |
| 1864 | return false; |
| 1865 | } |
| 1866 | |
| 1867 | // Allow regular escape sequences even though |
| 1868 | // many need not be escaped in this context. |
| 1869 | if ((*s)[0] == '\\') |
| 1870 | return ParseEscape(s, rp, status, rune_max_); |
| 1871 | |
| 1872 | // Otherwise take the next rune. |
| 1873 | return StringPieceToRune(rp, s, status) >= 0; |
| 1874 | } |
| 1875 | |
| 1876 | // Parses a character class character, or, if the character |
| 1877 | // is followed by a hyphen, parses a character class range. |
nothing calls this directly
no test coverage detected