Store edits in trees, not by splitting stack

This allows for multiple edits per parse, though it is not exposed through
the API yet
This commit is contained in:
Max Brunsfeld 2015-09-13 19:47:45 -07:00
parent 0467d190fe
commit b3d883e128
11 changed files with 169 additions and 333 deletions

View file

@ -251,11 +251,11 @@ void ts_tree_edit(TSTree *tree, TSInputEdit edit) {
if (remainder_to_delete > 0) {
size_t chars_removed = min(remainder_to_delete, child_size);
remainder_to_delete -= chars_removed;
ts_tree_edit(child, (TSInputEdit){
.position = 0,
.chars_inserted = 0,
.chars_removed = chars_removed,
});
ts_tree_edit(
child,
(TSInputEdit){
.position = 0, .chars_inserted = 0, .chars_removed = chars_removed,
});
} else {
break;
}