Base error costs on top-level trees skipped and lines of text skipped
Rather than on the total number of tokens skipped
This commit is contained in:
parent
27c9cb4175
commit
31d1160e21
3 changed files with 10 additions and 22 deletions
|
|
@ -114,7 +114,7 @@ static StackNode *stack_node_new(StackNode *next, TSTree *tree, bool is_pending,
|
|||
ts_tree_retain(tree);
|
||||
if (state == TS_STATE_ERROR) {
|
||||
if (!tree->extra) {
|
||||
node->error_cost++;
|
||||
node->error_cost += 1 + tree->padding.rows + tree->size.rows;
|
||||
}
|
||||
} else {
|
||||
node->error_cost += tree->error_size;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue