Don't mutate shared lookahead nodes when setting the extra flag
This commit is contained in:
parent
71059f1d66
commit
3c3d95345f
3 changed files with 10 additions and 0 deletions
|
|
@ -41,6 +41,12 @@ TSTree *ts_tree_make_error(TSLength size, TSLength padding, char lookahead_char)
|
|||
return result;
|
||||
}
|
||||
|
||||
TSTree *ts_tree_make_copy(TSTree *self) {
|
||||
TSTree *result = malloc(sizeof(TSTree));
|
||||
*result = *self;
|
||||
return result;
|
||||
}
|
||||
|
||||
void ts_tree_assign_parents(TSTree *self) {
|
||||
TSLength offset = ts_length_zero();
|
||||
for (size_t i = 0; i < self->child_count; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue