/* Automatically generated by tree-sitter v0.25.3 */ #include "tree_sitter/parser.h" #if defined(__GNUC__) || defined(__clang__) #pragma GCC diagnostic ignored "-Wmissing-field-initializers" #endif #define LANGUAGE_VERSION 15 #define STATE_COUNT 9 #define LARGE_STATE_COUNT 4 #define SYMBOL_COUNT 7 #define ALIAS_COUNT 0 #define TOKEN_COUNT 4 #define EXTERNAL_TOKEN_COUNT 0 #define FIELD_COUNT 0 #define MAX_ALIAS_SEQUENCE_LENGTH 3 #define MAX_RESERVED_WORD_SET_SIZE 0 #define PRODUCTION_ID_COUNT 1 #define SUPERTYPE_COUNT 0 enum ts_symbol_identifiers { aux_sym_definition_token1 = 1, sym_key = 2, sym_value = 3, sym_source_file = 4, sym_definition = 5, aux_sym_source_file_repeat1 = 6, }; static const char * const ts_symbol_names[] = { [ts_builtin_sym_end] = "end", [aux_sym_definition_token1] = "definition_token1", [sym_key] = "key", [sym_value] = "value", [sym_source_file] = "source_file", [sym_definition] = "definition", [aux_sym_source_file_repeat1] = "source_file_repeat1", }; static const TSSymbol ts_symbol_map[] = { [ts_builtin_sym_end] = ts_builtin_sym_end, [aux_sym_definition_token1] = aux_sym_definition_token1, [sym_key] = sym_key, [sym_value] = sym_value, [sym_source_file] = sym_source_file, [sym_definition] = sym_definition, [aux_sym_source_file_repeat1] = aux_sym_source_file_repeat1, }; static const TSSymbolMetadata ts_symbol_metadata[] = { [ts_builtin_sym_end] = { .visible = false, .named = true, }, [aux_sym_definition_token1] = { .visible = false, .named = false, }, [sym_key] = { .visible = true, .named = true, }, [sym_value] = { .visible = true, .named = true, }, [sym_source_file] = { .visible = true, .named = true, }, [sym_definition] = { .visible = true, .named = true, }, [aux_sym_source_file_repeat1] = { .visible = false, .named = false, }, }; static const TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE_LENGTH] = { [0] = {0}, }; static const uint16_t ts_non_terminal_alias_map[] = { 0, }; static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, [7] = 7, [8] = 8, }; static bool ts_lex(TSLexer *lexer, TSStateId state) { START_LEXER(); eof = lexer->eof(lexer); switch (state) { case 0: if (eof) ADVANCE(4); if (lookahead == '\n') ADVANCE(5); if (lookahead == '\t' || lookahead == ' ') ADVANCE(12); if ((0x0b <= lookahead && lookahead <= '\r')) ADVANCE(8); if (lookahead != 0) ADVANCE(9); END_STATE(); case 1: if (lookahead == '\n') ADVANCE(6); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') ADVANCE(13); if (lookahead != 0) ADVANCE(14); END_STATE(); case 2: if (lookahead == '\n') ADVANCE(7); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') SKIP(2); END_STATE(); case 3: if (eof) ADVANCE(4); if (lookahead == '\t' || lookahead == ' ') SKIP(3); if (('\n' <= lookahead && lookahead <= '\r')) ADVANCE(10); if (lookahead != 0) ADVANCE(11); END_STATE(); case 4: ACCEPT_TOKEN(ts_builtin_sym_end); END_STATE(); case 5: ACCEPT_TOKEN(aux_sym_definition_token1); if (lookahead == '\n') ADVANCE(5); if (lookahead == '\t' || lookahead == ' ') ADVANCE(12); if ((0x0b <= lookahead && lookahead <= '\r')) ADVANCE(8); END_STATE(); case 6: ACCEPT_TOKEN(aux_sym_definition_token1); if (lookahead == '\n') ADVANCE(6); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') ADVANCE(13); END_STATE(); case 7: ACCEPT_TOKEN(aux_sym_definition_token1); if (lookahead == '\n') ADVANCE(7); END_STATE(); case 8: ACCEPT_TOKEN(sym_key); if (lookahead == '\n') ADVANCE(5); if (lookahead == '\t' || lookahead == ' ') ADVANCE(12); if ((0x0b <= lookahead && lookahead <= '\r')) ADVANCE(8); if (lookahead != 0) ADVANCE(9); END_STATE(); case 9: ACCEPT_TOKEN(sym_key); if (lookahead == '\n') ADVANCE(11); if (lookahead == '\t' || lookahead == ' ') ADVANCE(14); if (lookahead != 0) ADVANCE(9); END_STATE(); case 10: ACCEPT_TOKEN(sym_key); if (('\n' <= lookahead && lookahead <= '\r')) ADVANCE(10); if (lookahead != 0 && (lookahead < '\t' || '\r' < lookahead) && lookahead != ' ') ADVANCE(11); END_STATE(); case 11: ACCEPT_TOKEN(sym_key); if (lookahead != 0 && lookahead != '\t' && lookahead != ' ') ADVANCE(11); END_STATE(); case 12: ACCEPT_TOKEN(sym_value); if (lookahead == '\n') ADVANCE(5); if (lookahead == '\t' || lookahead == ' ') ADVANCE(12); if ((0x0b <= lookahead && lookahead <= '\r')) ADVANCE(8); if (lookahead != 0) ADVANCE(9); END_STATE(); case 13: ACCEPT_TOKEN(sym_value); if (lookahead == '\n') ADVANCE(6); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') ADVANCE(13); if (lookahead != 0) ADVANCE(14); END_STATE(); case 14: ACCEPT_TOKEN(sym_value); if (lookahead != 0 && lookahead != '\n') ADVANCE(14); END_STATE(); default: return false; } } static const TSLexerMode ts_lex_modes[STATE_COUNT] = { [0] = {.lex_state = 0}, [1] = {.lex_state = 3}, [2] = {.lex_state = 3}, [3] = {.lex_state = 3}, [4] = {.lex_state = 1}, [5] = {.lex_state = 3}, [6] = {.lex_state = 3}, [7] = {.lex_state = 0}, [8] = {.lex_state = 2}, }; static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [STATE(0)] = { [ts_builtin_sym_end] = ACTIONS(1), [aux_sym_definition_token1] = ACTIONS(1), [sym_key] = ACTIONS(1), [sym_value] = ACTIONS(1), }, [STATE(1)] = { [sym_source_file] = STATE(7), [sym_definition] = STATE(2), [aux_sym_source_file_repeat1] = STATE(2), [ts_builtin_sym_end] = ACTIONS(3), [sym_key] = ACTIONS(5), }, [STATE(2)] = { [sym_definition] = STATE(3), [aux_sym_source_file_repeat1] = STATE(3), [ts_builtin_sym_end] = ACTIONS(7), [sym_key] = ACTIONS(5), }, [STATE(3)] = { [sym_definition] = STATE(3), [aux_sym_source_file_repeat1] = STATE(3), [ts_builtin_sym_end] = ACTIONS(9), [sym_key] = ACTIONS(11), }, }; static const uint16_t ts_small_parse_table[] = { [0] = 2, ACTIONS(14), 1, aux_sym_definition_token1, ACTIONS(16), 1, sym_value, [7] = 1, ACTIONS(18), 2, ts_builtin_sym_end, sym_key, [12] = 1, ACTIONS(20), 2, ts_builtin_sym_end, sym_key, [17] = 1, ACTIONS(22), 1, ts_builtin_sym_end, [21] = 1, ACTIONS(24), 1, aux_sym_definition_token1, }; static const uint32_t ts_small_parse_table_map[] = { [SMALL_STATE(4)] = 0, [SMALL_STATE(5)] = 7, [SMALL_STATE(6)] = 12, [SMALL_STATE(7)] = 17, [SMALL_STATE(8)] = 21, }; static const TSParseActionEntry ts_parse_actions[] = { [0] = {.entry = {.count = 0, .reusable = false}}, [1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(), [3] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 0, 0, 0), [5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), [7] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1, 0, 0), [9] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), [11] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(4), [14] = {.entry = {.count = 1, .reusable = false}}, SHIFT(5), [16] = {.entry = {.count = 1, .reusable = false}}, SHIFT(8), [18] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_definition, 2, 0, 0), [20] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_definition, 3, 0, 0), [22] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), [24] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), }; #ifdef __cplusplus extern "C" { #endif #ifdef TREE_SITTER_HIDE_SYMBOLS #define TS_PUBLIC #elif defined(_WIN32) #define TS_PUBLIC __declspec(dllexport) #else #define TS_PUBLIC __attribute__((visibility("default"))) #endif TS_PUBLIC const TSLanguage *tree_sitter_confindent(void) { static const TSLanguage language = { .abi_version = LANGUAGE_VERSION, .symbol_count = SYMBOL_COUNT, .alias_count = ALIAS_COUNT, .token_count = TOKEN_COUNT, .external_token_count = EXTERNAL_TOKEN_COUNT, .state_count = STATE_COUNT, .large_state_count = LARGE_STATE_COUNT, .production_id_count = PRODUCTION_ID_COUNT, .supertype_count = SUPERTYPE_COUNT, .field_count = FIELD_COUNT, .max_alias_sequence_length = MAX_ALIAS_SEQUENCE_LENGTH, .parse_table = &ts_parse_table[0][0], .small_parse_table = ts_small_parse_table, .small_parse_table_map = ts_small_parse_table_map, .parse_actions = ts_parse_actions, .symbol_names = ts_symbol_names, .symbol_metadata = ts_symbol_metadata, .public_symbol_map = ts_symbol_map, .alias_map = ts_non_terminal_alias_map, .alias_sequences = &ts_alias_sequences[0][0], .lex_modes = (const void*)ts_lex_modes, .lex_fn = ts_lex, .primary_state_ids = ts_primary_state_ids, .name = "confindent", .max_reserved_word_set_size = 0, .metadata = { .major_version = 0, .minor_version = 1, .patch_version = 0, }, }; return &language; } #ifdef __cplusplus } #endif