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

Method parseNamedClass

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

Source from the content-addressed store, hash-verified

1496 // On failure (no class of than name), throws PatternSyntaxException.
1497 // On misparse, returns false; t.pos() is undefined.
1498 private boolean parseNamedClass(StringIterator t, CharClass cc) throws PatternSyntaxException {
1499 // (Go precondition check deleted.)
1500 String cls = t.rest();
1501 int i = cls.indexOf(":]");
1502 if (i < 0) {
1503 return false;
1504 }
1505 String name = cls.substring(0, i + 2); // "[:alnum:]"
1506 t.skipString(name);
1507 CharGroup g = CharGroup.POSIX_GROUPS.get(name);
1508 if (g == null) {
1509 throw new PatternSyntaxException(ERR_INVALID_CHAR_RANGE, name);
1510 }
1511 cc.appendGroup(g, (flags & RE2.FOLD_CASE) != 0);
1512 return true;
1513 }
1514
1515 // RangeTables are represented as int[][], a list of triples (start, end,
1516 // stride).

Callers 1

parseClassMethod · 0.95

Calls 6

restMethod · 0.80
substringMethod · 0.80
skipStringMethod · 0.80
getMethod · 0.80
appendGroupMethod · 0.80
indexOfMethod · 0.45

Tested by

no test coverage detected