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

Method startCond

java/com/google/re2j/Prog.java:81–102  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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.
81 int startCond() {
82 int flag = 0; // bitmask of EMPTY_* flags
83 int pc = start;
84 loop:
85 for (; ; ) {
86 Inst i = inst[pc];
87 switch (i.op) {
88 case Inst.EMPTY_WIDTH:
89 flag |= i.arg;
90 break;
91 case Inst.FAIL:
92 return -1;
93 case Inst.CAPTURE:
94 case Inst.NOP:
95 break; // skip
96 default:
97 break loop;
98 }
99 pc = i.out;
100 }
101 return flag;
102 }
103
104 // --- Patch list ---
105

Callers 1

RE2Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected