mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-24 02:31:13 +08:00
docs: 改写解析器诊断透传注释
This commit is contained in:
@@ -26,8 +26,8 @@ fn parse_with_source_type<'a>(
|
||||
let ret = Parser::new(allocator, source, source_type).parse();
|
||||
|
||||
if ret.panicked {
|
||||
// 不可恢复语法错误:oxc 已为出错 token 累积诊断时按既有路径透传
|
||||
// (消息 + 位置),直指真实触发点;无诊断时兜底通用文本。
|
||||
// 不可恢复语法错误:oxc 已为出错 token 累积诊断时,把诊断(消息 + 位置)
|
||||
// 透传为 `Err`,直指真实触发点;无诊断时兜底通用文本。
|
||||
if !ret.errors.is_empty() {
|
||||
return Err(ret.errors.into_iter().map(OxideError::from).collect());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user