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

Method appendNegatedClass

java/com/google/re2j/CharClass.java:184–198  ·  view source on GitHub ↗
(int[] x)

Source from the content-addressed store, hash-verified

182 // appendNegatedClass() append the negation of the class |x| to this
183 // CharClass. It assumes |x| is clean. Does not mutate |x|.
184 CharClass appendNegatedClass(int[] x) {
185 int nextLo = 0;
186 for (int i = 0; i < x.length; i += 2) {
187 int lo = x[i];
188 int hi = x[i + 1];
189 if (nextLo <= lo - 1) {
190 appendRange(nextLo, lo - 1);
191 }
192 nextLo = hi + 1;
193 }
194 if (nextLo <= Unicode.MAX_RUNE) {
195 appendRange(nextLo, Unicode.MAX_RUNE);
196 }
197 return this;
198 }
199
200 // appendTable() appends the Unicode range table |table| to this CharClass.
201 // Does not mutate |table|.

Callers 2

appendClassWithSignMethod · 0.95
testAppendClassMethod · 0.80

Calls 1

appendRangeMethod · 0.95

Tested by 1

testAppendClassMethod · 0.64