Clean up breakdown stack function
This commit is contained in:
parent
9c0b5b5571
commit
6cf267efaf
1 changed files with 3 additions and 2 deletions
|
|
@ -38,7 +38,8 @@ static size_t breakdown_stack(TSParser *parser, TSInputEdit *edit) {
|
|||
|
||||
stack->size--;
|
||||
position -= ts_tree_total_size(node);
|
||||
DEBUG_PARSE("BREAKDOWN %s %u", parser->language->symbol_names[node->symbol],
|
||||
|
||||
DEBUG_PARSE("POP %s %u", parser->language->symbol_names[node->symbol],
|
||||
ts_stack_top_state(stack));
|
||||
|
||||
for (size_t i = 0; i < child_count && position < edit->position; i++) {
|
||||
|
|
@ -48,8 +49,8 @@ static size_t breakdown_stack(TSParser *parser, TSInputEdit *edit) {
|
|||
TSStateId next_state =
|
||||
action.type == TSParseActionTypeShift ? action.data.to_state : state;
|
||||
ts_stack_push(stack, next_state, child);
|
||||
ts_tree_retain(child);
|
||||
position += ts_tree_total_size(child);
|
||||
|
||||
DEBUG_PARSE("PUT_BACK %s %u",
|
||||
parser->language->symbol_names[child->symbol], next_state);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue