Skip to main content

has_parse_error

Function has_parse_error 

Source
pub fn has_parse_error(root: Node<'_>) -> bool
Expand description

True if the subtree contains a node tree-sitter could not parse.

tree-sitter always returns a tree; syntax it cannot handle becomes ERROR or MISSING nodes. Adapters use this to emit a parse diagnostic instead of silently extracting from a partial tree.