From f93f78ef2ddf2ba369c1bf0a08f1249035d98f26 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Sun, 2 Jul 2017 23:28:31 -0700 Subject: [PATCH] Remove version-pruning criteria based on pushed node count --- src/runtime/error_costs.c | 9 +-------- test/fixtures/error_corpus/javascript_errors.txt | 3 ++- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/runtime/error_costs.c b/src/runtime/error_costs.c index 99e346f1..b287cecd 100644 --- a/src/runtime/error_costs.c +++ b/src/runtime/error_costs.c @@ -2,7 +2,6 @@ static const unsigned MAX_COST_DIFFERENCE = 16 * ERROR_COST_PER_SKIPPED_TREE; static const unsigned MAX_PUSH_COUNT_WITH_COUNT_DIFFERENCE = 24; -static const unsigned MAX_PUSH_COUNT_TO_ALLOW_MULTIPLE = 32; static const unsigned MAX_DEPTH_TO_ALLOW_MULTIPLE = 12; ErrorComparison error_status_compare(ErrorStatus a, ErrorStatus b, bool are_mergeable) { @@ -45,17 +44,11 @@ ErrorComparison error_status_compare(ErrorStatus a, ErrorStatus b, bool are_merg } if (a.count > 0) { - if (a.push_count > MAX_PUSH_COUNT_TO_ALLOW_MULTIPLE || - b.push_count > MAX_PUSH_COUNT_TO_ALLOW_MULTIPLE || - a.depth > MAX_DEPTH_TO_ALLOW_MULTIPLE || + if (a.depth > MAX_DEPTH_TO_ALLOW_MULTIPLE || b.depth > MAX_DEPTH_TO_ALLOW_MULTIPLE) { return a.depth <= b.depth ? ErrorComparisonTakeLeft : ErrorComparisonTakeRight; - } else { - return a.depth <= b.depth ? - ErrorComparisonPreferLeft : - ErrorComparisonPreferRight; } } diff --git a/test/fixtures/error_corpus/javascript_errors.txt b/test/fixtures/error_corpus/javascript_errors.txt index 2a4b3bba..02edfb48 100644 --- a/test/fixtures/error_corpus/javascript_errors.txt +++ b/test/fixtures/error_corpus/javascript_errors.txt @@ -30,8 +30,9 @@ h i j k; (program (if_statement - (ERROR (identifier) (identifier)) + (ERROR (identifier)) (identifier) + (ERROR (identifier)) (statement_block (expression_statement (identifier)