removed the $ in the name of the variables
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / parser / Parser.java
index 44568b9..11b48d9 100644 (file)
@@ -1437,7 +1437,8 @@ public class Parser extends PHPParserSuperclass implements ITerminalSymbols {
           if (token == TokenNameVariable
             && store.getBoolean(PHPeclipsePlugin.PHP_OUTLINE_VAR)) {
             ident = scanner.getCurrentIdentifierSource();
-            String variableName = new String(ident);
+            //substring(1) added because PHPVarDeclaration doesn't need the $ anymore
+            String variableName = new String(ident).substring(1);
             outlineInfo.addVariable(variableName);
             getNextToken();
             if (token != TokenNameSEMICOLON) {
@@ -1979,6 +1980,10 @@ public class Parser extends PHPParserSuperclass implements ITerminalSymbols {
         }
       }
     } else {
+      if (token > TokenNameKEYWORD) {
+        throwSyntaxError(
+          "Don't use keyword for class declaration [" + token + "].");
+      }
       throwSyntaxError("Class name expected after keyword 'class'.");
     }
   }
@@ -2070,6 +2075,12 @@ public class Parser extends PHPParserSuperclass implements ITerminalSymbols {
       } else {
         getNextToken();
       }
+    } else {
+      if (token > TokenNameKEYWORD) {
+        throwSyntaxError(
+          "Don't use keyword for function declaration [" + token + "].");
+      }
+      throwSyntaxError("Function name expected after keyword 'function'.");
     }
   }
   //