Fix bug when reusing formerly extra trees as non-extra trees
This commit is contained in:
parent
e1c51556f2
commit
ef2c3a10e3
1 changed files with 2 additions and 2 deletions
|
|
@ -348,7 +348,7 @@ static bool ts_parser__push(TSParser *self, StackVersion version, TSTree *tree,
|
|||
|
||||
static bool ts_parser__shift(TSParser *self, StackVersion version,
|
||||
TSStateId state, TSTree *lookahead, bool extra) {
|
||||
if (extra) {
|
||||
if (extra != lookahead->extra) {
|
||||
TSSymbolMetadata metadata =
|
||||
ts_language_symbol_metadata(self->language, lookahead->symbol);
|
||||
if (metadata.structural && ts_stack_version_count(self->stack) > 1) {
|
||||
|
|
@ -356,7 +356,7 @@ static bool ts_parser__shift(TSParser *self, StackVersion version,
|
|||
} else {
|
||||
ts_tree_retain(lookahead);
|
||||
}
|
||||
lookahead->extra = true;
|
||||
lookahead->extra = extra;
|
||||
} else {
|
||||
ts_tree_retain(lookahead);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue