提交 0d937ac0 编写于 作者: V vromero

8000483: cryptic error message when source file contains hash

Summary: cryptic error message when source file contains hash
Reviewed-by: jjg, mcimadamore
Contributed-by: vicente.romero@oracle.com
上级 06dede83
......@@ -662,7 +662,10 @@ public class JavaTokenizer {
tk = TokenKind.EOF;
pos = reader.buflen;
} else {
lexError(pos, "illegal.char", String.valueOf((int)reader.ch));
String arg = (32 < reader.ch && reader.ch < 127) ?
String.format("%s", reader.ch) :
String.format("\\u%04x", (int)reader.ch);
lexError(pos, "illegal.char", arg);
reader.scanChar();
}
}
......
......@@ -475,7 +475,7 @@ compiler.err.icls.cant.have.static.decl=\
# 0: string
compiler.err.illegal.char=\
illegal character: \\{0}
illegal character: ''{0}''
compiler.err.illegal.char.for.encoding=\
unmappable character for encoding {0}
......
T6999438.java:8:9: compiler.err.illegal.char: 35
T6999438.java:8:9: compiler.err.illegal.char: #
T6999438.java:8:10: compiler.err.illegal.start.of.type
T6999438.java:8:25: compiler.err.expected: token.identifier
T6999438.java:8:26: compiler.err.expected: ';'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册