1 | if (dx > 0) {↵ | | 1 | if (dx > 0) {↵
|
2 | if (offset >= con.limit)↵ | | 2 | if (offset >= con.limit)↵
|
3 | return -1;↵ | | 3 | return -1;↵
|
4 | int ch = target .charAt( offset ) ;↵ | | 4 | int ch = target .setIndex( offset ) ;↵
|
5 | if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)↵ | | 5 | if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)↵
|
6 | ch = REUtil.composeFromSurrogates(ch, target .charAt( ++offset ) );↵ | | 6 | ch = REUtil.composeFromSurrogates(ch, target .setIndex( ++offset ) );↵
|
7 | RangeToken tok = op.getToken();↵ | | 7 | RangeToken tok = op.getToken();↵
|
8 | if (isSet(opts, IGNORE_CASE)) {↵ | | 8 | if (isSet(opts, IGNORE_CASE)) {↵
|
9 | tok = tok.getCaseInsensitiveToken();↵ | | 9 | tok = tok.getCaseInsensitiveToken();↵
|
10 | if (!tok.match(ch)) {↵ | | 10 | if (!tok.match(ch)) {↵
|
11 | if (ch >= 0x10000) return -1;↵ | | 11 | if (ch >= 0x10000) return -1;↵
|
12 | char uch;↵ | | 12 | char uch;↵
|
13 | if (!tok.match(uch = Character.toUpperCase((char)ch))↵ | | 13 | if (!tok.match(uch = Character.toUpperCase((char)ch))↵
|
14 | && !tok.match(Character.toLowerCase(uch)))↵ | | 14 | && !tok.match(Character.toLowerCase(uch)))↵
|
15 | return -1;↵ | | 15 | return -1;↵
|
16 | }↵ | | 16 | }↵
|
17 | } else {↵ | | 17 | } else {↵
|
18 | if (!tok.match(ch)) return -1;↵ | | 18 | if (!tok.match(ch)) return -1;↵
|
19 | }↵ | | 19 | }↵
|
20 | offset ++;↵ | | 20 | offset ++;↵
|
21 | } else {↵ | | 21 | } else {↵
|
22 | int o1 = offset-1;↵ | | 22 | int o1 = offset-1;↵
|
23 | if (o1 >= con.limit || o1 < 0)↵ | | 23 | if (o1 >= con.limit || o1 < 0)↵
|
24 | return -1;↵ | | 24 | return -1;↵
|
25 | int ch = target .charAt( o1 ) ;↵ | | 25 | int ch = target .setIndex( o1 ) ;↵
|
26 | if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)↵ | | 26 | if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)↵
|
27 | ch = REUtil.composeFromSurrogates( target .charAt( --o1 ) , ch);↵ | | 27 | ch = REUtil.composeFromSurrogates( target .setIndex( --o1 ) , ch);↵
|
28 | RangeToken tok = op.getToken();↵ | | 28 | RangeToken tok = op.getToken();↵
|
29 | if (isSet(opts, IGNORE_CASE)) {↵ | | 29 | if (isSet(opts, IGNORE_CASE)) {↵
|
30 | tok = tok.getCaseInsensitiveToken();↵ | | 30 | tok = tok.getCaseInsensitiveToken();↵
|
31 | if (!tok.match(ch)) {↵ | | 31 | if (!tok.match(ch)) {↵
|
32 | if (ch >= 0x10000) return -1;↵ | | 32 | if (ch >= 0x10000) return -1;↵
|
33 | char uch;↵ | | 33 | char uch;↵
|
34 | if (!tok.match(uch = Character.toUpperCase((char)ch))↵ | | 34 | if (!tok.match(uch = Character.toUpperCase((char)ch))↵
|
35 | && !tok.match(Character.toLowerCase(uch)))↵ | | 35 | && !tok.match(Character.toLowerCase(uch)))↵
|
36 | return -1;↵ | | 36 | return -1;↵
|
37 | }↵ | | 37 | }↵
|
38 | } else {↵ | | 38 | } else {↵
|
39 | if (!tok.match(ch)) return -1;↵ | | 39 | if (!tok.match(ch)) return -1;↵
|
40 | }↵ | | 40 | }↵
|
41 | offset = o1;↵ | | 41 | offset = o1;↵
|
42 | | | 42 |
|