refactor: 简化词法异常错误信息
- 移除了错误信息中的"词法错误:"前缀,使信息更加简洁 - 保留了非法字符序列和位置信息,确保错误定位准确
This commit is contained in:
parent
cc106f57e1
commit
268f1aa09a
@ -50,6 +50,6 @@ public class UnknownTokenScanner extends AbstractTokenScanner {
|
|||||||
if (lexeme.isEmpty())
|
if (lexeme.isEmpty())
|
||||||
lexeme = String.valueOf(ctx.advance());
|
lexeme = String.valueOf(ctx.advance());
|
||||||
// 抛出词法异常,并带上错误片段与具体位置
|
// 抛出词法异常,并带上错误片段与具体位置
|
||||||
throw new LexicalException("词法错误: 非法字符序列 '" + lexeme + "'", line, col);
|
throw new LexicalException("非法字符序列 '" + lexeme + "'", line, col);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user