expressionList();
if (token == TokenNameSEMICOLON) {
getNextToken();
-// if (token != TokenNameINLINE_HTML) {
-// // TODO should this become a configurable warning?
-// reportSyntaxError("Probably '?>' expected after PHP short tag expression (only the first expression will be echoed).");
-// }
+ // if (token != TokenNameINLINE_HTML) {
+ // // TODO should this become a configurable warning?
+ // reportSyntaxError("Probably '?>' expected after PHP short tag
+ // expression (only the first expression will be echoed).");
+ // }
} else {
if (token != TokenNameINLINE_HTML) {
throwSyntaxError("';' expected after PHP short tag '<?=' expression.");
// | non_empty_parameter_list ',' optional_class_type T_VARIABLE '='
// static_scalar
char[] typeIdentifier = null;
- if (token == TokenNameIdentifier || token == TokenNameVariable || token == TokenNameAND) {
+ if (token == TokenNameIdentifier || token == TokenNamearray || token == TokenNameVariable || token == TokenNameAND) {
HashSet set = peekVariableSet();
while (true) {
- if (token == TokenNameIdentifier) {
+ if (token == TokenNameIdentifier || token == TokenNamearray) {// feature req. #1254275
typeIdentifier = scanner.getCurrentIdentifierSource();
getNextToken();
}
if (Scanner.TRACE) {
System.out.println("TRACE: expr()");
}
- return expr_without_variable(true);
+ return expr_without_variable(true,null);
// }
}
- private Expression expr_without_variable(boolean only_variable) {
+ private Expression expr_without_variable(boolean only_variable, UninitializedVariableHandler initHandler) {
int exprSourceStart = scanner.getCurrentTokenStartPosition();
int exprSourceEnd = scanner.getCurrentTokenEndPosition();
Expression expression = new Expression();
&& token != TokenNameLEFT_SHIFT_EQUAL) {
FieldReference ref = (FieldReference) lhs;
if (!containsVariableSet(ref.token)) {
- problemReporter.uninitializedLocalVariable(new String(ref.token), ref.sourceStart(), ref.sourceEnd(),
+ if (null==initHandler || initHandler.reportError()) {
+ problemReporter.uninitializedLocalVariable(new String(ref.token), ref.sourceStart(), ref.sourceEnd(),
referenceContext, compilationUnit.compilationResult);
+ }
addVariableSet(ref.token);
}
}
return ref;
}
+ private void non_empty_function_call_parameter_list() {
+ this.non_empty_function_call_parameter_list(null);
+ }
+
// private void function_call_parameter_list() {
// function_call_parameter_list:
// non_empty_function_call_parameter_list { $$ = $1; }
// | /* empty */
// }
- private void non_empty_function_call_parameter_list() {
+ private void non_empty_function_call_parameter_list(String functionName) {
// non_empty_function_call_parameter_list:
// expr_without_variable
// | variable
if (Scanner.TRACE) {
System.out.println("TRACE: non_empty_function_call_parameter_list()");
}
+ UninitializedVariableHandler initHandler = new UninitializedVariableHandler();
+ initHandler.setFunctionName(functionName);
while (true) {
+ initHandler.incrementArgumentCount();
if (token == TokenNameAND) {
getNextToken();
w_variable(true);
// || token == TokenNameDOLLAR) {
// variable();
// } else {
- expr_without_variable(true);
+ expr_without_variable(true, initHandler);
// }
}
if (token != TokenNameCOMMA) {
getNextToken();
ref = null;
} else {
- non_empty_function_call_parameter_list();
+ String functionName;
+ if (ident == null) {
+ functionName = new String(" ");
+ } else {
+ functionName = new String(ident);
+ }
+ non_empty_function_call_parameter_list(functionName);
if (token != TokenNameRPAREN) {
- String functionName;
- if (ident == null) {
- functionName = new String(" ");
- } else {
- functionName = new String(ident);
- }
throwSyntaxError("')' expected in function call (" + functionName + ").");
}
getNextToken();