}
if (token == TokenNameif || token == TokenNameswitch || token == TokenNamefor || token == TokenNamewhile
|| token == TokenNamedo || token == TokenNameforeach || token == TokenNamecontinue || token == TokenNamebreak
- || token == TokenNamereturn || token == TokenNameexit || token == TokenNameecho || token == TokenNameglobal
- || token == TokenNamestatic || token == TokenNameunset || token == TokenNamefunction || token == TokenNamedeclare
- || token == TokenNametry || token == TokenNamecatch || token == TokenNamethrow || token == TokenNamefinal
- || token == TokenNameabstract || token == TokenNameclass || token == TokenNameinterface) {
+ || token == TokenNamereturn || token == TokenNameexit || token == TokenNameecho || token == TokenNameECHO_INVISIBLE
+ || token == TokenNameglobal || token == TokenNamestatic || token == TokenNameunset || token == TokenNamefunction
+ || token == TokenNamedeclare || token == TokenNametry || token == TokenNamecatch || token == TokenNamethrow
+ || token == TokenNamefinal || token == TokenNameabstract || token == TokenNameclass || token == TokenNameinterface) {
break;
}
// System.out.println(scanner.toStringAction(token));
getNextToken();
}
return statement;
+ } else if (token == TokenNameECHO_INVISIBLE) {
+ // 0-length token directly after PHP short tag <?=
+ getNextToken();
+ 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).");
+ }
+ } else {
+ if (token != TokenNameINLINE_HTML) {
+ throwSyntaxError("';' expected after PHP short tag '<?=' expression.");
+ }
+ getNextToken();
+ }
+ return statement;
} else if (token == TokenNameINLINE_HTML) {
getNextToken();
return statement;
if (token == TokenNameCOLON || token == TokenNameSEMICOLON) {
getNextToken();
if (token == TokenNameRBRACE) {
- // empty case; assumes that the '}' token belongs to the wrapping switch statement - #1371992
+ // empty case; assumes that the '}' token belongs to the wrapping
+ // switch statement - #1371992
break;
}
if (token == TokenNamecase || token == TokenNamedefault) {
if (token == TokenNameCOLON || token == TokenNameSEMICOLON) {
getNextToken();
if (token == TokenNameRBRACE) {
- // empty default case; ; assumes that the '}' token belongs to the wrapping switch statement - #1371992
+ // empty default case; ; assumes that the '}' token belongs to the
+ // wrapping switch statement - #1371992
break;
}
if (token != TokenNamecase) {
}
getNextToken();
} else if (token == TokenNameLBRACKET) {
- // To remove "ref = null;" here, is probably better than the patch commented in #1368081 - axelcl
+ // To remove "ref = null;" here, is probably better than the patch
+ // commented in #1368081 - axelcl
getNextToken();
if (token != TokenNameRBRACKET) {
expr();