pub enum SyntaxError {
TokenError(TokenError),
IncompleteExpression,
MissingOperator,
UnclosedParenthesis {
opening_location: Range<usize>,
},
QuestionWithoutColon {
question_location: Range<usize>,
},
ColonWithoutQuestion,
InvalidOperator,
}
Expand description
Cause of a syntax error
Variants§
TokenError(TokenError)
Error in tokenization
IncompleteExpression
Expression with a missing value
MissingOperator
Operator missing
UnclosedParenthesis
(
without )
Fields
QuestionWithoutColon
?
without :
Fields
ColonWithoutQuestion
:
without ?
InvalidOperator
Other error in operator usage
Trait Implementations§
Source§impl Clone for SyntaxError
impl Clone for SyntaxError
Source§fn clone(&self) -> SyntaxError
fn clone(&self) -> SyntaxError
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 SyntaxError
impl Debug for SyntaxError
Source§impl Display for SyntaxError
impl Display for SyntaxError
Source§impl Error for SyntaxError
impl Error for SyntaxError
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<E1, E2> From<SyntaxError> for ErrorCause<E1, E2>
impl<E1, E2> From<SyntaxError> for ErrorCause<E1, E2>
Source§fn from(source: SyntaxError) -> Self
fn from(source: SyntaxError) -> Self
Converts to this type from the input type.
Source§impl From<TokenError> for SyntaxError
impl From<TokenError> for SyntaxError
Source§fn from(source: TokenError) -> Self
fn from(source: TokenError) -> Self
Converts to this type from the input type.
Source§impl Hash for SyntaxError
impl Hash for SyntaxError
Source§impl PartialEq for SyntaxError
impl PartialEq for SyntaxError
impl Eq for SyntaxError
impl StructuralPartialEq for SyntaxError
Auto Trait Implementations§
impl Freeze for SyntaxError
impl RefUnwindSafe for SyntaxError
impl Send for SyntaxError
impl Sync for SyntaxError
impl Unpin for SyntaxError
impl UnwindSafe for SyntaxError
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