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

Method loop

java/com/google/re2j/Compiler.java:125–137  ·  view source on GitHub ↗
(Frag f1, boolean nongreedy)

Source from the content-addressed store, hash-verified

123 // (When f1 can match an empty string, f1* must be implemented as (f1+)?
124 // to get the priority match order correct.)
125 private Frag loop(Frag f1, boolean nongreedy) {
126 Frag f = newInst(Inst.ALT);
127 Inst i = prog.getInst(f.i);
128 if (nongreedy) {
129 i.arg = f1.i;
130 f.out = f.i << 1;
131 } else {
132 i.out = f1.i;
133 f.out = f.i << 1 | 1;
134 }
135 prog.patch(f1.out, f.i);
136 return f;
137 }
138
139 // Given a fragment for a, returns a fragment for a? or a?? (if nongreedy)
140 private Frag quest(Frag f1, boolean nongreedy) {

Callers 2

starMethod · 0.95
plusMethod · 0.95

Calls 3

newInstMethod · 0.95
getInstMethod · 0.80
patchMethod · 0.80

Tested by

no test coverage detected