/* Automatically @generated by tree-sitter */ #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 47 #define LARGE_STATE_COUNT 6 #define SYMBOL_COUNT 31 #define ALIAS_COUNT 0 #define TOKEN_COUNT 19 #define EXTERNAL_TOKEN_COUNT 1 #define FIELD_COUNT 2 #define MAX_ALIAS_SEQUENCE_LENGTH 5 #define MAX_RESERVED_WORD_SET_SIZE 0 #define PRODUCTION_ID_COUNT 9 #define SUPERTYPE_COUNT 0 enum ts_symbol_identifiers { sym_identifier = 1, anon_sym_export = 2, anon_sym_EQ = 3, sym_comment = 4, anon_sym_DOLLAR = 5, anon_sym_LBRACE = 6, anon_sym_RBRACE = 7, aux_sym__unquoted_string_token1 = 8, anon_sym_SQUOTE = 9, aux_sym__literal_string_token1 = 10, anon_sym_DQUOTE = 11, aux_sym__string_token1 = 12, sym_decimal = 13, sym_hexadecimal = 14, sym_float = 15, sym_boolean = 16, sym_value = 17, sym__end_of_assignment = 18, sym_document = 19, sym_assignment = 20, sym_variable = 21, sym__value = 22, sym_string = 23, sym__unquoted_string = 24, sym__literal_string = 25, sym__string = 26, sym_number = 27, sym_integer = 28, aux_sym_document_repeat1 = 29, aux_sym__string_repeat1 = 30, }; static const char * const ts_symbol_names[] = { [ts_builtin_sym_end] = "end", [sym_identifier] = "identifier", [anon_sym_export] = "export", [anon_sym_EQ] = "=", [sym_comment] = "comment", [anon_sym_DOLLAR] = "$", [anon_sym_LBRACE] = "{", [anon_sym_RBRACE] = "}", [aux_sym__unquoted_string_token1] = "string_content", [anon_sym_SQUOTE] = "'", [aux_sym__literal_string_token1] = "string_content", [anon_sym_DQUOTE] = "\"", [aux_sym__string_token1] = "string_content", [sym_decimal] = "decimal", [sym_hexadecimal] = "hexadecimal", [sym_float] = "float", [sym_boolean] = "boolean", [sym_value] = "value", [sym__end_of_assignment] = "_end_of_assignment", [sym_document] = "document", [sym_assignment] = "assignment", [sym_variable] = "variable", [sym__value] = "_value", [sym_string] = "string", [sym__unquoted_string] = "_unquoted_string", [sym__literal_string] = "_literal_string", [sym__string] = "_string", [sym_number] = "number", [sym_integer] = "integer", [aux_sym_document_repeat1] = "document_repeat1", [aux_sym__string_repeat1] = "_string_repeat1", }; static const TSSymbol ts_symbol_map[] = { [ts_builtin_sym_end] = ts_builtin_sym_end, [sym_identifier] = sym_identifier, [anon_sym_export] = anon_sym_export, [anon_sym_EQ] = anon_sym_EQ, [sym_comment] = sym_comment, [anon_sym_DOLLAR] = anon_sym_DOLLAR, [anon_sym_LBRACE] = anon_sym_LBRACE, [anon_sym_RBRACE] = anon_sym_RBRACE, [aux_sym__unquoted_string_token1] = aux_sym__unquoted_string_token1, [anon_sym_SQUOTE] = anon_sym_SQUOTE, [aux_sym__literal_string_token1] = aux_sym__unquoted_string_token1, [anon_sym_DQUOTE] = anon_sym_DQUOTE, [aux_sym__string_token1] = aux_sym__unquoted_string_token1, [sym_decimal] = sym_decimal, [sym_hexadecimal] = sym_hexadecimal, [sym_float] = sym_float, [sym_boolean] = sym_boolean, [sym_value] = sym_value, [sym__end_of_assignment] = sym__end_of_assignment, [sym_document] = sym_document, [sym_assignment] = sym_assignment, [sym_variable] = sym_variable, [sym__value] = sym__value, [sym_string] = sym_string, [sym__unquoted_string] = sym__unquoted_string, [sym__literal_string] = sym__literal_string, [sym__string] = sym__string, [sym_number] = sym_number, [sym_integer] = sym_integer, [aux_sym_document_repeat1] = aux_sym_document_repeat1, [aux_sym__string_repeat1] = aux_sym__string_repeat1, }; static const TSSymbolMetadata ts_symbol_metadata[] = { [ts_builtin_sym_end] = { .visible = false, .named = true, }, [sym_identifier] = { .visible = true, .named = true, }, [anon_sym_export] = { .visible = true, .named = false, }, [anon_sym_EQ] = { .visible = true, .named = false, }, [sym_comment] = { .visible = true, .named = true, }, [anon_sym_DOLLAR] = { .visible = true, .named = false, }, [anon_sym_LBRACE] = { .visible = true, .named = false, }, [anon_sym_RBRACE] = { .visible = true, .named = false, }, [aux_sym__unquoted_string_token1] = { .visible = true, .named = true, }, [anon_sym_SQUOTE] = { .visible = true, .named = false, }, [aux_sym__literal_string_token1] = { .visible = true, .named = true, }, [anon_sym_DQUOTE] = { .visible = true, .named = false, }, [aux_sym__string_token1] = { .visible = true, .named = true, }, [sym_decimal] = { .visible = true, .named = true, }, [sym_hexadecimal] = { .visible = true, .named = true, }, [sym_float] = { .visible = true, .named = true, }, [sym_boolean] = { .visible = true, .named = true, }, [sym_value] = { .visible = true, .named = true, }, [sym__end_of_assignment] = { .visible = false, .named = true, }, [sym_document] = { .visible = true, .named = true, }, [sym_assignment] = { .visible = true, .named = true, }, [sym_variable] = { .visible = true, .named = true, }, [sym__value] = { .visible = false, .named = true, }, [sym_string] = { .visible = true, .named = true, }, [sym__unquoted_string] = { .visible = false, .named = true, }, [sym__literal_string] = { .visible = false, .named = true, }, [sym__string] = { .visible = false, .named = true, }, [sym_number] = { .visible = true, .named = true, }, [sym_integer] = { .visible = true, .named = true, }, [aux_sym_document_repeat1] = { .visible = false, .named = false, }, [aux_sym__string_repeat1] = { .visible = false, .named = false, }, }; enum ts_field_identifiers { field_key = 1, field_value = 2, }; static const char * const ts_field_names[] = { [0] = NULL, [field_key] = "key", [field_value] = "value", }; static const TSMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = { [1] = {.index = 0, .length = 1}, [2] = {.index = 0, .length = 1}, [3] = {.index = 1, .length = 1}, [4] = {.index = 2, .length = 2}, [5] = {.index = 1, .length = 1}, [6] = {.index = 2, .length = 2}, [7] = {.index = 4, .length = 2}, [8] = {.index = 4, .length = 2}, }; static const TSFieldMapEntry ts_field_map_entries[] = { [0] = {field_key, 0}, [1] = {field_key, 1}, [2] = {field_key, 0}, {field_value, 2}, [4] = {field_key, 1}, {field_value, 3}, }; static const TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE_LENGTH] = { [0] = {0}, [1] = { [0] = sym_identifier, }, [3] = { [1] = sym_identifier, }, [4] = { [0] = sym_identifier, }, [7] = { [1] = sym_identifier, }, }; 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, [9] = 9, [10] = 10, [11] = 11, [12] = 12, [13] = 13, [14] = 14, [15] = 15, [16] = 16, [17] = 17, [18] = 18, [19] = 19, [20] = 20, [21] = 21, [22] = 22, [23] = 22, [24] = 24, [25] = 25, [26] = 26, [27] = 27, [28] = 28, [29] = 29, [30] = 30, [31] = 31, [32] = 32, [33] = 33, [34] = 34, [35] = 35, [36] = 36, [37] = 37, [38] = 38, [39] = 39, [40] = 40, [41] = 21, [42] = 42, [43] = 20, [44] = 44, [45] = 36, [46] = 44, }; static bool ts_lex(TSLexer *lexer, TSStateId state) { START_LEXER(); eof = lexer->eof(lexer); switch (state) { case 0: if (eof) ADVANCE(10); ADVANCE_MAP( '"', 27, '#', 12, '$', 20, '\'', 24, '-', 6, '0', 5, '=', 11, 'f', 13, 't', 16, '{', 21, '}', 22, ); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') SKIP(0); if (('1' <= lookahead && lookahead <= '9')) ADVANCE(30); if (('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || ('a' <= lookahead && lookahead <= 'z')) ADVANCE(19); END_STATE(); case 1: if (lookahead == '"') ADVANCE(27); if (lookahead == '$') ADVANCE(20); if (lookahead == '\'') ADVANCE(24); if (lookahead == '-') ADVANCE(44); if (lookahead == '0') ADVANCE(43); if (lookahead == 'f') ADVANCE(37); if (lookahead == 't') ADVANCE(40); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') SKIP(1); if (('1' <= lookahead && lookahead <= '9')) ADVANCE(31); if (lookahead != 0 && (lookahead < '"' || '$' < lookahead)) ADVANCE(47); END_STATE(); case 2: if (lookahead == '"') ADVANCE(27); if (lookahead == '$') ADVANCE(20); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') ADVANCE(28); if (lookahead != 0) ADVANCE(29); END_STATE(); case 3: if (lookahead == '\'') ADVANCE(24); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') ADVANCE(25); if (lookahead != 0) ADVANCE(26); END_STATE(); case 4: if (lookahead == '\t' || lookahead == ' ') ADVANCE(4); if (lookahead != 0 && (lookahead < '\t' || '\r' < lookahead) && (lookahead < '"' || '$' < lookahead) && lookahead != '\'') ADVANCE(23); END_STATE(); case 5: if (lookahead == 'X' || lookahead == 'x') ADVANCE(8); END_STATE(); case 6: if (('1' <= lookahead && lookahead <= '9')) ADVANCE(30); END_STATE(); case 7: if (('0' <= lookahead && lookahead <= '9')) ADVANCE(35); END_STATE(); case 8: if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'F') || ('a' <= lookahead && lookahead <= 'f')) ADVANCE(33); END_STATE(); case 9: if (eof) ADVANCE(10); if (lookahead == '#') ADVANCE(12); if (lookahead == '=') ADVANCE(11); if (lookahead == '{') ADVANCE(21); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') SKIP(9); if (('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || ('a' <= lookahead && lookahead <= 'z')) ADVANCE(19); END_STATE(); case 10: ACCEPT_TOKEN(ts_builtin_sym_end); END_STATE(); case 11: ACCEPT_TOKEN(anon_sym_EQ); END_STATE(); case 12: ACCEPT_TOKEN(sym_comment); if (lookahead != 0 && lookahead != '\n') ADVANCE(12); END_STATE(); case 13: ACCEPT_TOKEN(sym_identifier); if (lookahead == 'a') ADVANCE(15); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || ('b' <= lookahead && lookahead <= 'z')) ADVANCE(19); END_STATE(); case 14: ACCEPT_TOKEN(sym_identifier); if (lookahead == 'e') ADVANCE(19); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || ('a' <= lookahead && lookahead <= 'z')) ADVANCE(19); END_STATE(); case 15: ACCEPT_TOKEN(sym_identifier); if (lookahead == 'l') ADVANCE(17); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || ('a' <= lookahead && lookahead <= 'z')) ADVANCE(19); END_STATE(); case 16: ACCEPT_TOKEN(sym_identifier); if (lookahead == 'r') ADVANCE(18); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || ('a' <= lookahead && lookahead <= 'z')) ADVANCE(19); END_STATE(); case 17: ACCEPT_TOKEN(sym_identifier); if (lookahead == 's') ADVANCE(14); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || ('a' <= lookahead && lookahead <= 'z')) ADVANCE(19); END_STATE(); case 18: ACCEPT_TOKEN(sym_identifier); if (lookahead == 'u') ADVANCE(14); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || ('a' <= lookahead && lookahead <= 'z')) ADVANCE(19); END_STATE(); case 19: ACCEPT_TOKEN(sym_identifier); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || ('a' <= lookahead && lookahead <= 'z')) ADVANCE(19); END_STATE(); case 20: ACCEPT_TOKEN(anon_sym_DOLLAR); END_STATE(); case 21: ACCEPT_TOKEN(anon_sym_LBRACE); END_STATE(); case 22: ACCEPT_TOKEN(anon_sym_RBRACE); END_STATE(); case 23: ACCEPT_TOKEN(aux_sym__unquoted_string_token1); if (lookahead == '\t' || lookahead == ' ') ADVANCE(4); if (lookahead != 0 && (lookahead < '\t' || '\r' < lookahead) && (lookahead < '"' || '$' < lookahead) && lookahead != '\'') ADVANCE(23); END_STATE(); case 24: ACCEPT_TOKEN(anon_sym_SQUOTE); END_STATE(); case 25: ACCEPT_TOKEN(aux_sym__literal_string_token1); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') ADVANCE(25); if (lookahead != 0 && lookahead != '\'') ADVANCE(26); END_STATE(); case 26: ACCEPT_TOKEN(aux_sym__literal_string_token1); if (lookahead != 0 && lookahead != '\'') ADVANCE(26); END_STATE(); case 27: ACCEPT_TOKEN(anon_sym_DQUOTE); END_STATE(); case 28: ACCEPT_TOKEN(aux_sym__string_token1); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') ADVANCE(28); if (lookahead != 0 && lookahead != '"' && lookahead != '$') ADVANCE(29); END_STATE(); case 29: ACCEPT_TOKEN(aux_sym__string_token1); if (lookahead != 0 && lookahead != '"' && lookahead != '$') ADVANCE(29); END_STATE(); case 30: ACCEPT_TOKEN(sym_decimal); if (lookahead == '.') ADVANCE(7); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(30); END_STATE(); case 31: ACCEPT_TOKEN(sym_decimal); if (lookahead == '.') ADVANCE(45); if (lookahead == '\t' || lookahead == ' ') ADVANCE(4); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(31); if (lookahead != 0 && (lookahead < '\t' || '\r' < lookahead) && (lookahead < '"' || '$' < lookahead) && lookahead != '\'') ADVANCE(47); END_STATE(); case 32: ACCEPT_TOKEN(sym_hexadecimal); if (lookahead == '\t' || lookahead == ' ') ADVANCE(4); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'F') || ('a' <= lookahead && lookahead <= 'f')) ADVANCE(32); if (lookahead != 0 && (lookahead < '\t' || '\r' < lookahead) && (lookahead < '"' || '$' < lookahead) && lookahead != '\'') ADVANCE(47); END_STATE(); case 33: ACCEPT_TOKEN(sym_hexadecimal); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'F') || ('a' <= lookahead && lookahead <= 'f')) ADVANCE(33); END_STATE(); case 34: ACCEPT_TOKEN(sym_float); if (lookahead == '\t' || lookahead == ' ') ADVANCE(4); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(34); if (lookahead != 0 && (lookahead < '\t' || '\r' < lookahead) && (lookahead < '"' || '$' < lookahead) && lookahead != '\'') ADVANCE(47); END_STATE(); case 35: ACCEPT_TOKEN(sym_float); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(35); END_STATE(); case 36: ACCEPT_TOKEN(sym_boolean); if (lookahead == '\t' || lookahead == ' ') ADVANCE(4); if (lookahead != 0 && (lookahead < '\t' || '\r' < lookahead) && (lookahead < '"' || '$' < lookahead) && lookahead != '\'') ADVANCE(47); END_STATE(); case 37: ACCEPT_TOKEN(sym_value); if (lookahead == 'a') ADVANCE(39); if (lookahead == '\t' || lookahead == ' ') ADVANCE(4); if (lookahead != 0 && (lookahead < '\t' || '\r' < lookahead) && (lookahead < '"' || '$' < lookahead) && lookahead != '\'') ADVANCE(47); END_STATE(); case 38: ACCEPT_TOKEN(sym_value); if (lookahead == 'e') ADVANCE(36); if (lookahead == '\t' || lookahead == ' ') ADVANCE(4); if (lookahead != 0 && (lookahead < '\t' || '\r' < lookahead) && (lookahead < '"' || '$' < lookahead) && lookahead != '\'') ADVANCE(47); END_STATE(); case 39: ACCEPT_TOKEN(sym_value); if (lookahead == 'l') ADVANCE(41); if (lookahead == '\t' || lookahead == ' ') ADVANCE(4); if (lookahead != 0 && (lookahead < '\t' || '\r' < lookahead) && (lookahead < '"' || '$' < lookahead) && lookahead != '\'') ADVANCE(47); END_STATE(); case 40: ACCEPT_TOKEN(sym_value); if (lookahead == 'r') ADVANCE(42); if (lookahead == '\t' || lookahead == ' ') ADVANCE(4); if (lookahead != 0 && (lookahead < '\t' || '\r' < lookahead) && (lookahead < '"' || '$' < lookahead) && lookahead != '\'') ADVANCE(47); END_STATE(); case 41: ACCEPT_TOKEN(sym_value); if (lookahead == 's') ADVANCE(38); if (lookahead == '\t' || lookahead == ' ') ADVANCE(4); if (lookahead != 0 && (lookahead < '\t' || '\r' < lookahead) && (lookahead < '"' || '$' < lookahead) && lookahead != '\'') ADVANCE(47); END_STATE(); case 42: ACCEPT_TOKEN(sym_value); if (lookahead == 'u') ADVANCE(38); if (lookahead == '\t' || lookahead == ' ') ADVANCE(4); if (lookahead != 0 && (lookahead < '\t' || '\r' < lookahead) && (lookahead < '"' || '$' < lookahead) && lookahead != '\'') ADVANCE(47); END_STATE(); case 43: ACCEPT_TOKEN(sym_value); if (lookahead == '\t' || lookahead == ' ') ADVANCE(4); if (lookahead == 'X' || lookahead == 'x') ADVANCE(46); if (lookahead != 0 && (lookahead < '\t' || '\r' < lookahead) && (lookahead < '"' || '$' < lookahead) && lookahead != '\'') ADVANCE(47); END_STATE(); case 44: ACCEPT_TOKEN(sym_value); if (lookahead == '\t' || lookahead == ' ') ADVANCE(4); if (('1' <= lookahead && lookahead <= '9')) ADVANCE(31); if (lookahead != 0 && (lookahead < '\t' || '\r' < lookahead) && (lookahead < '"' || '$' < lookahead) && lookahead != '\'') ADVANCE(47); END_STATE(); case 45: ACCEPT_TOKEN(sym_value); if (lookahead == '\t' || lookahead == ' ') ADVANCE(4); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(34); if (lookahead != 0 && (lookahead < '\t' || '\r' < lookahead) && (lookahead < '"' || '$' < lookahead) && lookahead != '\'') ADVANCE(47); END_STATE(); case 46: ACCEPT_TOKEN(sym_value); if (lookahead == '\t' || lookahead == ' ') ADVANCE(4); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'F') || ('a' <= lookahead && lookahead <= 'f')) ADVANCE(32); if (lookahead != 0 && (lookahead < '\t' || '\r' < lookahead) && (lookahead < '"' || '$' < lookahead) && lookahead != '\'') ADVANCE(47); END_STATE(); case 47: ACCEPT_TOKEN(sym_value); if (lookahead == '\t' || lookahead == ' ') ADVANCE(4); if (lookahead != 0 && (lookahead < '\t' || '\r' < lookahead) && (lookahead < '"' || '$' < lookahead) && lookahead != '\'') ADVANCE(47); END_STATE(); default: return false; } } static bool ts_lex_keywords(TSLexer *lexer, TSStateId state) { START_LEXER(); eof = lexer->eof(lexer); switch (state) { case 0: if (lookahead == 'e') ADVANCE(1); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') SKIP(0); END_STATE(); case 1: if (lookahead == 'x') ADVANCE(2); END_STATE(); case 2: if (lookahead == 'p') ADVANCE(3); END_STATE(); case 3: if (lookahead == 'o') ADVANCE(4); END_STATE(); case 4: if (lookahead == 'r') ADVANCE(5); END_STATE(); case 5: if (lookahead == 't') ADVANCE(6); END_STATE(); case 6: ACCEPT_TOKEN(anon_sym_export); END_STATE(); default: return false; } } static const TSLexerMode ts_lex_modes[STATE_COUNT] = { [0] = {.lex_state = 0, .external_lex_state = 1}, [1] = {.lex_state = 9}, [2] = {.lex_state = 1, .external_lex_state = 1}, [3] = {.lex_state = 1, .external_lex_state = 1}, [4] = {.lex_state = 1, .external_lex_state = 1}, [5] = {.lex_state = 1, .external_lex_state = 1}, [6] = {.lex_state = 9}, [7] = {.lex_state = 9}, [8] = {.lex_state = 2}, [9] = {.lex_state = 2}, [10] = {.lex_state = 2}, [11] = {.lex_state = 9}, [12] = {.lex_state = 9}, [13] = {.lex_state = 9}, [14] = {.lex_state = 9}, [15] = {.lex_state = 9}, [16] = {.lex_state = 9}, [17] = {.lex_state = 9}, [18] = {.lex_state = 9}, [19] = {.lex_state = 9}, [20] = {.lex_state = 2}, [21] = {.lex_state = 2}, [22] = {.lex_state = 9}, [23] = {.lex_state = 9}, [24] = {.lex_state = 3}, [25] = {.lex_state = 0, .external_lex_state = 1}, [26] = {.lex_state = 0}, [27] = {.lex_state = 0, .external_lex_state = 1}, [28] = {.lex_state = 0}, [29] = {.lex_state = 0, .external_lex_state = 1}, [30] = {.lex_state = 0, .external_lex_state = 1}, [31] = {.lex_state = 0, .external_lex_state = 1}, [32] = {.lex_state = 0, .external_lex_state = 1}, [33] = {.lex_state = 0, .external_lex_state = 1}, [34] = {.lex_state = 0}, [35] = {.lex_state = 0}, [36] = {.lex_state = 0}, [37] = {.lex_state = 0, .external_lex_state = 1}, [38] = {.lex_state = 0}, [39] = {.lex_state = 0, .external_lex_state = 1}, [40] = {.lex_state = 0, .external_lex_state = 1}, [41] = {.lex_state = 0, .external_lex_state = 1}, [42] = {.lex_state = 0, .external_lex_state = 1}, [43] = {.lex_state = 0, .external_lex_state = 1}, [44] = {.lex_state = 9}, [45] = {.lex_state = 0}, [46] = {.lex_state = 9}, }; static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [STATE(0)] = { [ts_builtin_sym_end] = ACTIONS(1), [sym_identifier] = ACTIONS(1), [anon_sym_export] = ACTIONS(1), [anon_sym_EQ] = ACTIONS(1), [sym_comment] = ACTIONS(1), [anon_sym_DOLLAR] = ACTIONS(1), [anon_sym_LBRACE] = ACTIONS(1), [anon_sym_RBRACE] = ACTIONS(1), [anon_sym_SQUOTE] = ACTIONS(1), [anon_sym_DQUOTE] = ACTIONS(1), [sym_decimal] = ACTIONS(1), [sym_hexadecimal] = ACTIONS(1), [sym_float] = ACTIONS(1), [sym_boolean] = ACTIONS(1), [sym__end_of_assignment] = ACTIONS(1), }, [STATE(1)] = { [sym_document] = STATE(26), [sym_assignment] = STATE(7), [aux_sym_document_repeat1] = STATE(7), [ts_builtin_sym_end] = ACTIONS(3), [sym_identifier] = ACTIONS(5), [anon_sym_export] = ACTIONS(7), [sym_comment] = ACTIONS(9), }, [STATE(2)] = { [sym_variable] = STATE(33), [sym__value] = STATE(33), [sym_string] = STATE(33), [sym__unquoted_string] = STATE(32), [sym__literal_string] = STATE(32), [sym__string] = STATE(32), [sym_number] = STATE(33), [sym_integer] = STATE(30), [anon_sym_DOLLAR] = ACTIONS(11), [aux_sym__unquoted_string_token1] = ACTIONS(13), [anon_sym_SQUOTE] = ACTIONS(15), [anon_sym_DQUOTE] = ACTIONS(17), [sym_decimal] = ACTIONS(19), [sym_hexadecimal] = ACTIONS(19), [sym_float] = ACTIONS(21), [sym_boolean] = ACTIONS(23), [sym_value] = ACTIONS(23), [sym__end_of_assignment] = ACTIONS(25), }, [STATE(3)] = { [sym_variable] = STATE(39), [sym__value] = STATE(39), [sym_string] = STATE(39), [sym__unquoted_string] = STATE(32), [sym__literal_string] = STATE(32), [sym__string] = STATE(32), [sym_number] = STATE(39), [sym_integer] = STATE(30), [anon_sym_DOLLAR] = ACTIONS(11), [aux_sym__unquoted_string_token1] = ACTIONS(13), [anon_sym_SQUOTE] = ACTIONS(15), [anon_sym_DQUOTE] = ACTIONS(17), [sym_decimal] = ACTIONS(19), [sym_hexadecimal] = ACTIONS(19), [sym_float] = ACTIONS(21), [sym_boolean] = ACTIONS(27), [sym_value] = ACTIONS(27), [sym__end_of_assignment] = ACTIONS(29), }, [STATE(4)] = { [sym_variable] = STATE(42), [sym__value] = STATE(42), [sym_string] = STATE(42), [sym__unquoted_string] = STATE(32), [sym__literal_string] = STATE(32), [sym__string] = STATE(32), [sym_number] = STATE(42), [sym_integer] = STATE(30), [anon_sym_DOLLAR] = ACTIONS(11), [aux_sym__unquoted_string_token1] = ACTIONS(13), [anon_sym_SQUOTE] = ACTIONS(15), [anon_sym_DQUOTE] = ACTIONS(17), [sym_decimal] = ACTIONS(19), [sym_hexadecimal] = ACTIONS(19), [sym_float] = ACTIONS(21), [sym_boolean] = ACTIONS(31), [sym_value] = ACTIONS(31), [sym__end_of_assignment] = ACTIONS(33), }, [STATE(5)] = { [sym_variable] = STATE(31), [sym__value] = STATE(31), [sym_string] = STATE(31), [sym__unquoted_string] = STATE(32), [sym__literal_string] = STATE(32), [sym__string] = STATE(32), [sym_number] = STATE(31), [sym_integer] = STATE(30), [anon_sym_DOLLAR] = ACTIONS(11), [aux_sym__unquoted_string_token1] = ACTIONS(13), [anon_sym_SQUOTE] = ACTIONS(15), [anon_sym_DQUOTE] = ACTIONS(17), [sym_decimal] = ACTIONS(19), [sym_hexadecimal] = ACTIONS(19), [sym_float] = ACTIONS(21), [sym_boolean] = ACTIONS(35), [sym_value] = ACTIONS(35), [sym__end_of_assignment] = ACTIONS(37), }, }; static const uint16_t ts_small_parse_table[] = { [0] = 5, ACTIONS(39), 1, ts_builtin_sym_end, ACTIONS(41), 1, sym_identifier, ACTIONS(44), 1, anon_sym_export, ACTIONS(47), 1, sym_comment, STATE(6), 2, sym_assignment, aux_sym_document_repeat1, [17] = 5, ACTIONS(5), 1, sym_identifier, ACTIONS(7), 1, anon_sym_export, ACTIONS(50), 1, ts_builtin_sym_end, ACTIONS(52), 1, sym_comment, STATE(6), 2, sym_assignment, aux_sym_document_repeat1, [34] = 4, ACTIONS(54), 1, anon_sym_DOLLAR, ACTIONS(56), 1, anon_sym_DQUOTE, ACTIONS(58), 1, aux_sym__string_token1, STATE(9), 2, sym_variable, aux_sym__string_repeat1, [48] = 4, ACTIONS(54), 1, anon_sym_DOLLAR, ACTIONS(60), 1, anon_sym_DQUOTE, ACTIONS(62), 1, aux_sym__string_token1, STATE(10), 2, sym_variable, aux_sym__string_repeat1, [62] = 4, ACTIONS(64), 1, anon_sym_DOLLAR, ACTIONS(67), 1, anon_sym_DQUOTE, ACTIONS(69), 1, aux_sym__string_token1, STATE(10), 2, sym_variable, aux_sym__string_repeat1, [76] = 2, ACTIONS(72), 2, ts_builtin_sym_end, sym_comment, ACTIONS(74), 2, anon_sym_export, sym_identifier, [85] = 2, ACTIONS(76), 2, ts_builtin_sym_end, sym_comment, ACTIONS(78), 2, anon_sym_export, sym_identifier, [94] = 2, ACTIONS(80), 2, ts_builtin_sym_end, sym_comment, ACTIONS(82), 2, anon_sym_export, sym_identifier, [103] = 2, ACTIONS(84), 2, ts_builtin_sym_end, sym_comment, ACTIONS(86), 2, anon_sym_export, sym_identifier, [112] = 2, ACTIONS(88), 2, ts_builtin_sym_end, sym_comment, ACTIONS(90), 2, anon_sym_export, sym_identifier, [121] = 2, ACTIONS(92), 2, ts_builtin_sym_end, sym_comment, ACTIONS(94), 2, anon_sym_export, sym_identifier, [130] = 2, ACTIONS(96), 2, ts_builtin_sym_end, sym_comment, ACTIONS(98), 2, anon_sym_export, sym_identifier, [139] = 2, ACTIONS(100), 2, ts_builtin_sym_end, sym_comment, ACTIONS(102), 2, anon_sym_export, sym_identifier, [148] = 3, ACTIONS(104), 1, sym_identifier, ACTIONS(106), 1, anon_sym_export, ACTIONS(108), 1, anon_sym_EQ, [158] = 2, ACTIONS(112), 1, aux_sym__string_token1, ACTIONS(110), 2, anon_sym_DOLLAR, anon_sym_DQUOTE, [166] = 2, ACTIONS(116), 1, aux_sym__string_token1, ACTIONS(114), 2, anon_sym_DOLLAR, anon_sym_DQUOTE, [174] = 2, ACTIONS(118), 1, sym_identifier, ACTIONS(120), 1, anon_sym_LBRACE, [181] = 2, ACTIONS(122), 1, sym_identifier, ACTIONS(124), 1, anon_sym_LBRACE, [188] = 2, ACTIONS(126), 1, anon_sym_SQUOTE, ACTIONS(128), 1, aux_sym__literal_string_token1, [195] = 1, ACTIONS(130), 1, sym__end_of_assignment, [199] = 1, ACTIONS(132), 1, ts_builtin_sym_end, [203] = 1, ACTIONS(134), 1, sym__end_of_assignment, [207] = 1, ACTIONS(136), 1, anon_sym_SQUOTE, [211] = 1, ACTIONS(138), 1, sym__end_of_assignment, [215] = 1, ACTIONS(140), 1, sym__end_of_assignment, [219] = 1, ACTIONS(142), 1, sym__end_of_assignment, [223] = 1, ACTIONS(144), 1, sym__end_of_assignment, [227] = 1, ACTIONS(146), 1, sym__end_of_assignment, [231] = 1, ACTIONS(148), 1, anon_sym_EQ, [235] = 1, ACTIONS(150), 1, anon_sym_EQ, [239] = 1, ACTIONS(152), 1, anon_sym_RBRACE, [243] = 1, ACTIONS(154), 1, sym__end_of_assignment, [247] = 1, ACTIONS(156), 1, anon_sym_EQ, [251] = 1, ACTIONS(158), 1, sym__end_of_assignment, [255] = 1, ACTIONS(160), 1, sym__end_of_assignment, [259] = 1, ACTIONS(116), 1, sym__end_of_assignment, [263] = 1, ACTIONS(162), 1, sym__end_of_assignment, [267] = 1, ACTIONS(112), 1, sym__end_of_assignment, [271] = 1, ACTIONS(164), 1, sym_identifier, [275] = 1, ACTIONS(166), 1, anon_sym_RBRACE, [279] = 1, ACTIONS(168), 1, sym_identifier, }; static const uint32_t ts_small_parse_table_map[] = { [SMALL_STATE(6)] = 0, [SMALL_STATE(7)] = 17, [SMALL_STATE(8)] = 34, [SMALL_STATE(9)] = 48, [SMALL_STATE(10)] = 62, [SMALL_STATE(11)] = 76, [SMALL_STATE(12)] = 85, [SMALL_STATE(13)] = 94, [SMALL_STATE(14)] = 103, [SMALL_STATE(15)] = 112, [SMALL_STATE(16)] = 121, [SMALL_STATE(17)] = 130, [SMALL_STATE(18)] = 139, [SMALL_STATE(19)] = 148, [SMALL_STATE(20)] = 158, [SMALL_STATE(21)] = 166, [SMALL_STATE(22)] = 174, [SMALL_STATE(23)] = 181, [SMALL_STATE(24)] = 188, [SMALL_STATE(25)] = 195, [SMALL_STATE(26)] = 199, [SMALL_STATE(27)] = 203, [SMALL_STATE(28)] = 207, [SMALL_STATE(29)] = 211, [SMALL_STATE(30)] = 215, [SMALL_STATE(31)] = 219, [SMALL_STATE(32)] = 223, [SMALL_STATE(33)] = 227, [SMALL_STATE(34)] = 231, [SMALL_STATE(35)] = 235, [SMALL_STATE(36)] = 239, [SMALL_STATE(37)] = 243, [SMALL_STATE(38)] = 247, [SMALL_STATE(39)] = 251, [SMALL_STATE(40)] = 255, [SMALL_STATE(41)] = 259, [SMALL_STATE(42)] = 263, [SMALL_STATE(43)] = 267, [SMALL_STATE(44)] = 271, [SMALL_STATE(45)] = 275, [SMALL_STATE(46)] = 279, }; 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_document, 0, 0, 0), [5] = {.entry = {.count = 1, .reusable = false}}, SHIFT(38), [7] = {.entry = {.count = 1, .reusable = false}}, SHIFT(19), [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7), [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23), [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(32), [15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24), [17] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8), [19] = {.entry = {.count = 1, .reusable = false}}, SHIFT(40), [21] = {.entry = {.count = 1, .reusable = false}}, SHIFT(30), [23] = {.entry = {.count = 1, .reusable = false}}, SHIFT(33), [25] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), [27] = {.entry = {.count = 1, .reusable = false}}, SHIFT(39), [29] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12), [31] = {.entry = {.count = 1, .reusable = false}}, SHIFT(42), [33] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17), [35] = {.entry = {.count = 1, .reusable = false}}, SHIFT(31), [37] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), [39] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_document_repeat1, 2, 0, 0), [41] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_document_repeat1, 2, 0, 0), SHIFT_REPEAT(38), [44] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_document_repeat1, 2, 0, 0), SHIFT_REPEAT(19), [47] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_document_repeat1, 2, 0, 0), SHIFT_REPEAT(6), [50] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_document, 1, 0, 0), [52] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), [54] = {.entry = {.count = 1, .reusable = false}}, SHIFT(22), [56] = {.entry = {.count = 1, .reusable = false}}, SHIFT(29), [58] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9), [60] = {.entry = {.count = 1, .reusable = false}}, SHIFT(25), [62] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), [64] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym__string_repeat1, 2, 0, 0), SHIFT_REPEAT(22), [67] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym__string_repeat1, 2, 0, 0), [69] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym__string_repeat1, 2, 0, 0), SHIFT_REPEAT(10), [72] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_assignment, 3, 0, 1), [74] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_assignment, 3, 0, 1), [76] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_assignment, 3, 0, 2), [78] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_assignment, 3, 0, 2), [80] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_assignment, 4, 0, 4), [82] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_assignment, 4, 0, 4), [84] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_assignment, 4, 0, 5), [86] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_assignment, 4, 0, 5), [88] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_assignment, 4, 0, 6), [90] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_assignment, 4, 0, 6), [92] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_assignment, 5, 0, 7), [94] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_assignment, 5, 0, 7), [96] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_assignment, 4, 0, 3), [98] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_assignment, 4, 0, 3), [100] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_assignment, 5, 0, 8), [102] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_assignment, 5, 0, 8), [104] = {.entry = {.count = 1, .reusable = false}}, SHIFT(34), [106] = {.entry = {.count = 1, .reusable = false}}, SHIFT(35), [108] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5), [110] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_variable, 2, 0, 0), [112] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_variable, 2, 0, 0), [114] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_variable, 4, 0, 0), [116] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_variable, 4, 0, 0), [118] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20), [120] = {.entry = {.count = 1, .reusable = true}}, SHIFT(46), [122] = {.entry = {.count = 1, .reusable = true}}, SHIFT(43), [124] = {.entry = {.count = 1, .reusable = true}}, SHIFT(44), [126] = {.entry = {.count = 1, .reusable = false}}, SHIFT(27), [128] = {.entry = {.count = 1, .reusable = true}}, SHIFT(28), [130] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__string, 3, 0, 0), [132] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), [134] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__literal_string, 2, 0, 0), [136] = {.entry = {.count = 1, .reusable = true}}, SHIFT(37), [138] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__string, 2, 0, 0), [140] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_number, 1, 0, 0), [142] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), [144] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_string, 1, 0, 0), [146] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), [148] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2), [150] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), [152] = {.entry = {.count = 1, .reusable = true}}, SHIFT(41), [154] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__literal_string, 3, 0, 0), [156] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3), [158] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15), [160] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_integer, 1, 0, 0), [162] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), [164] = {.entry = {.count = 1, .reusable = true}}, SHIFT(36), [166] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21), [168] = {.entry = {.count = 1, .reusable = true}}, SHIFT(45), }; enum ts_external_scanner_symbol_identifiers { ts_external_token__end_of_assignment = 0, }; static const TSSymbol ts_external_scanner_symbol_map[EXTERNAL_TOKEN_COUNT] = { [ts_external_token__end_of_assignment] = sym__end_of_assignment, }; static const bool ts_external_scanner_states[2][EXTERNAL_TOKEN_COUNT] = { [1] = { [ts_external_token__end_of_assignment] = true, }, }; #ifdef __cplusplus extern "C" { #endif void *tree_sitter_dotenv_external_scanner_create(void); void tree_sitter_dotenv_external_scanner_destroy(void *); bool tree_sitter_dotenv_external_scanner_scan(void *, TSLexer *, const bool *); unsigned tree_sitter_dotenv_external_scanner_serialize(void *, char *); void tree_sitter_dotenv_external_scanner_deserialize(void *, const char *, unsigned); #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_dotenv(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, .field_names = ts_field_names, .field_map_slices = ts_field_map_slices, .field_map_entries = ts_field_map_entries, .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, .keyword_lex_fn = ts_lex_keywords, .keyword_capture_token = sym_identifier, .external_scanner = { &ts_external_scanner_states[0][0], ts_external_scanner_symbol_map, tree_sitter_dotenv_external_scanner_create, tree_sitter_dotenv_external_scanner_destroy, tree_sitter_dotenv_external_scanner_scan, tree_sitter_dotenv_external_scanner_serialize, tree_sitter_dotenv_external_scanner_deserialize, }, .primary_state_ids = ts_primary_state_ids, .name = "dotenv", .max_reserved_word_set_size = 0, .metadata = { .major_version = 1, .minor_version = 1, .patch_version = 2, }, }; return &language; } #ifdef __cplusplus } #endif