refactor: 优化词法异常的错误信息提示

- 将英文错误信息改为中文,提高用户的可读性和理解度
This commit is contained in:
Luke 2025-07-16 10:57:29 +08:00
parent eae66eac8c
commit cd64137148

View File

@ -50,6 +50,6 @@ public class UnknownTokenScanner extends AbstractTokenScanner {
if (lexeme.isEmpty())
lexeme = String.valueOf(ctx.advance());
// 抛出词法异常并带上错误片段与具体位置
throw new LexicalException("Illegal character sequence '" + lexeme + "'", line, col);
throw new LexicalException("词法错误:非法字符序列 '" + lexeme + "'", line, col);
}
}