Fixes for bug #1326088
authoraxelcl <axelcl>
Thu, 13 Oct 2005 19:39:04 +0000 (19:39 +0000)
committeraxelcl <axelcl>
Thu, 13 Oct 2005 19:39:04 +0000 (19:39 +0000)
net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Parser.java

index 1f05db8..7035759 100644 (file)
@@ -422,6 +422,9 @@ public class Parser implements ITerminalSymbols, CompilerModifiers, ParserBasicI
                        try {
                                statement = statement();
                                blockStatements.add(statement);
+                               if (token == TokenNameEOF) {
+                                       return null;
+                               }
                                if (branchStatement && statement != null) {
                                        // reportSyntaxError("Unreachable code", statement.sourceStart,
                                        // statement.sourceEnd);
@@ -3422,26 +3425,28 @@ public class Parser implements ITerminalSymbols, CompilerModifiers, ParserBasicI
                                }
                        }
                        // TODO is this ok ?
-                       return ref;
+                       // return ref;
                        // throwSyntaxError("'(' expected in function call.");
-               }
-               getNextToken();
-               if (token == TokenNameRPAREN) {
+               } else {
                        getNextToken();
-                       return ref;
-               }
-               non_empty_function_call_parameter_list();
-               if (token != TokenNameRPAREN) {
-                       String functionName;
-                       if (ident == null) {
-                               functionName = new String(" ");
+
+                       if (token == TokenNameRPAREN) {
+                               getNextToken();
+                               ref = null;
                        } else {
-                               functionName = new String(ident);
+                               non_empty_function_call_parameter_list();
+                               if (token != TokenNameRPAREN) {
+                                       String functionName;
+                                       if (ident == null) {
+                                               functionName = new String(" ");
+                                       } else {
+                                               functionName = new String(ident);
+                                       }
+                                       throwSyntaxError("')' expected in function call (" + functionName + ").");
+                               }
+                               getNextToken();
                        }
-                       throwSyntaxError("')' expected in function call (" + functionName + ").");
                }
-               getNextToken();
-
                if (token == TokenNameMINUS_GREATER) {
                        ref = null;
                        getNextToken();