X-Git-Url: http://secure.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/test/PHPParser.jj b/net.sourceforge.phpeclipse/src/test/PHPParser.jj index f2cd08d..9d2846a 100644 --- a/net.sourceforge.phpeclipse/src/test/PHPParser.jj +++ b/net.sourceforge.phpeclipse/src/test/PHPParser.jj @@ -232,14 +232,14 @@ public final class PHPParser extends PHPParserSuperclass { e.currentToken.sourceStart, e.currentToken.sourceEnd, errorLevel, - "Line " + e.currentToken.beginLine+", "+e.currentToken.sourceStart+":"+e.currentToken.sourceEnd); + "Line " + e.currentToken.beginLine+", "+e.currentToken.sourceStart+':'+e.currentToken.sourceEnd); } else { setMarker(fileToParse, errorMessage, errorStart, errorEnd, errorLevel, - "Line " + e.currentToken.beginLine+", "+errorStart+":"+errorEnd); + "Line " + e.currentToken.beginLine+", "+errorStart+':'+errorEnd); errorStart = -1; errorEnd = -1; } @@ -335,9 +335,8 @@ public final class PHPParser extends PHPParserSuperclass { currentPosition > SimpleCharStream.currentBuffer.length()) { return; } - final char[] chars = SimpleCharStream.currentBuffer.substring(htmlStart, - currentPosition).toCharArray(); - pushOnAstNodes(new HTMLCode(chars, htmlStart,currentPosition)); + final String html = SimpleCharStream.currentBuffer.substring(htmlStart, currentPosition); + pushOnAstNodes(new HTMLCode(html, htmlStart,currentPosition)); } /** Create a new task. */ @@ -1125,7 +1124,7 @@ Variable Var() : | token = { - outlineInfo.addVariable("$" + token.image); + outlineInfo.addVariable('$' + token.image); return new Variable(token.image,token.sourceStart,token.sourceEnd); } } @@ -1333,7 +1332,7 @@ VariableDeclaration FormalParameter() : { [token = ] variableDeclaration = VariableDeclaratorNoSuffix() { - outlineInfo.addVariable("$"+variableDeclaration.name()); + outlineInfo.addVariable('$'+variableDeclaration.name()); if (token != null) { variableDeclaration.setReference(true); } @@ -1643,7 +1642,7 @@ Expression MultiplicativeExpression() : expr = UnaryExpression() } catch (ParseException e) { if (errorMessage != null) throw e; - errorMessage = "unexpected token '"+e.currentToken.next.image+"'"; + errorMessage = "unexpected token '"+e.currentToken.next.image+'\''; errorLevel = ERROR; errorStart = PHPParser.token.sourceStart; errorEnd = PHPParser.token.sourceEnd; @@ -3238,7 +3237,7 @@ ForeachStatement ForeachStatement() : } try { statement = Statement() - {pos = rparenToken.sourceEnd+1;} + {pos = statement.sourceEnd+1;} } catch (ParseException e) { if (errorMessage != null) throw e; errorMessage = "statement expected"; @@ -3247,11 +3246,12 @@ ForeachStatement ForeachStatement() : errorEnd = e.currentToken.sourceEnd; processParseExceptionDebug(e); } - {return new ForeachStatement(expression, + { + return new ForeachStatement(expression, variable, statement, foreachToken.sourceStart, - statement.sourceEnd);} + pos);} }