if (token == TokenNameSEMICOLON) {
getNextToken();
} else {
- if (token != TokenNameINLINE_HTML ) {
+ if (token != TokenNameINLINE_HTML) {
throwSyntaxError("';' expected after 'echo' statement.");
}
getNextToken();
}
return statement;
} else if (token == TokenNameINLINE_HTML) {
-// if (scanner.phpExpressionTag) {
-// // start of <?= ... ?> block
-// getNextToken();
-// expr();
-// if (token == TokenNameSEMICOLON) {
-// getNextToken();
-// }
-// if (token != TokenNameINLINE_HTML) {
-// throwSyntaxError("Missing '?>' for open PHP expression block ('<?=').");
-// }
-// } else {
- getNextToken();
-// }
+ getNextToken();
return statement;
} else if (token == TokenNameglobal) {
getNextToken();
expr(); // constant();
if (token == TokenNameCOLON || token == TokenNameSEMICOLON) {
getNextToken();
+ if (token == TokenNameRBRACE) {
+ // empty case; assumes that the '}' token belongs to the wrapping switch statement
+ break;
+ }
if (token == TokenNamecase || token == TokenNamedefault) {
// empty case statement ?
continue;
if (token == TokenNameCOLON || token == TokenNameSEMICOLON) {
getNextToken();
if (token == TokenNameRBRACE) {
- // empty default case
+ // empty default case; ; assumes that the '}' token belongs to the wrapping switch statement
break;
}
if (token != TokenNamecase) {
}
getNextToken();
} else if (token == TokenNameLBRACKET) {
- if (ref != null && ref instanceof FieldReference) {
- FieldReference fref = (FieldReference) ref;
- addVariableSet(fref.token);
- }
- ref = null;
+ // To remove "ref = null;" here, is probably better than the patch commented in #1368081 - axelcl
getNextToken();
if (token != TokenNameRBRACKET) {
expr();