Community
Participate
Working Groups
I was entered the following method. public void goto(Frame frame) { } The compiler gave me an error for "goto": Syntax error on token "Invalid Character", "Identifier" expected Presumably this is because "goto" is a keyword. The error message is very confusing, though. I would expect something like: Syntax error on keyword "goto"; Identifier expected instead It didn't help that the Java text editor doesn't colour "goto" as a keyword. See 1GCTE5I: ITPJUI:WIN2000 - Java text editor: "goto" is a keyword NOTES: AK (4/27/01 11:05:26 AM) duplicate of 1G83ZKL: ITPJUI:WINNT - unclear error message for a reserved word used as an identifier
Would be interesting to see if we can improve a few error messages in the parser by substitutions.
What do you mean by "by substitutions"?
Something similar to what we do for unary expressions.
PRODUCT VERSION: 0.047
Fixed and released in HEAD. Some tests had to be updated as well. They relied on the old parse error message even if the token on which the error occured was a keyword. These tests are test035, test173 and test174 in the NegativeTest suite.