summaryrefslogtreecommitdiff
path: root/libjava/classpath/gnu/regexp/RETokenLookAhead.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/gnu/regexp/RETokenLookAhead.java')
-rw-r--r--libjava/classpath/gnu/regexp/RETokenLookAhead.java27
1 files changed, 8 insertions, 19 deletions
diff --git a/libjava/classpath/gnu/regexp/RETokenLookAhead.java b/libjava/classpath/gnu/regexp/RETokenLookAhead.java
index b44dfa50c4f..009872c2f2d 100644
--- a/libjava/classpath/gnu/regexp/RETokenLookAhead.java
+++ b/libjava/classpath/gnu/regexp/RETokenLookAhead.java
@@ -1,5 +1,5 @@
/* gnu/regexp/RETokenLookAhead.java
- Copyright (C) 1998-2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -56,28 +56,17 @@ final class RETokenLookAhead extends REToken
return 0;
}
- boolean match(CharIndexed input, REMatch mymatch)
+ REMatch matchThis(CharIndexed input, REMatch mymatch)
{
REMatch trymatch = (REMatch)mymatch.clone();
- REMatch trymatch1 = (REMatch)mymatch.clone();
- REMatch newMatch = null;
if (re.match(input, trymatch)) {
- if (negative) return false;
- if (next(input, trymatch1))
- newMatch = trymatch1;
+ if (negative) return null;
+ trymatch.index = mymatch.index;
+ return trymatch;
}
-
- if (newMatch != null) {
- if (negative) return false;
- //else
- mymatch.assignFrom(newMatch);
- return true;
- }
- else { // no match
- if (negative)
- return next(input, mymatch);
- //else
- return false;
+ else {
+ if (negative) return mymatch;
+ return null;
}
}