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:
parent
0467d190fe
commit
b3d883e128
11 changed files with 169 additions and 333 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue