if (token != TokenName.LBRACE) {
throwSyntaxError("'{' expected in 'try' statement.");
}
+
getNextToken();
- statementList();
- if (token != TokenName.RBRACE) {
- throwSyntaxError("'}' expected in 'try' statement.");
+
+ if (token != TokenName.RBRACE) { // Process the statement only if there is (possibly) a statement
+ statementList ();
+
+ if (token != TokenName.RBRACE) {
+ throwSyntaxError("'}' expected in 'try' statement.");
+ }
}
+
getNextToken();
return statement;
getNextToken();
}
+ else if ((token == TokenName.OP_AND_OLD) || // If the found token is e.g $var->and
+ (token == TokenName.OP_OR_OLD) || // or is $var->or
+ (token == TokenName.OP_XOR_OLD)) { // or is $var->xor
+ getNextToken (); // get the next token. Maybe we should issue an warning?
+ }
else {
if (token != TokenName.LBRACE) {
throwSyntaxError("'{' expected in variable name.");