diff --git a/include/tree_sitter/parser.h b/include/tree_sitter/parser.h index d2091b11..adc4974e 100644 --- a/include/tree_sitter/parser.h +++ b/include/tree_sitter/parser.h @@ -95,7 +95,7 @@ struct TSLanguage { const unsigned short *in_progress_symbol_table; const TSInProgressSymbolEntry *in_progress_symbols; const TSStateId *lex_states; - const TSStateId *out_of_context_states; + const TSStateId *recovery_states; TSTree *(*lex_fn)(TSLexer *, TSStateId, bool); }; @@ -199,7 +199,7 @@ enum { .parse_actions = ts_parse_actions, \ .in_progress_symbol_table = ts_in_progress_symbol_table, \ .in_progress_symbols = ts_in_progress_symbols, \ - .out_of_context_states = ts_out_of_context_states, \ + .recovery_states = ts_recovery_states, \ .lex_states = ts_lex_states, \ .symbol_names = ts_symbol_names, \ .lex_fn = ts_lex, \ diff --git a/src/compiler/generate_code/c_code.cc b/src/compiler/generate_code/c_code.cc index ed6bd5ff..60268376 100644 --- a/src/compiler/generate_code/c_code.cc +++ b/src/compiler/generate_code/c_code.cc @@ -100,7 +100,7 @@ class CCodeGenerator { add_symbol_node_types_list(); add_lex_function(); add_lex_states_list(); - add_out_of_context_parse_states_list(); + add_recovery_parse_states_list(); add_parse_table(); add_in_progress_symbol_table(); add_parser_export(); @@ -220,8 +220,8 @@ class CCodeGenerator { line(); } - void add_out_of_context_parse_states_list() { - line("static TSStateId ts_out_of_context_states[SYMBOL_COUNT] = {"); + void add_recovery_parse_states_list() { + line("static TSStateId ts_recovery_states[SYMBOL_COUNT] = {"); indent([&]() { for (const auto &entry : parse_table.error_state.actions) { const rules::Symbol &symbol = entry.first; diff --git a/src/runtime/language.c b/src/runtime/language.c index 3b703440..712f6a90 100644 --- a/src/runtime/language.c +++ b/src/runtime/language.c @@ -6,7 +6,7 @@ const TSParseAction *ts_language_actions(const TSLanguage *language, size_t action_index = 0; if (symbol != ts_builtin_sym_error) { if (state == ts_parse_state_error) - state = language->out_of_context_states[symbol]; + state = language->recovery_states[symbol]; action_index = (language->parse_table + (state * language->symbol_count))[symbol]; }