1) Fixed issue #779: PHPEclipse reports error with a correct try/catch block
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / parser / Parser.java
index caa1d10..37aed9d 100644 (file)
@@ -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;