2016-08-31 10:51:59 -07:00
|
|
|
#ifndef RUNTIME_ERROR_COSTS_H_
|
|
|
|
|
#define RUNTIME_ERROR_COSTS_H_
|
|
|
|
|
|
2017-06-29 14:58:20 -07:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
2017-02-19 21:52:48 -08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2016-10-05 14:02:49 -07:00
|
|
|
#define ERROR_STATE 0
|
2017-06-29 14:58:20 -07:00
|
|
|
#define ERROR_COST_PER_SKIPPED_TREE 100
|
|
|
|
|
#define ERROR_COST_PER_SKIPPED_LINE 30
|
|
|
|
|
#define ERROR_COST_PER_SKIPPED_CHAR 1
|
2016-08-31 10:51:59 -07:00
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
unsigned count;
|
2017-02-19 21:52:48 -08:00
|
|
|
unsigned cost;
|
2016-08-31 17:29:14 -07:00
|
|
|
unsigned push_count;
|
2016-08-31 10:51:59 -07:00
|
|
|
} ErrorStatus;
|
|
|
|
|
|
2017-06-29 14:58:20 -07:00
|
|
|
typedef enum {
|
|
|
|
|
ErrorComparisonTakeLeft,
|
|
|
|
|
ErrorComparisonPreferLeft,
|
|
|
|
|
ErrorComparisonNone,
|
|
|
|
|
ErrorComparisonPreferRight,
|
|
|
|
|
ErrorComparisonTakeRight,
|
|
|
|
|
} ErrorComparison;
|
|
|
|
|
|
|
|
|
|
ErrorComparison error_status_compare(ErrorStatus a, ErrorStatus b, bool can_merge);
|
2016-08-31 10:51:59 -07:00
|
|
|
|
2017-02-19 21:52:48 -08:00
|
|
|
#ifdef __cplusplus
|
2016-08-31 10:51:59 -07:00
|
|
|
}
|
2017-02-19 21:52:48 -08:00
|
|
|
#endif
|
2016-08-31 10:51:59 -07:00
|
|
|
|
|
|
|
|
#endif
|