#[non_exhaustive]pub enum ErrorKind {
TokenUnexpected(String),
DescriptionTokenUnexpected(String),
WhenUnexpected,
GivenUnexpected,
ItUnexpected,
WordUnexpected(String),
EofUnexpected,
TreeEmpty,
TitleMissing,
TreeRootless,
CornerNotLastChild,
TeeLastChild,
}Expand description
The type of an error that occurred while building an AST.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
TokenUnexpected(String)
This might happen because of an internal bug or the user might have passed an invalid .tree. An example of how this might be an internal bug is if the parser ends up in a state where the current grammar production being applied doesn’t expect this token to occur.
DescriptionTokenUnexpected(String)
Did not expect this token when parsing a description node.
WhenUnexpected
Did not expect this When keyword.
GivenUnexpected
Did not expect this Given keyword.
ItUnexpected
Did not expect this It keyword.
WordUnexpected(String)
Did not expect a Word.
EofUnexpected
Did not expect an end of file.
TreeEmpty
The token stream was empty, so the tree is empty.
TitleMissing
A condition or action with no title was found.
TreeRootless
A tree without a root was found.
CornerNotLastChild
A corner is not the last child.
TeeLastChild
A tee is the last child.
Trait Implementations§
impl Eq for ErrorKind
Source§impl Error for ErrorKind
impl Error for ErrorKind
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 FrontendError<ErrorKind> for Error
impl FrontendError<ErrorKind> for Error
impl StructuralPartialEq for ErrorKind
Auto Trait Implementations§
impl Freeze for ErrorKind
impl RefUnwindSafe for ErrorKind
impl Send for ErrorKind
impl Sync for ErrorKind
impl Unpin for ErrorKind
impl UnsafeUnpin for ErrorKind
impl UnwindSafe for ErrorKind
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