Don't count extra tokens in error cost computation
This commit is contained in:
parent
2109f0ed74
commit
6dda23796b
1 changed files with 3 additions and 1 deletions
|
|
@ -120,7 +120,9 @@ recur:
|
|||
static void ts_tree_total_tokens(const TSTree *self, size_t *result) {
|
||||
recur:
|
||||
if (self->child_count == 0) {
|
||||
(*result)++;
|
||||
if (!self->extra) {
|
||||
(*result)++;
|
||||
}
|
||||
} else {
|
||||
for (size_t i = 1; i < self->child_count; i++)
|
||||
ts_tree_total_tokens(self->children[i], result);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue