Enum tree_sitter_graph::parse_error::ParseError
source · 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<'_>>
pub fn all(tree: &'tree Tree) -> Vec<ParseError<'_>>
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