pub enum CompilerError {
UnknownUnaryOperator {
operator: String,
},
UnknownBinaryOperator {
operator: String,
},
ArgumentNotFound {
function: String,
index: usize,
},
UnexpectedErrorNode,
UnknownFunction {
name: String,
},
InvalidFunctionCall {
name: String,
message: String,
},
InvalidMethodCall {
name: String,
message: String,
},
}Expand description
编译器错误类型 定义了在编译AST到操作码过程中可能遇到的各种错误情况
Variants§
UnknownUnaryOperator
未知一元操作符错误 当遇到编译器不支持的一元操作符时触发
UnknownBinaryOperator
未知二元操作符错误 当遇到编译器不支持的二元操作符时触发
ArgumentNotFound
函数参数未找到错误 当函数调用时指定索引的参数不存在时触发
UnexpectedErrorNode
意外错误节点错误 当遇到包含错误信息的AST节点时触发
UnknownFunction
未知函数错误 当调用未定义的函数时触发
InvalidFunctionCall
无效函数调用错误 当函数调用的参数数量或类型不正确时触发
InvalidMethodCall
无效方法调用错误 当方法调用的参数数量或类型不正确时触发
Trait Implementations§
Source§impl Clone for CompilerError
impl Clone for CompilerError
Source§fn clone(&self) -> CompilerError
fn clone(&self) -> CompilerError
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 CompilerError
impl Debug for CompilerError
Source§impl Display for CompilerError
impl Display for CompilerError
Source§impl Error for CompilerError
impl Error for CompilerError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<CompilerError> for IsolateError
impl From<CompilerError> for IsolateError
Source§fn from(source: CompilerError) -> Self
fn from(source: CompilerError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for CompilerError
impl PartialEq for CompilerError
impl Eq for CompilerError
impl StructuralPartialEq for CompilerError
Auto Trait Implementations§
impl Freeze for CompilerError
impl RefUnwindSafe for CompilerError
impl Send for CompilerError
impl Sync for CompilerError
impl Unpin for CompilerError
impl UnwindSafe for CompilerError
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more