improved PHP Scanner
authorkhartlage <khartlage>
Sun, 2 Mar 2003 12:26:49 +0000 (12:26 +0000)
committerkhartlage <khartlage>
Sun, 2 Mar 2003 12:26:49 +0000 (12:26 +0000)
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPContentOutlinePage.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPParserAction.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/HTMLWordExtractor.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPDoubleClickSelector.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPWordExtractor.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/util/HTMLWordDetector.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/util/PHPWordDetector.java

index 5b53646..bdc86d8 100644 (file)
@@ -82,7 +82,7 @@ public class PHPContentOutlinePage extends ContentOutlinePage {
     //      StringBuffer identifier = new StringBuffer();
     //      while (i < textLength) {
     //        c = text.charAt(i++);
-    //        if (Character.isJavaIdentifierPart(c) || (c == '$')) {
+    //        if (Scanner.isPHPIdentifierPart(c) || (c == '$')) {
     //          identifier.append(c);
     //        } else if ((i == firstIndex + 1) && (c == '$')) {
     //          identifier.append(c);
index 9ba7e1a..774fbf1 100644 (file)
@@ -138,7 +138,7 @@ public class PHPParserAction extends TextEditorAction {
   //    identifier.append((char) c);
   //    try {
   //      while ((c = iStream.read()) != (-1)) {
-  //        if (Character.isJavaIdentifierPart((char) c)) {
+  //        if (Scanner.isPHPIdentifierPart((char) c)) {
   //          identifier.append((char) c);
   //          //        } else if ((i == 0) && (c == '$')) {
   //          //          identifier.append((char)c);
index a3bfc0b..e4e0b14 100644 (file)
@@ -11,6 +11,8 @@ Contributors:
 **********************************************************************/
 package net.sourceforge.phpeclipse.phpeditor.php;
 
+import net.sourceforge.phpdt.internal.compiler.parser.Scanner;
+
 import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.swt.graphics.Point;
@@ -39,7 +41,7 @@ public class HTMLWordExtractor {
 
       while (position >= 0) {
         character = document.getChar(position);
-        if (!Character.isJavaIdentifierPart(character))
+        if (!Scanner.isPHPIdentifierPart(character))
           break;
         --position;
       }
index faa4b3c..52bff9c 100644 (file)
@@ -12,6 +12,8 @@ Contributors:
 package net.sourceforge.phpeclipse.phpeditor.php;
 
 
+import net.sourceforge.phpdt.internal.compiler.parser.Scanner;
+
 import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.ITextDoubleClickStrategy;
@@ -124,7 +126,7 @@ public class PHPDoubleClickSelector implements ITextDoubleClickStrategy {
 
                        while (pos >= 0) {
                                c = doc.getChar(pos);
-                               if (!Character.isJavaIdentifierPart(c) && (c != '$')) {
+                               if (!Scanner.isPHPIdentifierPart(c) && (c != '$')) {
                                        break;
                                }
                                --pos;
@@ -137,7 +139,7 @@ public class PHPDoubleClickSelector implements ITextDoubleClickStrategy {
 
                        while (pos < length) {
                                c = doc.getChar(pos);
-                               if (!Character.isJavaIdentifierPart(c) && (c != '$'))
+                               if (!Scanner.isPHPIdentifierPart(c) && (c != '$'))
                                        break;
                                ++pos;
                        }
index 92266eb..4fd5ea3 100644 (file)
@@ -11,6 +11,8 @@ Contributors:
 **********************************************************************/
 package net.sourceforge.phpeclipse.phpeditor.php;
 
+import net.sourceforge.phpdt.internal.compiler.parser.Scanner;
+
 import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.swt.graphics.Point;
@@ -39,7 +41,7 @@ public class PHPWordExtractor {
 
                        while (position >= 0) {
                                character = document.getChar(position);
-                               if (!Character.isJavaIdentifierPart(character) && (character != '$'))
+                               if (!Scanner.isPHPIdentifierPart(character) && (character != '$'))
                                        break;
                                --position;
                        }
@@ -51,7 +53,7 @@ public class PHPWordExtractor {
 
                        while (position < length) {
                                character = document.getChar(position);
-                               if (!Character.isJavaIdentifierPart(character) && (character != '$'))
+                               if (!Scanner.isPHPIdentifierPart(character) && (character != '$'))
                                        break;
                                ++position;
                        }
index 059f56a..6aada83 100644 (file)
@@ -12,6 +12,8 @@ Contributors:
     Klaus Hartlage - www.eclipseproject.de
 **********************************************************************/
 
+import net.sourceforge.phpdt.internal.compiler.parser.Scanner;
+
 import org.eclipse.jface.text.rules.IWordDetector;
 
 /**
@@ -23,7 +25,7 @@ public class HTMLWordDetector implements IWordDetector {
         * Method declared on IWordDetector.
         */
        public boolean isWordPart(char character) {
-               return Character.isJavaIdentifierPart(character)||(character=='/')||(character=='>');
+               return Scanner.isPHPIdentifierPart(character)||(character=='/')||(character=='>');
        }
        
        /* (non-Javadoc)
index 99e036f..eada1ba 100644 (file)
@@ -11,6 +11,8 @@ Contributors:
 **********************************************************************/
 package net.sourceforge.phpeclipse.phpeditor.util;
 
+import net.sourceforge.phpdt.internal.compiler.parser.Scanner;
+
 import org.eclipse.jface.text.rules.IWordDetector;
 
 /**
@@ -22,13 +24,13 @@ public class PHPWordDetector implements IWordDetector {
         * Method declared on IWordDetector.
         */
        public boolean isWordPart(char character) {
-               return Character.isJavaIdentifierPart(character);
+               return Scanner.isPHPIdentifierPart(character);
        }
        
        /* (non-Javadoc)
         * Method declared on IWordDetector.
         */
        public boolean isWordStart(char character) {
-               return (character=='$')||Character.isJavaIdentifierStart(character);
+               return (character=='$')||Scanner.isPHPIdentifierStart(character);
        }
 }