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

Method context

java/com/google/re2j/MachineInput.java:141–165  ·  view source on GitHub ↗
(int pos)

Source from the content-addressed store, hash-verified

139 }
140
141 @Override
142 int context(int pos) {
143 pos += this.start;
144 int r1 = -1;
145 if (pos > this.start && pos <= this.end) {
146 int start = pos - 1;
147 r1 = b[start--];
148 if (r1 >= 0x80) { // decode UTF-8
149 // Find start, up to 4 bytes earlier.
150 int lim = pos - 4;
151 if (lim < this.start) {
152 lim = this.start;
153 }
154 while (start >= lim && (b[start] & 0xC0) == 0x80) { // 10xxxxxx
155 start--;
156 }
157 if (start < this.start) {
158 start = this.start;
159 }
160 r1 = step(start) >> 3;
161 }
162 }
163 int r2 = pos < this.end ? (step(pos) >> 3) : -1;
164 return Utils.emptyOpContext(r1, r2);
165 }
166
167 @Override
168 int endPos() {

Callers

nothing calls this directly

Calls 2

stepMethod · 0.95
emptyOpContextMethod · 0.95

Tested by

no test coverage detected