refactor: 简化词法异常错误信息

- 移除了错误信息中的"词法错误:"前缀,使信息更加简洁
- 保留了非法字符序列和位置信息,确保错误定位准确
This commit is contained in:
Luke 2025-07-16 23:52:22 +08:00
parent cc106f57e1
commit 268f1aa09a

View File

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