From: khartlage Date: Wed, 2 Apr 2003 20:47:20 +0000 (+0000) Subject: added new error messages for keywords function, class X-Git-Url: http://secure.phpeclipse.com?hp=db78a4cdf87a5043573459b9914411ba806a791a added new error messages for keywords function, class --- 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 44568b9..7b63621 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 @@ -1979,6 +1979,10 @@ public class Parser extends PHPParserSuperclass implements ITerminalSymbols { } } } else { + if (token > TokenNameKEYWORD) { + throwSyntaxError( + "Don't use keyword for class declaration [" + token + "]."); + } throwSyntaxError("Class name expected after keyword 'class'."); } } @@ -2070,6 +2074,12 @@ public class Parser extends PHPParserSuperclass implements ITerminalSymbols { } else { getNextToken(); } + } else { + if (token > TokenNameKEYWORD) { + throwSyntaxError( + "Don't use keyword for function declaration [" + token + "]."); + } + throwSyntaxError("Function name expected after keyword 'function'."); } } // diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Scanner.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Scanner.java index 5427ff6..ac3546e 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Scanner.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Scanner.java @@ -158,6 +158,7 @@ public class Scanner implements IScanner, ITerminalSymbols { public static final int BracketKinds = 3; public static final boolean DEBUG = false; + public Scanner() { this(false, false); }