import java.util.Arrays;
+import net.sourceforge.phpdt.internal.compiler.parser.Scanner;
import net.sourceforge.phpdt.internal.core.Assert;
import net.sourceforge.phpdt.internal.ui.text.SmartBackspaceManager.UndoSpec;
import net.sourceforge.phpdt.ui.PreferenceConstants;
return -1;
ch= document.getChar(p);
- if (Character.isJavaIdentifierPart(ch) || ch == ']' || ch == '[')
+ if (Scanner.isPHPIdentifierPart(ch) || ch == ']' || ch == '[')
return offset;
} catch (BadLocationException e) {
if (pos < 0)
return false;
- if (pos != 0 && Character.isJavaIdentifierPart(text.charAt(pos - 1)))
+ if (pos != 0 && Scanner.isPHPIdentifierPart(text.charAt(pos - 1)))
return false;
- if (pos + 3 < length && Character.isJavaIdentifierPart(text.charAt(pos + 3)))
+ if (pos + 3 < length && Scanner.isPHPIdentifierPart(text.charAt(pos + 3)))
return false;
return true;
/**
* Checks whether code>document</code> contains the <code>String</code> <code>like</code> such
* that its last character is at <code>position</code>. If <code>like</code> starts with a
- * identifier part (as determined by {@link Character#isJavaIdentifier(char)}), it is also made
+ * identifier part (as determined by {@link Scanner#isPHPIdentifierPart(char)}), it is also made
* sure that <code>like</code> is preceded by some non-identifier character or stands at the
* document start.
*
if (!like.equals(document.get(position - length + 1, length)))
return false;
- if (position >= length && Character.isJavaIdentifierPart(like.charAt(0)) && Character.isJavaIdentifierPart(document.getChar(position - length)))
+ if (position >= length && Scanner.isPHPIdentifierPart(like.charAt(0)) && Scanner.isPHPIdentifierPart(document.getChar(position - length)))
return false;
} catch (BadLocationException e) {
while (p >= 0) {
char ch= document.getChar(p);
- if (Character.isJavaIdentifierPart(ch)) {
+ if (Scanner.isPHPIdentifierPart(ch)) {
p--;
continue;
}
/* searching for (^|\s)for(\s|$) */
int forPos= line.indexOf("for"); //$NON-NLS-1$
if (forPos != -1) {
- if ((forPos == 0 || !Character.isJavaIdentifierPart(line.charAt(forPos - 1))) && (line.length() == forPos + 3 || !Character.isJavaIdentifierPart(line.charAt(forPos + 3))))
+ if ((forPos == 0 || !Scanner.isPHPIdentifierPart(line.charAt(forPos - 1))) && (line.length() == forPos + 3 || !Scanner.isPHPIdentifierPart(line.charAt(forPos + 3))))
return true;
}
return false;