X-Git-Url: http://secure.phpeclipse.com diff --git a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/util/StringMatcher.java b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/util/StringMatcher.java index 756f28e..dc778c3 100644 --- a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/util/StringMatcher.java +++ b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/util/StringMatcher.java @@ -98,46 +98,46 @@ public class StringMatcher { * Note that for pattern like "*abc*" with leading and trailing stars, position of "abc" * is returned. For a pattern like"*??*" in text "abcdf", (1,3) is returned */ - public StringMatcher.Position find(String text, int start, int end) { - if (text == null) - throw new IllegalArgumentException(); - - int tlen = text.length(); - if (start < 0) - start = 0; - if (end > tlen) - end = tlen; - if (end < 0 || start >= end) - return null; - if (fLength == 0) - return new Position(start, start); - if (fIgnoreWildCards) { - int x = posIn(text, start, end); - if (x < 0) - return null; - return new Position(x, x + fLength); - } - - int segCount = fSegments.length; - if (segCount == 0)// pattern contains only '*'(s) - return new Position(start, end); - - int curPos = start; - int matchStart = -1; - int i; - for (i = 0; i < segCount && curPos < end; ++i) { - String current = fSegments[i]; - int nextMatch = regExpPosIn(text, curPos, end, current); - if (nextMatch < 0) - return null; - if (i == 0) - matchStart = nextMatch; - curPos = nextMatch + current.length(); - } - if (i < segCount) - return null; - return new Position(matchStart, curPos); - } +// public StringMatcher.Position find(String text, int start, int end) { +// if (text == null) +// throw new IllegalArgumentException(); +// +// int tlen = text.length(); +// if (start < 0) +// start = 0; +// if (end > tlen) +// end = tlen; +// if (end < 0 || start >= end) +// return null; +// if (fLength == 0) +// return new Position(start, start); +// if (fIgnoreWildCards) { +// int x = posIn(text, start, end); +// if (x < 0) +// return null; +// return new Position(x, x + fLength); +// } +// +// int segCount = fSegments.length; +// if (segCount == 0)// pattern contains only '*'(s) +// return new Position(start, end); +// +// int curPos = start; +// int matchStart = -1; +// int i; +// for (i = 0; i < segCount && curPos < end; ++i) { +// String current = fSegments[i]; +// int nextMatch = regExpPosIn(text, curPos, end, current); +// if (nextMatch < 0) +// return null; +// if (i == 0) +// matchStart = nextMatch; +// curPos = nextMatch + current.length(); +// } +// if (i < segCount) +// return null; +// return new Position(matchStart, curPos); +// } /** * match the given text with the pattern @@ -320,24 +320,24 @@ public class StringMatcher { * @return the starting index in the text of the pattern , or -1 if not * found */ - protected int posIn(String text, int start, int end) {// no wild card in - // pattern - int max = end - fLength; - - if (!fIgnoreCase) { - int i = text.indexOf(fPattern, start); - if (i == -1 || i > max) - return -1; - return i; - } - - for (int i = start; i <= max; ++i) { - if (text.regionMatches(true, i, fPattern, 0, fLength)) - return i; - } - - return -1; - } +// protected int posIn(String text, int start, int end) {// no wild card in +// // pattern +// int max = end - fLength; +// +// if (!fIgnoreCase) { +// int i = text.indexOf(fPattern, start); +// if (i == -1 || i > max) +// return -1; +// return i; +// } +// +// for (int i = start; i <= max; ++i) { +// if (text.regionMatches(true, i, fPattern, 0, fLength)) +// return i; +// } +// +// return -1; +// } /** * @param text, a simple regular expression that may only