tree_sitter::ffi

Function ts_parser_reset

Source
pub unsafe extern "C" fn ts_parser_reset(self_: *mut TSParser)
Expand description

Instruct the parser to start the next parse from the beginning.

If the parser previously failed because of a timeout or a cancellation, then by default, it will resume where it left off on the next call to ts_parser_parse or other parsing functions. If you don’t want to resume, and instead intend to use this parser to parse some other document, you must call ts_parser_reset first.