mirror of
https://github.com/tree-sitter/tree-sitter.git
synced 2026-09-10 07:36:22 -04:00
Track the iterator's phase so exhaustion is sticky, and gate the symbol name on it, so `NULL` means "not positioned on a symbol". `ts_lookahead_iterator_new` was also the only language consuming constructor that did not `ts_language_copy`, so an iterator outliving a wasm language read freed memory. Retain in `_new` and `_reset`, release in `_delete`. Previously: - `ts_lookahead_iterator__next` left a small parse state's cursor one past its group end, so re-advancing an exhausted iterator resumed returning `true` and walked through the rest of `ts_small_parse_table` and off the end of it. - `ts_lookahead_iterator_current_symbol_name` returned `NULL` only when the exhausted symbol index happened to fall outside the names table, so a grammar with aliases returned a real but wrong name instead. |
||
|---|---|---|
| .. | ||
| tree_sitter | ||