MCPcopy Create free account
hub / github.com/google/re2j / parsePerlClassEscape

Method parsePerlClassEscape

java/com/google/re2j/Parser.java:1474–1490  ·  view source on GitHub ↗
(StringIterator t, CharClass cc)

Source from the content-addressed store, hash-verified

1472 // to cc and returns true. The iterator is advanced past the escape
1473 // on success, undefined on failure, in which case false is returned.
1474 private boolean parsePerlClassEscape(StringIterator t, CharClass cc) {
1475 int beforePos = t.pos();
1476 if ((flags & RE2.PERL_X) == 0
1477 || !t.more()
1478 || t.pop() != '\\'
1479 || // consume '\\'
1480 !t.more()) {
1481 return false;
1482 }
1483 t.pop(); // e.g. advance past 'd' in "\\d"
1484 CharGroup g = CharGroup.PERL_GROUPS.get(t.from(beforePos));
1485 if (g == null) {
1486 return false;
1487 }
1488 cc.appendGroup(g, (flags & RE2.FOLD_CASE) != 0);
1489 return true;
1490 }
1491
1492 // parseNamedClass parses a leading POSIX named character class like
1493 // [:alnum:] from the beginning of t. If one is present, it appends the

Callers 2

parseInternalMethod · 0.95
parseClassMethod · 0.95

Calls 6

posMethod · 0.80
moreMethod · 0.80
getMethod · 0.80
fromMethod · 0.80
appendGroupMethod · 0.80
popMethod · 0.45

Tested by

no test coverage detected