From: robekras Date: Thu, 27 Dec 2012 17:18:50 +0000 (+0100) Subject: 1) Fixed issue #779: PHPEclipse reports error with a correct try/catch block X-Git-Url: http://git.phpeclipse.com?hp=f92e433986ce650aeed7e00dc0705f8b8d5b1aea 1) Fixed issue #779: PHPEclipse reports error with a correct try/catch block Signed-off-by: robekras --- diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Parser.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Parser.java index caa1d10..37aed9d 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Parser.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Parser.java @@ -1066,11 +1066,17 @@ public class Parser implements ITerminalSymbols, CompilerModifiers, 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;