- /*
- * TODO: determine the best score for the identifier: be it
- * a variable, a field.
- *
- * We should also consider adding correction tables for
- * other things as well.
- */
- if (OPTS_OPTION_BOOL(OPTION_CORRECTION) && strlen(parser_tokval(parser)) <= 16) {
- correction_t corr;
- correct_init(&corr);
-
- for (i = 0; i < vec_size(parser->correct_variables); i++) {
- correct = correct_str(&corr, parser->correct_variables[i], parser_tokval(parser));
- if (strcmp(correct, parser_tokval(parser))) {
- break;
- } else {
- mem_d(correct);
- correct = NULL;
- }
- }
- correct_free(&corr);
-
- if (correct) {
- parseerror(parser, "unexpected identifier: %s (did you mean %s?)", parser_tokval(parser), correct);
- mem_d(correct);
- return false;
- }
- }