1) Fixed issue #779: PHPEclipse reports error with a correct try/catch block
authorrobekras <robert.kraske@weihenstephan.org>
Thu, 27 Dec 2012 17:18:50 +0000 (18:18 +0100)
committerrobekras <robert.kraske@weihenstephan.org>
Thu, 27 Dec 2012 17:19:44 +0000 (18:19 +0100)
Signed-off-by: robekras <robert.kraske@weihenstephan.org>

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;