pub enum ASTParseDiagnostic {
UnexpectedToken(Option<SourceLocation>),
UnmatchedParenthesis(Option<SourceLocation>),
InvalidVariableName(Option<SourceLocation>),
UnsupportedStructure(Option<SourceLocation>),
MissingStructure(Option<SourceLocation>, String),
InvalidSyntax(Option<SourceLocation>, String),
}
Expand description
AST 解析诊断信息类型。
封装语法分析过程中可能出现的各种错误类型。
Variants§
UnexpectedToken(Option<SourceLocation>)
意外的 Token。
UnmatchedParenthesis(Option<SourceLocation>)
括号不匹配。
InvalidVariableName(Option<SourceLocation>)
无效的变量名。
UnsupportedStructure(Option<SourceLocation>)
不支持的语法结构。
MissingStructure(Option<SourceLocation>, String)
缺少必要的语法结构。
InvalidSyntax(Option<SourceLocation>, String)
无效的语法。
Trait Implementations§
Source§impl Clone for ASTParseDiagnostic
impl Clone for ASTParseDiagnostic
Source§fn clone(&self) -> ASTParseDiagnostic
fn clone(&self) -> ASTParseDiagnostic
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ASTParseDiagnostic
impl Debug for ASTParseDiagnostic
Source§impl Diagnostic for ASTParseDiagnostic
impl Diagnostic for ASTParseDiagnostic
fn severity(&self) -> ReportSeverity
fn title(&self) -> String
fn message(&self) -> String
fn location(&self) -> Option<SourceLocation>
fn help(&self) -> Option<String>
fn copy(&self) -> Box<dyn Diagnostic>
Source§fn format_report(&self) -> String
fn format_report(&self) -> String
默认的格式化方法,将诊断信息转换为彩色的、人类可读的字符串。 Read more
Auto Trait Implementations§
impl Freeze for ASTParseDiagnostic
impl RefUnwindSafe for ASTParseDiagnostic
impl Send for ASTParseDiagnostic
impl Sync for ASTParseDiagnostic
impl Unpin for ASTParseDiagnostic
impl UnwindSafe for ASTParseDiagnostic
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoDiagnosticBox for Twhere
T: Diagnostic + 'static,
impl<T> IntoDiagnosticBox for Twhere
T: Diagnostic + 'static,
Source§fn into_diagnostic_box(self) -> Box<dyn Diagnostic>
fn into_diagnostic_box(self) -> Box<dyn Diagnostic>
转换为
Box<dyn Diagnostic>
Source§fn severity(&self) -> ReportSeverity
fn severity(&self) -> ReportSeverity
获取诊断对象的严重级别