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:
Max Brunsfeld 2016-08-29 17:06:23 -07:00
parent 27c9cb4175
commit 31d1160e21
3 changed files with 10 additions and 22 deletions

View file

@ -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;