(StringBuilder prefix)
| 61 | // regexp must start with, and a boolean which is true if the prefix is the |
| 62 | // entire match. The string is returned by appending to |prefix|. |
| 63 | boolean prefix(StringBuilder prefix) { |
| 64 | Inst i = skipNop(start); |
| 65 | |
| 66 | // Avoid allocation of buffer if prefix is empty. |
| 67 | if (!Inst.isRuneOp(i.op) || i.runes.length != 1) { |
| 68 | return i.op == Inst.MATCH; // (append "" to prefix) |
| 69 | } |
| 70 | |
| 71 | // Have prefix; gather characters. |
| 72 | while (Inst.isRuneOp(i.op) && i.runes.length == 1 && (i.arg & RE2.FOLD_CASE) == 0) { |
| 73 | prefix.appendCodePoint(i.runes[0]); // an int, not a byte. |
| 74 | i = skipNop(i.out); |
| 75 | } |
| 76 | return i.op == Inst.MATCH; |
| 77 | } |
| 78 | |
| 79 | // startCond() returns the leading empty-width conditions that must be true |
| 80 | // in any match. It returns -1 (all bits set) if no matches are possible. |
no test coverage detected