diff options
Diffstat (limited to 'libjava/gnu/regexp/RETokenRepeated.java')
-rw-r--r-- | libjava/gnu/regexp/RETokenRepeated.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libjava/gnu/regexp/RETokenRepeated.java b/libjava/gnu/regexp/RETokenRepeated.java index 8c789271220..821e4c55c0f 100644 --- a/libjava/gnu/regexp/RETokenRepeated.java +++ b/libjava/gnu/regexp/RETokenRepeated.java @@ -44,6 +44,7 @@ final class RETokenRepeated extends REToken { private REToken token; private int min,max; private boolean stingy; + private boolean possessive; RETokenRepeated(int subIndex, REToken token, int min, int max) { super(subIndex); @@ -61,6 +62,16 @@ final class RETokenRepeated extends REToken { boolean isStingy() { return stingy; } + + /** Sets possessive matching mode to true. */ + void makePossessive() { + possessive = true; + } + + /** Queries if this token has possessive matching enabled. */ + boolean isPossessive() { + return possessive; + } /** * The minimum length of a repeated token is the minimum length @@ -172,6 +183,8 @@ final class RETokenRepeated extends REToken { } } // else did not match rest of the tokens, try again on smaller sample + // or break out when performing possessive matching + if (possessive) break; } if (allResults != null) { mymatch.assignFrom(allResults); // does this get all? |