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

Method matchRune

java/com/google/re2j/Parser.java:1192–1209  ·  view source on GitHub ↗
(Regexp re, int r)

Source from the content-addressed store, hash-verified

1190
1191 // does re match r?
1192 private static boolean matchRune(Regexp re, int r) {
1193 switch (re.op) {
1194 case LITERAL:
1195 return re.runes.length == 1 && re.runes[0] == r;
1196 case CHAR_CLASS:
1197 for (int i = 0; i < re.runes.length; i += 2) {
1198 if (re.runes[i] <= r && r <= re.runes[i + 1]) {
1199 return true;
1200 }
1201 }
1202 return false;
1203 case ANY_CHAR_NOT_NL:
1204 return r != '\n';
1205 case ANY_CHAR:
1206 return true;
1207 }
1208 return false;
1209 }
1210
1211 // parseVerticalBar handles a | in the input.
1212 private void parseVerticalBar() {

Callers 1

mergeCharClassMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected