Rename stack_right_position -> stack_total_tree_size

I want to re-use the stack data structure for storing the
re-usable nodes from the previous parse tree during an edit.
In this case, the stack won't conceptually start at position
zero, so the name 'right_position' doesn't make sense.
This commit is contained in:
Max Brunsfeld 2014-10-08 17:37:20 -07:00
parent 26f9e22193
commit 80b8a0a9fb
3 changed files with 4 additions and 4 deletions

View file

@ -33,7 +33,7 @@ static TSLength breakdown_stack(TSParser *parser, TSInputEdit *edit) {
}
TSStack *stack = &parser->stack;
TSLength position = ts_stack_right_position(stack);
TSLength position = ts_stack_total_tree_size(stack);
for (;;) {
TSTree *node = ts_stack_top_node(stack);
@ -71,7 +71,7 @@ static TSLength breakdown_stack(TSParser *parser, TSInputEdit *edit) {
static void resize_error(TSParser *parser, TSTree *error) {
error->size =
ts_length_sub(ts_length_sub(parser->lexer.token_start_position,
ts_stack_right_position(&parser->stack)),
ts_stack_total_tree_size(&parser->stack)),
error->padding);
}