1 | if (expr.match(stream, mymatch)) {↵ | | 1 | if (expr.match(stream,mymatch)) {↵
|
2 | mymatch.end[0] = mymatch.index;↵ | | 2 | mymatch.end[0] = mymatch.index;↵
|
3 | mymatch.finish(stream);↵ | | 3 | mymatch.finish(stream);↵
|
4 | stream.move(mymatch.toString().length());↵ | | 4 | stream.move(mymatch.toString().length());↵
|
5 | offset += mymatch.toString().length();↵ | | 5 | offset += mymatch.toString().length();↵
|
6 | buffer = mymatch.substituteInto(replace);↵ | | 6 | buffer = mymatch.substituteInto(replace);↵
|
7 | bufpos = 1;↵ | | 7 | bufpos = 1;↵
|
|
8 | // This is prone to infinite loops if replace string turns out empty.↵ | | |
|
9 | if (buffer.length() > 0) {↵ | | 8 | if (buffer.length() > 0) {↵
|
10 | return buffer.charAt(0);↵ | | 9 | return buffer.charAt(0);↵
|
11 | | | 10 |
|