Merge all versions created in a given reduce operation
This commit is contained in:
parent
fe74c6fb34
commit
e99a3925e0
3 changed files with 12 additions and 3 deletions
|
|
@ -342,6 +342,7 @@ static Reduction ts_parser__reduce(TSParser *self, StackVersion version,
|
|||
count, BOOL_STRING(fragile));
|
||||
}
|
||||
|
||||
size_t initial_version_count = ts_stack_version_count(self->stack);
|
||||
StackPopResult pop = ts_stack_pop_count(self->stack, version, count);
|
||||
switch (pop.status) {
|
||||
case StackPopFailed:
|
||||
|
|
@ -414,6 +415,8 @@ static Reduction ts_parser__reduce(TSParser *self, StackVersion version,
|
|||
}
|
||||
}
|
||||
|
||||
ts_stack_merge_from(self->stack, initial_version_count);
|
||||
|
||||
return (Reduction){ ReduceSucceeded, pop.slices.contents[0] };
|
||||
|
||||
error:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue