Signed-off-by: robekras <robert.kraske@weihenstephan.org>
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;