this.initializeScanner();
}
/**
- * Class Constructor.
+ * ClassDeclaration Constructor.
*
*@param s
*@param sess Description of Parameter
private void parseDeclarations(
PHPOutlineInfo outlineInfo,
- PHPSegmentWithChildren current,
+ OutlineableWithChildren current,
boolean goBack) {
char[] ident;
// PHPClassDeclaration current = (PHPClassDeclaration) stack.peek();
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) {
if (token == TokenNameIdentifier) {
getNextToken();
} else {
- throwSyntaxError("Class name expected after keyword 'extends'.");
+ throwSyntaxError("ClassDeclaration name expected after keyword 'extends'.");
}
}
} else {
- throwSyntaxError("Class name expected after keyword 'class'.");
+ if (token > TokenNameKEYWORD) {
+ throwSyntaxError(
+ "Don't use keyword for class declaration [" + token + "].");
+ }
+ throwSyntaxError("ClassDeclaration name expected after keyword 'class'.");
}
}
} else {
getNextToken();
}
+ } else {
+ if (token > TokenNameKEYWORD) {
+ throwSyntaxError(
+ "Don't use keyword for function declaration [" + token + "].");
+ }
+ throwSyntaxError("Function name expected after keyword 'function'.");
}
}
//