Don't reuse nodes within ambiguities
This commit is contained in:
parent
95fbc23fd6
commit
39c3de3fc8
2 changed files with 91 additions and 90 deletions
|
|
@ -22,6 +22,7 @@ static inline void reusable_node_reset(ReusableNode *self, const Subtree *tree)
|
|||
.child_index = 0,
|
||||
.byte_offset = 0,
|
||||
}));
|
||||
self->last_external_token = NULL;
|
||||
}
|
||||
|
||||
static inline const Subtree *reusable_node_tree(ReusableNode *self) {
|
||||
|
|
@ -40,10 +41,6 @@ static inline void reusable_node_delete(ReusableNode *self) {
|
|||
array_delete(&self->stack);
|
||||
}
|
||||
|
||||
static inline void reusable_node_assign(ReusableNode *self, const ReusableNode *other) {
|
||||
array_assign(&self->stack, &other->stack);
|
||||
}
|
||||
|
||||
static inline void reusable_node_advance(ReusableNode *self) {
|
||||
StackEntry last_entry = *array_back(&self->stack);
|
||||
uint32_t byte_offset = last_entry.byte_offset + ts_subtree_total_bytes(last_entry.tree);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue