Represent tree symbols as unsigned integers
This commit is contained in:
parent
059f7ff9d5
commit
316adc7788
2 changed files with 3 additions and 6 deletions
|
|
@ -72,8 +72,7 @@ ts_tree * ts_stack_reduce(ts_stack *stack, ts_symbol symbol, int immediate_child
|
|||
size += ts_tree_offset(child) + ts_tree_size(child);
|
||||
}
|
||||
|
||||
ts_symbol symbol = ts_tree_symbol(child);
|
||||
if (symbol >= 0 && hidden_symbol_flags[symbol]) {
|
||||
if (hidden_symbol_flags[ts_tree_symbol(child)]) {
|
||||
size_t grandchild_count;
|
||||
ts_tree_children(child, &grandchild_count);
|
||||
child_count += grandchild_count;
|
||||
|
|
@ -90,9 +89,7 @@ ts_tree * ts_stack_reduce(ts_stack *stack, ts_symbol symbol, int immediate_child
|
|||
ts_tree *child = stack->entries[new_stack_size + i].node;
|
||||
immediate_children[i] = child;
|
||||
|
||||
|
||||
ts_symbol symbol = ts_tree_symbol(child);
|
||||
if (symbol >= 0 && hidden_symbol_flags[symbol]) {
|
||||
if (hidden_symbol_flags[ts_tree_symbol(child)]) {
|
||||
size_t grandchild_count;
|
||||
ts_tree ** grandchildren = ts_tree_children(child, &grandchild_count);
|
||||
memcpy(children + child_index, grandchildren, (grandchild_count * sizeof(ts_tree *)));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue