1) Fixed issue #347: Syntax highlight doesn't like apostrophe in heredoc.
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / parser / Parser.java
index 1626006..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;
 
@@ -3908,6 +3914,11 @@ public class Parser implements ITerminalSymbols, CompilerModifiers,
                        
                        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.");