summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIto Kazumitsu <kaz@maczuka.gcd.org>2006-01-17 15:09:10 +0000
committerIto Kazumitsu <kaz@maczuka.gcd.org>2006-01-17 15:09:10 +0000
commit53296c4897ad2dbfeb14df9a5c241f2d68c9febe (patch)
tree364bc82965c784c9a792cf2a349a13e174428b9a
parent6926ed289b351cd90599a30b357af901b037a77c (diff)
downloadclasspath-53296c4897ad2dbfeb14df9a5c241f2d68c9febe.tar.gz
2006-01-17 Ito Kazumitsu <kaz@maczuka.gcd.org>
Fixes bug #25817 * gnu/regexp/RETokenRange.java(constructor): Keep lo and hi as they are. (match): Changed the case insensitive comparison.
-rw-r--r--ChangeLog9
-rw-r--r--gnu/regexp/RETokenRange.java17
2 files changed, 21 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index f9d756366..b6c2a480d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,13 @@
2006-01-17 Ito Kazumitsu <kaz@maczuka.gcd.org>
- *gnu/regexp/RETokenChar.java(chain):
+ Fixes bug #25817
+ * gnu/regexp/RETokenRange.java(constructor):
+ Keep lo and hi as they are.
+ (match): Changed the case insensitive comparison.
+
+2006-01-17 Ito Kazumitsu <kaz@maczuka.gcd.org>
+
+ * gnu/regexp/RETokenChar.java(chain):
Do not concatenate tokens whose insens flags are diffent.
2006-01-17 Roman Kennke <kennke@aicas.com>
diff --git a/gnu/regexp/RETokenRange.java b/gnu/regexp/RETokenRange.java
index dadaf2d80..2da67835b 100644
--- a/gnu/regexp/RETokenRange.java
+++ b/gnu/regexp/RETokenRange.java
@@ -43,8 +43,9 @@ final class RETokenRange extends REToken {
RETokenRange(int subIndex, char lo, char hi, boolean ins) {
super(subIndex);
- this.lo = (insens = ins) ? Character.toLowerCase(lo) : lo;
- this.hi = ins ? Character.toLowerCase(hi) : hi;
+ insens = ins;
+ this.lo = lo;
+ this.hi = hi;
}
int getMinimumLength() {
@@ -54,8 +55,16 @@ final class RETokenRange extends REToken {
boolean match(CharIndexed input, REMatch mymatch) {
char c = input.charAt(mymatch.index);
if (c == CharIndexed.OUT_OF_BOUNDS) return false;
- if (insens) c = Character.toLowerCase(c);
- if ((c >= lo) && (c <= hi)) {
+ boolean matches = (c >= lo) && (c <= hi);
+ if (! matches && insens) {
+ char c1 = Character.toLowerCase(c);
+ matches = (c1 >= lo) && (c1 <= hi);
+ if (!matches) {
+ c1 = Character.toUpperCase(c);
+ matches = (c1 >= lo) && (c1 <= hi);
+ }
+ }
+ if (matches) {
++mymatch.index;
return next(input, mymatch);
}