misc changes
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / phpeditor / phpparser / PHPParser.java
index 9ccac8e..5c79a17 100644 (file)
@@ -1334,10 +1334,15 @@ public class PHPParser extends PHPKeywords {
 
     ident.append(ch);
     if (ch == '$') {
+      getChar();
+      // attention recursive call:
+      getIdentifier();
       token = TT_VARIABLE;
+      return;
     } else {
       token = TT_IDENTIFIER;
     }
+
     getChar();
     while ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9') || (ch == '_')) {
       ident.append(ch);
@@ -1346,6 +1351,8 @@ public class PHPParser extends PHPKeywords {
     identifier = ident.toString();
     chIndx--;
 
+    // determine if this identitfer is a keyword
+    // @todo improve this in future version 
     Integer i = (Integer) keywordMap.get(identifier.toLowerCase());
     if (i != null) {
       token = i.intValue();
@@ -1790,6 +1797,9 @@ public class PHPParser extends PHPKeywords {
           getNextToken();
         } else if (token == TT_function) {
           getNextToken();
+          if (token == TT_AMPERSAND) {
+            getNextToken();
+          }
           if (token == TT_IDENTIFIER) {
             outlineInfo.addVariable(identifier);
             current.add(new PHPFunctionDeclaration(current, identifier, chIndx - identifier.length()));