(StringIterator t, CharClass cc)
| 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). |
no test coverage detected