fix(lib): prevent finished_tree assertion failure

**Problem:** When resetting the parser during subtree balancing, an
error is thrown:

```
parser.c:2198: ts_parser_parse: Assertion `self->finished_tree.ptr' failed.
```

**Solution:** Reset `canceled_balancing` to false in
`ts_parser_reset()`.
This commit is contained in:
Riley Bruins 2025-02-01 11:36:17 -08:00 committed by Amaan Qureshi
parent ac8a4ba80e
commit 9ad096ef22
2 changed files with 26 additions and 0 deletions

View file

@ -2080,6 +2080,7 @@ void ts_parser_reset(TSParser *self) {
self->accept_count = 0;
self->has_scanner_error = false;
self->has_error = false;
self->canceled_balancing = false;
self->parse_options = (TSParseOptions) {0};
self->parse_state = (TSParseState) {0};
}