pub enum ParseError<'tree> {
Missing(Node<'tree>),
Unexpected(Node<'tree>),
}
Expand description
Parse error for tree-sitter tree
Variants§
Missing(Node<'tree>)
Error representing missing syntax
Unexpected(Node<'tree>)
Error representing unexpected syntax
Implementations§
Source§impl<'tree> ParseError<'tree>
impl<'tree> ParseError<'tree>
Sourcepub fn first(tree: &Tree) -> Option<ParseError<'_>>
pub fn first(tree: &Tree) -> Option<ParseError<'_>>
Return the first parse error in the given tree, if it exists.
Sourcepub fn into_first(tree: Tree) -> TreeWithParseErrorOption
pub fn into_first(tree: Tree) -> TreeWithParseErrorOption
Return the tree and the first parse error in the given tree, if it exists. This returns a type, combining the tree and the error, that can be moved safely, which is not possible with a seperate tree and error.
Sourcepub fn all(tree: &'tree Tree) -> Vec<ParseError<'tree>>
pub fn all(tree: &'tree Tree) -> Vec<ParseError<'tree>>
Return all parse errors in the given tree.
Sourcepub fn into_all(tree: Tree) -> TreeWithParseErrorVec
pub fn into_all(tree: Tree) -> TreeWithParseErrorVec
Return the tree and all parse errors in the given tree. This returns a type, combining the tree and the errors, that can be moved safely, which is not possible with a seperate tree and errors.
Trait Implementations§
Auto Trait Implementations§
impl<'tree> Freeze for ParseError<'tree>
impl<'tree> RefUnwindSafe for ParseError<'tree>
impl<'tree> Send for ParseError<'tree>
impl<'tree> Sync for ParseError<'tree>
impl<'tree> Unpin for ParseError<'tree>
impl<'tree> UnwindSafe for ParseError<'tree>
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