diff options
| author | Ito Kazumitsu <kaz@maczuka.gcd.org> | 2006-08-20 14:47:30 +0000 |
|---|---|---|
| committer | Ito Kazumitsu <kaz@maczuka.gcd.org> | 2006-08-20 14:47:30 +0000 |
| commit | cc4b3d34f0b1854867f160727dcfc78bcb90442c (patch) | |
| tree | 0e92990411754ff5bab246005a48417fff21b683 /gnu/java/util/regex/CharIndexed.java | |
| parent | 94103ccfadf1a006fbd18e4751e5a8394403aed4 (diff) | |
| download | classpath-cc4b3d34f0b1854867f160727dcfc78bcb90442c.tar.gz | |
2006-08-20 Ito Kazumitsu <kaz@maczuka.gcd.org>
Fixes bug #28412
* gnu/java/util/regex/CharIndexed.java(move1, setHitEnd, hitEnd):
New methods.
* gnu/java/util/regex/CharIndexedCharSequence.java,
gnu/java/util/regex/CharIndexedInputStream.java: Implemented the
new methods above.
* gnu/java/util/regex/RE.java(REG_FIX_STARTING_POSITION): New flag,
(match): call the new method setHitEnd of the input,
(getMatchImpl): Handle the new flag REG_FIX_STARTING_POSITION,
Some optimization commented out, Use CharIndexed#move1 instead of move.
* gnu/java/util/regex/REMatch.java: Made some debugging methods public.
* gnu/java/util/regex/REToken.java(match): The method body has been
moved to an internal private method, (matchFake): New method,
(setHitEnd): New method.
* gnu/java/util/regex/RETokenChar.java(matchThis): Call setHitEnd
if the match is not complete, (matchOneString): Count the number of
characters which matched the pattern.
* gnu/java/util/regex/RETokenEnd.java(fake): New field,
(setFake): New method, (match): Call super.match or super.matchFake.
* gnu/java/util/regex/RETokenEndSub.java(setHitEnd): New method.
* gnu/java/util/regex/RETokenOneOf.java(match): call the new method
setHitEnd of the input,
* gnu/java/util/regex/RETokenRepeated.java(match): Likewise.
* java/util/regex/Matcher.java(lookingAt, match): Use the new flag
RE.REG_FIX_STARTING_POSITION, (hitEnd, toString): New methods.
Diffstat (limited to 'gnu/java/util/regex/CharIndexed.java')
| -rw-r--r-- | gnu/java/util/regex/CharIndexed.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gnu/java/util/regex/CharIndexed.java b/gnu/java/util/regex/CharIndexed.java index 6cd857e3b..27e07b2f8 100644 --- a/gnu/java/util/regex/CharIndexed.java +++ b/gnu/java/util/regex/CharIndexed.java @@ -77,6 +77,13 @@ public interface CharIndexed { boolean move(int index); /** + * Shifts the input buffer by a given number of positions. Returns + * true if the new cursor position is valid or cursor position is at + * the end of input. + */ + boolean move1(int index); // I cannot think of a better name for this. + + /** * Returns true if the most recent move() operation placed the cursor * position at a valid position in the input. */ @@ -105,6 +112,16 @@ public interface CharIndexed { REMatch getLastMatch(); /** + * Sets the information used for hitEnd(). + */ + void setHitEnd(REMatch match); + + /** + * Returns whether the matcher has hit the end of input. + */ + boolean hitEnd(); + + /** * Returns the anchor. */ int getAnchor(); |
