From cb3012ca60efbd5d14cf9b4cdfd4ec965ce89cdf Mon Sep 17 00:00:00 2001 From: axelcl Date: Thu, 13 Oct 2005 19:39:04 +0000 Subject: [PATCH] Fixes for bug #1326088 --- .../phpdt/internal/compiler/parser/Parser.java | 35 +++++++++++-------- 1 files changed, 20 insertions(+), 15 deletions(-) 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 1f05db8..7035759 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 @@ -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(); -- 1.7.1