From 97253273bdf8b63546c8006e71ba155ecc27069e Mon Sep 17 00:00:00 2001 From: ObserverOfTime Date: Tue, 21 Nov 2023 02:13:17 +0200 Subject: [PATCH] Fix default substitution values --- grammar.js | 22 +- src/grammar.json | 65 +- src/node-types.json | 11 +- src/parser.c | 1701 ++++++++++++++++++-------------------- src/tree_sitter/parser.h | 16 +- 5 files changed, 865 insertions(+), 950 deletions(-) diff --git a/grammar.js b/grammar.js index d24b9c4..fec8b41 100644 --- a/grammar.js +++ b/grammar.js @@ -53,20 +53,24 @@ module.exports = grammar({ substitution: $ => seq( '${', - $._content, - optional($._default), - '}' - ), - - _content: $ => repeat1( - choice( + repeat1(choice( $.key, $.substitution - ) + )), + optional($._default), + '}' ), _default: $ => seq( - ':', field('default', $._content) + ':', + field( + 'default', + repeat1(choice( + $._char, + $.escape, + $.substitution + )), + ) ), escape: _ => choice( diff --git a/src/grammar.json b/src/grammar.json index 86e0abe..38267e0 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -134,13 +134,13 @@ }, { "type": "SYMBOL", - "name": "index" + "name": "_index" } ] } } }, - "index": { + "_index": { "type": "SEQ", "members": [ { @@ -148,8 +148,13 @@ "value": "[" }, { - "type": "PATTERN", - "value": "\\d+" + "type": "ALIAS", + "content": { + "type": "PATTERN", + "value": "\\d+" + }, + "named": true, + "value": "index" }, { "type": "STRING", @@ -189,8 +194,20 @@ "value": "${" }, { - "type": "SYMBOL", - "name": "_content" + "type": "REPEAT1", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "key" + }, + { + "type": "SYMBOL", + "name": "substitution" + } + ] + } }, { "type": "CHOICE", @@ -210,22 +227,6 @@ } ] }, - "_content": { - "type": "REPEAT1", - "content": { - "type": "CHOICE", - "members": [ - { - "type": "SYMBOL", - "name": "key" - }, - { - "type": "SYMBOL", - "name": "substitution" - } - ] - } - }, "_default": { "type": "SEQ", "members": [ @@ -237,8 +238,24 @@ "type": "FIELD", "name": "default", "content": { - "type": "SYMBOL", - "name": "_content" + "type": "REPEAT1", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "_char" + }, + { + "type": "SYMBOL", + "name": "escape" + }, + { + "type": "SYMBOL", + "name": "substitution" + } + ] + } } } ] diff --git a/src/node-types.json b/src/node-types.json index c29f7e1..419ef19 100644 --- a/src/node-types.json +++ b/src/node-types.json @@ -23,11 +23,6 @@ ] } }, - { - "type": "index", - "named": true, - "fields": {} - }, { "type": "key", "named": true, @@ -75,7 +70,7 @@ "required": false, "types": [ { - "type": "key", + "type": "escape", "named": true }, { @@ -151,6 +146,10 @@ "type": "comment", "named": true }, + { + "type": "index", + "named": true + }, { "type": "}", "named": false diff --git a/src/parser.c b/src/parser.c index 9dd9ff2..48140ae 100644 --- a/src/parser.c +++ b/src/parser.c @@ -6,9 +6,9 @@ #endif #define LANGUAGE_VERSION 14 -#define STATE_COUNT 62 +#define STATE_COUNT 57 #define LARGE_STATE_COUNT 7 -#define SYMBOL_COUNT 30 +#define SYMBOL_COUNT 31 #define ALIAS_COUNT 0 #define TOKEN_COUNT 16 #define EXTERNAL_TOKEN_COUNT 0 @@ -22,7 +22,7 @@ enum { anon_sym_COLON = 3, anon_sym_DOT = 4, anon_sym_LBRACK = 5, - aux_sym_index_token1 = 6, + aux_sym__index_token1 = 6, anon_sym_RBRACK = 7, anon_sym_DOLLAR_LBRACE = 8, anon_sym_RBRACE = 9, @@ -35,17 +35,18 @@ enum { sym_file = 16, sym_property = 17, sym_key = 18, - sym_index = 19, + sym__index = 19, sym_value = 20, sym_substitution = 21, - aux_sym__content = 22, - sym__default = 23, - sym_escape = 24, - sym__linebreak = 25, - sym__char = 26, - aux_sym_file_repeat1 = 27, - aux_sym_key_repeat1 = 28, - aux_sym_value_repeat1 = 29, + sym__default = 22, + sym_escape = 23, + sym__linebreak = 24, + sym__char = 25, + aux_sym_file_repeat1 = 26, + aux_sym_key_repeat1 = 27, + aux_sym_value_repeat1 = 28, + aux_sym_substitution_repeat1 = 29, + aux_sym__default_repeat1 = 30, }; static const char * const ts_symbol_names[] = { @@ -55,7 +56,7 @@ static const char * const ts_symbol_names[] = { [anon_sym_COLON] = ":", [anon_sym_DOT] = ".", [anon_sym_LBRACK] = "[", - [aux_sym_index_token1] = "index_token1", + [aux_sym__index_token1] = "index", [anon_sym_RBRACK] = "]", [anon_sym_DOLLAR_LBRACE] = "${", [anon_sym_RBRACE] = "}", @@ -68,10 +69,9 @@ static const char * const ts_symbol_names[] = { [sym_file] = "file", [sym_property] = "property", [sym_key] = "key", - [sym_index] = "index", + [sym__index] = "_index", [sym_value] = "value", [sym_substitution] = "substitution", - [aux_sym__content] = "_content", [sym__default] = "_default", [sym_escape] = "escape", [sym__linebreak] = "_linebreak", @@ -79,6 +79,8 @@ static const char * const ts_symbol_names[] = { [aux_sym_file_repeat1] = "file_repeat1", [aux_sym_key_repeat1] = "key_repeat1", [aux_sym_value_repeat1] = "value_repeat1", + [aux_sym_substitution_repeat1] = "substitution_repeat1", + [aux_sym__default_repeat1] = "_default_repeat1", }; static const TSSymbol ts_symbol_map[] = { @@ -88,7 +90,7 @@ static const TSSymbol ts_symbol_map[] = { [anon_sym_COLON] = anon_sym_COLON, [anon_sym_DOT] = anon_sym_DOT, [anon_sym_LBRACK] = anon_sym_LBRACK, - [aux_sym_index_token1] = aux_sym_index_token1, + [aux_sym__index_token1] = aux_sym__index_token1, [anon_sym_RBRACK] = anon_sym_RBRACK, [anon_sym_DOLLAR_LBRACE] = anon_sym_DOLLAR_LBRACE, [anon_sym_RBRACE] = anon_sym_RBRACE, @@ -101,10 +103,9 @@ static const TSSymbol ts_symbol_map[] = { [sym_file] = sym_file, [sym_property] = sym_property, [sym_key] = sym_key, - [sym_index] = sym_index, + [sym__index] = sym__index, [sym_value] = sym_value, [sym_substitution] = sym_substitution, - [aux_sym__content] = aux_sym__content, [sym__default] = sym__default, [sym_escape] = sym_escape, [sym__linebreak] = sym__linebreak, @@ -112,6 +113,8 @@ static const TSSymbol ts_symbol_map[] = { [aux_sym_file_repeat1] = aux_sym_file_repeat1, [aux_sym_key_repeat1] = aux_sym_key_repeat1, [aux_sym_value_repeat1] = aux_sym_value_repeat1, + [aux_sym_substitution_repeat1] = aux_sym_substitution_repeat1, + [aux_sym__default_repeat1] = aux_sym__default_repeat1, }; static const TSSymbolMetadata ts_symbol_metadata[] = { @@ -139,9 +142,9 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = false, }, - [aux_sym_index_token1] = { - .visible = false, - .named = false, + [aux_sym__index_token1] = { + .visible = true, + .named = true, }, [anon_sym_RBRACK] = { .visible = true, @@ -191,8 +194,8 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = true, }, - [sym_index] = { - .visible = true, + [sym__index] = { + .visible = false, .named = true, }, [sym_value] = { @@ -203,10 +206,6 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = true, }, - [aux_sym__content] = { - .visible = false, - .named = false, - }, [sym__default] = { .visible = false, .named = true, @@ -235,6 +234,14 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = false, .named = false, }, + [aux_sym_substitution_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym__default_repeat1] = { + .visible = false, + .named = false, + }, }; enum { @@ -270,65 +277,60 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [0] = 0, [1] = 1, [2] = 2, - [3] = 2, - [4] = 4, - [5] = 5, - [6] = 2, + [3] = 3, + [4] = 3, + [5] = 3, + [6] = 6, [7] = 7, [8] = 8, [9] = 9, [10] = 10, [11] = 11, [12] = 12, - [13] = 11, + [13] = 13, [14] = 14, - [15] = 15, - [16] = 14, + [15] = 14, + [16] = 16, [17] = 14, [18] = 18, [19] = 19, - [20] = 20, - [21] = 21, + [20] = 9, + [21] = 10, [22] = 22, - [23] = 8, - [24] = 10, - [25] = 10, + [23] = 23, + [24] = 24, + [25] = 25, [26] = 26, [27] = 27, [28] = 28, [29] = 29, - [30] = 8, + [30] = 25, [31] = 31, [32] = 32, [33] = 33, - [34] = 27, - [35] = 28, - [36] = 36, - [37] = 27, - [38] = 28, - [39] = 33, - [40] = 36, - [41] = 33, - [42] = 36, + [34] = 24, + [35] = 25, + [36] = 32, + [37] = 37, + [38] = 31, + [39] = 25, + [40] = 31, + [41] = 32, + [42] = 42, [43] = 43, - [44] = 28, + [44] = 44, [45] = 45, [46] = 46, [47] = 47, [48] = 48, [49] = 49, - [50] = 50, - [51] = 51, + [50] = 49, + [51] = 45, [52] = 52, - [53] = 53, - [54] = 48, - [55] = 52, - [56] = 52, - [57] = 48, - [58] = 51, - [59] = 59, - [60] = 51, - [61] = 61, + [53] = 45, + [54] = 54, + [55] = 55, + [56] = 54, }; static bool ts_lex(TSLexer *lexer, TSStateId state) { @@ -336,118 +338,117 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { eof = lexer->eof(lexer); switch (state) { case 0: - if (eof) ADVANCE(14); - if (lookahead == '\n') ADVANCE(15); - if (lookahead == '\r') ADVANCE(16); - if (lookahead == '$') ADVANCE(33); - if (lookahead == '.') ADVANCE(19); - if (lookahead == ':') ADVANCE(18); - if (lookahead == '=') ADVANCE(17); - if (lookahead == '[') ADVANCE(20); - if (lookahead == '\\') ADVANCE(29); - if (lookahead == ']') ADVANCE(22); - if (lookahead == '}') ADVANCE(24); + if (eof) ADVANCE(15); + if (lookahead == '\n') ADVANCE(16); + if (lookahead == '\r') ADVANCE(17); + if (lookahead == '$') ADVANCE(34); + if (lookahead == '.') ADVANCE(20); + if (lookahead == ':') ADVANCE(19); + if (lookahead == '=') ADVANCE(18); + if (lookahead == '[') ADVANCE(21); + if (lookahead == '\\') ADVANCE(30); + if (lookahead == ']') ADVANCE(23); + if (lookahead == '}') ADVANCE(25); if (lookahead == '!' || - lookahead == '#') ADVANCE(28); + lookahead == '#') ADVANCE(29); if (lookahead == '\t' || lookahead == '\f' || - lookahead == ' ') ADVANCE(30); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(21); - if (lookahead != 0) ADVANCE(31); + lookahead == ' ') ADVANCE(31); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(22); + if (lookahead != 0) ADVANCE(32); END_STATE(); case 1: - if (lookahead == '\n') ADVANCE(15); - if (lookahead == '\r') ADVANCE(16); - if (lookahead == '$') ADVANCE(33); - if (lookahead == '.') ADVANCE(19); - if (lookahead == ':') ADVANCE(18); - if (lookahead == '=') ADVANCE(17); - if (lookahead == '[') ADVANCE(20); - if (lookahead == '\\') ADVANCE(29); + if (lookahead == '\n') ADVANCE(16); + if (lookahead == '\r') ADVANCE(17); + if (lookahead == '$') ADVANCE(34); + if (lookahead == '.') ADVANCE(20); + if (lookahead == ':') ADVANCE(19); + if (lookahead == '=') ADVANCE(18); + if (lookahead == '[') ADVANCE(21); + if (lookahead == '\\') ADVANCE(30); if (lookahead == '\t' || lookahead == '\f' || - lookahead == ' ') ADVANCE(30); - if (lookahead != 0) ADVANCE(31); + lookahead == ' ') ADVANCE(31); + if (lookahead != 0) ADVANCE(32); END_STATE(); case 2: - if (lookahead == '\n') ADVANCE(15); - if (lookahead == '\r') ADVANCE(16); - if (lookahead == '$') ADVANCE(33); - if (lookahead == ':') ADVANCE(18); - if (lookahead == '=') ADVANCE(17); - if (lookahead == '\\') ADVANCE(29); + if (lookahead == '\n') ADVANCE(16); + if (lookahead == '\r') ADVANCE(17); + if (lookahead == '$') ADVANCE(34); + if (lookahead == ':') ADVANCE(19); + if (lookahead == '=') ADVANCE(18); + if (lookahead == '\\') ADVANCE(30); if (lookahead == '\t' || lookahead == '\f' || - lookahead == ' ') ADVANCE(30); - if (lookahead != 0) ADVANCE(31); + lookahead == ' ') ADVANCE(31); + if (lookahead != 0) ADVANCE(32); END_STATE(); case 3: - if (lookahead == '\n') ADVANCE(15); - if (lookahead == '\r') ADVANCE(16); - if (lookahead == '$') ADVANCE(33); - if (lookahead == '\\') ADVANCE(29); + if (lookahead == '\n') ADVANCE(16); + if (lookahead == '\r') ADVANCE(17); + if (lookahead == '$') ADVANCE(34); + if (lookahead == '\\') ADVANCE(30); if (lookahead == '\t' || lookahead == '\f' || - lookahead == ' ') ADVANCE(30); - if (lookahead != 0) ADVANCE(31); + lookahead == ' ') ADVANCE(31); + if (lookahead != 0) ADVANCE(32); END_STATE(); case 4: - if (lookahead == '\n') ADVANCE(15); - if (lookahead == '\r') ADVANCE(16); - if (lookahead == '$') ADVANCE(33); - if (lookahead == '\\') ADVANCE(29); - if (lookahead != 0) ADVANCE(31); + if (lookahead == '\n') ADVANCE(16); + if (lookahead == '\r') ADVANCE(17); + if (lookahead == '$') ADVANCE(34); + if (lookahead == '\\') ADVANCE(30); + if (lookahead != 0) ADVANCE(32); END_STATE(); case 5: - if (lookahead == '\n') ADVANCE(15); - if (lookahead == '\r') ADVANCE(16); - if (lookahead == '.') ADVANCE(19); - if (lookahead == '[') ADVANCE(20); - if (lookahead == '\\') ADVANCE(32); + if (lookahead == '\n') ADVANCE(16); + if (lookahead == '\r') ADVANCE(17); + if (lookahead == '.') ADVANCE(20); + if (lookahead == '[') ADVANCE(21); + if (lookahead == '\\') ADVANCE(33); if (lookahead == '!' || - lookahead == '#') ADVANCE(28); - if (lookahead != 0) ADVANCE(31); + lookahead == '#') ADVANCE(29); + if (lookahead != 0) ADVANCE(32); END_STATE(); case 6: - if (lookahead == '$') ADVANCE(33); - if (lookahead == '.') ADVANCE(19); - if (lookahead == ':') ADVANCE(18); - if (lookahead == '[') ADVANCE(20); - if (lookahead == '\\') ADVANCE(32); - if (lookahead == '}') ADVANCE(24); + if (lookahead == '$') ADVANCE(34); + if (lookahead == '.') ADVANCE(20); + if (lookahead == ':') ADVANCE(19); + if (lookahead == '[') ADVANCE(21); + if (lookahead == '\\') ADVANCE(33); + if (lookahead == '}') ADVANCE(25); if (lookahead != 0 && - lookahead != '\n') ADVANCE(31); + lookahead != '\n') ADVANCE(32); END_STATE(); case 7: - if (lookahead == '$') ADVANCE(33); - if (lookahead == '.') ADVANCE(19); - if (lookahead == '[') ADVANCE(20); - if (lookahead == '\\') ADVANCE(32); - if (lookahead == '}') ADVANCE(24); + if (lookahead == '$') ADVANCE(34); + if (lookahead == '.') ADVANCE(20); + if (lookahead == '[') ADVANCE(21); + if (lookahead == '\\') ADVANCE(33); if (lookahead != 0 && - lookahead != '\n') ADVANCE(31); + lookahead != '\n') ADVANCE(32); END_STATE(); case 8: - if (lookahead == '$') ADVANCE(33); - if (lookahead == '.') ADVANCE(19); - if (lookahead == '[') ADVANCE(20); - if (lookahead == '\\') ADVANCE(32); + if (lookahead == '$') ADVANCE(34); + if (lookahead == '\\') ADVANCE(33); + if (lookahead == '}') ADVANCE(25); if (lookahead != 0 && - lookahead != '\n') ADVANCE(31); + lookahead != '\n') ADVANCE(32); END_STATE(); case 9: - if (lookahead == ']') ADVANCE(22); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(21); + if (lookahead == '$') ADVANCE(34); + if (lookahead == '\\') ADVANCE(33); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(32); END_STATE(); case 10: - if (('0' <= lookahead && lookahead <= '9') || - ('A' <= lookahead && lookahead <= 'F') || - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(27); + if (lookahead == ']') ADVANCE(23); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(22); END_STATE(); case 11: if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'F') || - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(10); + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(28); END_STATE(); case 12: if (('0' <= lookahead && lookahead <= '9') || @@ -455,92 +456,97 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { ('a' <= lookahead && lookahead <= 'f')) ADVANCE(11); END_STATE(); case 13: - if (eof) ADVANCE(14); - if (lookahead == '\n') ADVANCE(15); - if (lookahead == '\r') ADVANCE(16); - if (lookahead == '.') ADVANCE(19); - if (lookahead == '[') ADVANCE(20); - if (lookahead == '\\') ADVANCE(32); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'F') || + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(12); + END_STATE(); + case 14: + if (eof) ADVANCE(15); + if (lookahead == '\n') ADVANCE(16); + if (lookahead == '\r') ADVANCE(17); + if (lookahead == '.') ADVANCE(20); + if (lookahead == '[') ADVANCE(21); + if (lookahead == '\\') ADVANCE(33); if (lookahead == '!' || - lookahead == '#') ADVANCE(28); + lookahead == '#') ADVANCE(29); if (lookahead == '\t' || lookahead == '\f' || - lookahead == ' ') ADVANCE(30); - if (lookahead != 0) ADVANCE(31); - END_STATE(); - case 14: - ACCEPT_TOKEN(ts_builtin_sym_end); + lookahead == ' ') ADVANCE(31); + if (lookahead != 0) ADVANCE(32); END_STATE(); case 15: - ACCEPT_TOKEN(aux_sym_file_token1); + ACCEPT_TOKEN(ts_builtin_sym_end); END_STATE(); case 16: ACCEPT_TOKEN(aux_sym_file_token1); - if (lookahead == '\n') ADVANCE(15); END_STATE(); case 17: - ACCEPT_TOKEN(anon_sym_EQ); + ACCEPT_TOKEN(aux_sym_file_token1); + if (lookahead == '\n') ADVANCE(16); END_STATE(); case 18: - ACCEPT_TOKEN(anon_sym_COLON); + ACCEPT_TOKEN(anon_sym_EQ); END_STATE(); case 19: - ACCEPT_TOKEN(anon_sym_DOT); + ACCEPT_TOKEN(anon_sym_COLON); END_STATE(); case 20: - ACCEPT_TOKEN(anon_sym_LBRACK); + ACCEPT_TOKEN(anon_sym_DOT); END_STATE(); case 21: - ACCEPT_TOKEN(aux_sym_index_token1); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(21); + ACCEPT_TOKEN(anon_sym_LBRACK); END_STATE(); case 22: - ACCEPT_TOKEN(anon_sym_RBRACK); + ACCEPT_TOKEN(aux_sym__index_token1); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(22); END_STATE(); case 23: - ACCEPT_TOKEN(anon_sym_DOLLAR_LBRACE); + ACCEPT_TOKEN(anon_sym_RBRACK); END_STATE(); case 24: - ACCEPT_TOKEN(anon_sym_RBRACE); + ACCEPT_TOKEN(anon_sym_DOLLAR_LBRACE); END_STATE(); case 25: - ACCEPT_TOKEN(aux_sym_escape_token1); + ACCEPT_TOKEN(anon_sym_RBRACE); END_STATE(); case 26: + ACCEPT_TOKEN(aux_sym_escape_token1); + END_STATE(); + case 27: ACCEPT_TOKEN(aux_sym_escape_token1); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'F') || - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(12); + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(13); END_STATE(); - case 27: + case 28: ACCEPT_TOKEN(aux_sym_escape_token2); END_STATE(); - case 28: + case 29: ACCEPT_TOKEN(sym_comment); if (lookahead != 0 && - lookahead != '\n') ADVANCE(28); + lookahead != '\n') ADVANCE(29); END_STATE(); - case 29: + case 30: ACCEPT_TOKEN(anon_sym_BSLASH); - if (lookahead == 'u') ADVANCE(26); + if (lookahead == 'u') ADVANCE(27); if (lookahead != 0 && - lookahead != '\n') ADVANCE(25); + lookahead != '\n') ADVANCE(26); END_STATE(); - case 30: + case 31: ACCEPT_TOKEN(sym__space); END_STATE(); - case 31: + case 32: ACCEPT_TOKEN(aux_sym__char_token1); END_STATE(); - case 32: + case 33: ACCEPT_TOKEN(aux_sym__char_token1); - if (lookahead == 'u') ADVANCE(26); + if (lookahead == 'u') ADVANCE(27); if (lookahead != 0 && - lookahead != '\n') ADVANCE(25); + lookahead != '\n') ADVANCE(26); END_STATE(); - case 33: + case 34: ACCEPT_TOKEN(aux_sym__char_token1); - if (lookahead == '{') ADVANCE(23); + if (lookahead == '{') ADVANCE(24); END_STATE(); default: return false; @@ -549,67 +555,62 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { static const TSLexMode ts_lex_modes[STATE_COUNT] = { [0] = {.lex_state = 0}, - [1] = {.lex_state = 13}, - [2] = {.lex_state = 6}, + [1] = {.lex_state = 14}, + [2] = {.lex_state = 14}, [3] = {.lex_state = 6}, - [4] = {.lex_state = 13}, - [5] = {.lex_state = 13}, - [6] = {.lex_state = 6}, - [7] = {.lex_state = 2}, - [8] = {.lex_state = 1}, - [9] = {.lex_state = 2}, + [4] = {.lex_state = 6}, + [5] = {.lex_state = 6}, + [6] = {.lex_state = 14}, + [7] = {.lex_state = 6}, + [8] = {.lex_state = 2}, + [9] = {.lex_state = 1}, [10] = {.lex_state = 1}, - [11] = {.lex_state = 6}, - [12] = {.lex_state = 7}, - [13] = {.lex_state = 7}, - [14] = {.lex_state = 8}, - [15] = {.lex_state = 5}, - [16] = {.lex_state = 8}, - [17] = {.lex_state = 8}, - [18] = {.lex_state = 3}, - [19] = {.lex_state = 8}, - [20] = {.lex_state = 3}, - [21] = {.lex_state = 4}, + [11] = {.lex_state = 2}, + [12] = {.lex_state = 5}, + [13] = {.lex_state = 3}, + [14] = {.lex_state = 7}, + [15] = {.lex_state = 7}, + [16] = {.lex_state = 3}, + [17] = {.lex_state = 7}, + [18] = {.lex_state = 4}, + [19] = {.lex_state = 4}, + [20] = {.lex_state = 6}, + [21] = {.lex_state = 6}, [22] = {.lex_state = 4}, - [23] = {.lex_state = 6}, - [24] = {.lex_state = 6}, - [25] = {.lex_state = 7}, - [26] = {.lex_state = 4}, - [27] = {.lex_state = 1}, - [28] = {.lex_state = 1}, - [29] = {.lex_state = 4}, - [30] = {.lex_state = 7}, - [31] = {.lex_state = 13}, - [32] = {.lex_state = 13}, - [33] = {.lex_state = 6}, + [23] = {.lex_state = 4}, + [24] = {.lex_state = 1}, + [25] = {.lex_state = 1}, + [26] = {.lex_state = 8}, + [27] = {.lex_state = 14}, + [28] = {.lex_state = 14}, + [29] = {.lex_state = 8}, + [30] = {.lex_state = 6}, + [31] = {.lex_state = 6}, + [32] = {.lex_state = 6}, + [33] = {.lex_state = 9}, [34] = {.lex_state = 6}, - [35] = {.lex_state = 6}, - [36] = {.lex_state = 6}, - [37] = {.lex_state = 7}, - [38] = {.lex_state = 7}, - [39] = {.lex_state = 7}, - [40] = {.lex_state = 7}, - [41] = {.lex_state = 4}, - [42] = {.lex_state = 4}, - [43] = {.lex_state = 4}, - [44] = {.lex_state = 4}, + [35] = {.lex_state = 4}, + [36] = {.lex_state = 4}, + [37] = {.lex_state = 4}, + [38] = {.lex_state = 4}, + [39] = {.lex_state = 8}, + [40] = {.lex_state = 8}, + [41] = {.lex_state = 8}, + [42] = {.lex_state = 0}, + [43] = {.lex_state = 0}, + [44] = {.lex_state = 0}, [45] = {.lex_state = 0}, [46] = {.lex_state = 0}, [47] = {.lex_state = 0}, [48] = {.lex_state = 0}, - [49] = {.lex_state = 0}, - [50] = {.lex_state = 0}, - [51] = {.lex_state = 9}, - [52] = {.lex_state = 9}, + [49] = {.lex_state = 10}, + [50] = {.lex_state = 10}, + [51] = {.lex_state = 0}, + [52] = {.lex_state = 0}, [53] = {.lex_state = 0}, - [54] = {.lex_state = 0}, - [55] = {.lex_state = 9}, - [56] = {.lex_state = 9}, - [57] = {.lex_state = 0}, - [58] = {.lex_state = 9}, - [59] = {.lex_state = 0}, - [60] = {.lex_state = 9}, - [61] = {.lex_state = 0}, + [54] = {.lex_state = 10}, + [55] = {.lex_state = 0}, + [56] = {.lex_state = 10}, }; static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { @@ -620,7 +621,7 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_COLON] = ACTIONS(1), [anon_sym_DOT] = ACTIONS(1), [anon_sym_LBRACK] = ACTIONS(1), - [aux_sym_index_token1] = ACTIONS(1), + [aux_sym__index_token1] = ACTIONS(1), [anon_sym_RBRACK] = ACTIONS(1), [anon_sym_DOLLAR_LBRACE] = ACTIONS(1), [anon_sym_RBRACE] = ACTIONS(1), @@ -632,14 +633,14 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [aux_sym__char_token1] = ACTIONS(1), }, [1] = { - [sym_file] = STATE(59), - [sym_property] = STATE(61), - [sym_key] = STATE(9), - [sym_index] = STATE(10), - [sym_escape] = STATE(10), - [sym__char] = STATE(10), - [aux_sym_file_repeat1] = STATE(5), - [aux_sym_key_repeat1] = STATE(10), + [sym_file] = STATE(52), + [sym_property] = STATE(55), + [sym_key] = STATE(8), + [sym__index] = STATE(9), + [sym_escape] = STATE(9), + [sym__char] = STATE(9), + [aux_sym_file_repeat1] = STATE(2), + [aux_sym_key_repeat1] = STATE(9), [ts_builtin_sym_end] = ACTIONS(3), [aux_sym_file_token1] = ACTIONS(5), [anon_sym_DOT] = ACTIONS(7), @@ -651,69 +652,15 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [aux_sym__char_token1] = ACTIONS(19), }, [2] = { - [sym_key] = STATE(11), - [sym_index] = STATE(24), - [sym_substitution] = STATE(11), - [aux_sym__content] = STATE(11), - [sym__default] = STATE(54), - [sym_escape] = STATE(24), - [sym__char] = STATE(24), - [aux_sym_key_repeat1] = STATE(24), - [anon_sym_COLON] = ACTIONS(21), - [anon_sym_DOT] = ACTIONS(23), - [anon_sym_LBRACK] = ACTIONS(25), - [anon_sym_DOLLAR_LBRACE] = ACTIONS(27), - [anon_sym_RBRACE] = ACTIONS(29), - [aux_sym_escape_token1] = ACTIONS(31), - [aux_sym_escape_token2] = ACTIONS(33), - [aux_sym__char_token1] = ACTIONS(35), - }, - [3] = { - [sym_key] = STATE(11), - [sym_index] = STATE(24), - [sym_substitution] = STATE(11), - [aux_sym__content] = STATE(11), - [sym__default] = STATE(48), - [sym_escape] = STATE(24), - [sym__char] = STATE(24), - [aux_sym_key_repeat1] = STATE(24), - [anon_sym_COLON] = ACTIONS(21), - [anon_sym_DOT] = ACTIONS(23), - [anon_sym_LBRACK] = ACTIONS(25), - [anon_sym_DOLLAR_LBRACE] = ACTIONS(27), - [anon_sym_RBRACE] = ACTIONS(37), - [aux_sym_escape_token1] = ACTIONS(31), - [aux_sym_escape_token2] = ACTIONS(33), - [aux_sym__char_token1] = ACTIONS(35), - }, - [4] = { - [sym_property] = STATE(61), - [sym_key] = STATE(9), - [sym_index] = STATE(10), - [sym_escape] = STATE(10), - [sym__char] = STATE(10), - [aux_sym_file_repeat1] = STATE(4), - [aux_sym_key_repeat1] = STATE(10), - [ts_builtin_sym_end] = ACTIONS(39), - [aux_sym_file_token1] = ACTIONS(41), - [anon_sym_DOT] = ACTIONS(44), - [anon_sym_LBRACK] = ACTIONS(47), - [aux_sym_escape_token1] = ACTIONS(50), - [aux_sym_escape_token2] = ACTIONS(53), - [sym_comment] = ACTIONS(56), - [sym__space] = ACTIONS(59), - [aux_sym__char_token1] = ACTIONS(62), - }, - [5] = { - [sym_property] = STATE(61), - [sym_key] = STATE(9), - [sym_index] = STATE(10), - [sym_escape] = STATE(10), - [sym__char] = STATE(10), - [aux_sym_file_repeat1] = STATE(4), - [aux_sym_key_repeat1] = STATE(10), - [ts_builtin_sym_end] = ACTIONS(65), - [aux_sym_file_token1] = ACTIONS(67), + [sym_property] = STATE(55), + [sym_key] = STATE(8), + [sym__index] = STATE(9), + [sym_escape] = STATE(9), + [sym__char] = STATE(9), + [aux_sym_file_repeat1] = STATE(6), + [aux_sym_key_repeat1] = STATE(9), + [ts_builtin_sym_end] = ACTIONS(21), + [aux_sym_file_token1] = ACTIONS(23), [anon_sym_DOT] = ACTIONS(7), [anon_sym_LBRACK] = ACTIONS(9), [aux_sym_escape_token1] = ACTIONS(11), @@ -722,223 +669,207 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [sym__space] = ACTIONS(17), [aux_sym__char_token1] = ACTIONS(19), }, + [3] = { + [sym_key] = STATE(7), + [sym__index] = STATE(20), + [sym_substitution] = STATE(7), + [sym__default] = STATE(45), + [sym_escape] = STATE(20), + [sym__char] = STATE(20), + [aux_sym_key_repeat1] = STATE(20), + [aux_sym_substitution_repeat1] = STATE(7), + [anon_sym_COLON] = ACTIONS(25), + [anon_sym_DOT] = ACTIONS(27), + [anon_sym_LBRACK] = ACTIONS(29), + [anon_sym_DOLLAR_LBRACE] = ACTIONS(31), + [anon_sym_RBRACE] = ACTIONS(33), + [aux_sym_escape_token1] = ACTIONS(35), + [aux_sym_escape_token2] = ACTIONS(37), + [aux_sym__char_token1] = ACTIONS(39), + }, + [4] = { + [sym_key] = STATE(7), + [sym__index] = STATE(20), + [sym_substitution] = STATE(7), + [sym__default] = STATE(53), + [sym_escape] = STATE(20), + [sym__char] = STATE(20), + [aux_sym_key_repeat1] = STATE(20), + [aux_sym_substitution_repeat1] = STATE(7), + [anon_sym_COLON] = ACTIONS(25), + [anon_sym_DOT] = ACTIONS(27), + [anon_sym_LBRACK] = ACTIONS(29), + [anon_sym_DOLLAR_LBRACE] = ACTIONS(31), + [anon_sym_RBRACE] = ACTIONS(41), + [aux_sym_escape_token1] = ACTIONS(35), + [aux_sym_escape_token2] = ACTIONS(37), + [aux_sym__char_token1] = ACTIONS(39), + }, + [5] = { + [sym_key] = STATE(7), + [sym__index] = STATE(20), + [sym_substitution] = STATE(7), + [sym__default] = STATE(51), + [sym_escape] = STATE(20), + [sym__char] = STATE(20), + [aux_sym_key_repeat1] = STATE(20), + [aux_sym_substitution_repeat1] = STATE(7), + [anon_sym_COLON] = ACTIONS(25), + [anon_sym_DOT] = ACTIONS(27), + [anon_sym_LBRACK] = ACTIONS(29), + [anon_sym_DOLLAR_LBRACE] = ACTIONS(31), + [anon_sym_RBRACE] = ACTIONS(43), + [aux_sym_escape_token1] = ACTIONS(35), + [aux_sym_escape_token2] = ACTIONS(37), + [aux_sym__char_token1] = ACTIONS(39), + }, [6] = { - [sym_key] = STATE(11), - [sym_index] = STATE(24), - [sym_substitution] = STATE(11), - [aux_sym__content] = STATE(11), - [sym__default] = STATE(57), - [sym_escape] = STATE(24), - [sym__char] = STATE(24), - [aux_sym_key_repeat1] = STATE(24), - [anon_sym_COLON] = ACTIONS(21), - [anon_sym_DOT] = ACTIONS(23), - [anon_sym_LBRACK] = ACTIONS(25), - [anon_sym_DOLLAR_LBRACE] = ACTIONS(27), - [anon_sym_RBRACE] = ACTIONS(69), - [aux_sym_escape_token1] = ACTIONS(31), - [aux_sym_escape_token2] = ACTIONS(33), - [aux_sym__char_token1] = ACTIONS(35), + [sym_property] = STATE(55), + [sym_key] = STATE(8), + [sym__index] = STATE(9), + [sym_escape] = STATE(9), + [sym__char] = STATE(9), + [aux_sym_file_repeat1] = STATE(6), + [aux_sym_key_repeat1] = STATE(9), + [ts_builtin_sym_end] = ACTIONS(45), + [aux_sym_file_token1] = ACTIONS(47), + [anon_sym_DOT] = ACTIONS(50), + [anon_sym_LBRACK] = ACTIONS(53), + [aux_sym_escape_token1] = ACTIONS(56), + [aux_sym_escape_token2] = ACTIONS(59), + [sym_comment] = ACTIONS(62), + [sym__space] = ACTIONS(65), + [aux_sym__char_token1] = ACTIONS(68), }, }; static const uint16_t ts_small_parse_table[] = { - [0] = 10, - ACTIONS(71), 1, - aux_sym_file_token1, - ACTIONS(75), 1, + [0] = 9, + ACTIONS(73), 1, + anon_sym_DOT, + ACTIONS(76), 1, + anon_sym_LBRACK, + ACTIONS(79), 1, anon_sym_DOLLAR_LBRACE, - ACTIONS(77), 1, + ACTIONS(82), 1, aux_sym_escape_token1, - ACTIONS(79), 1, - aux_sym_escape_token2, - ACTIONS(81), 1, - anon_sym_BSLASH, - ACTIONS(83), 1, - sym__space, ACTIONS(85), 1, + aux_sym_escape_token2, + ACTIONS(88), 1, aux_sym__char_token1, - STATE(45), 1, - sym_value, - ACTIONS(73), 2, - anon_sym_EQ, + ACTIONS(71), 2, anon_sym_COLON, - STATE(26), 5, + anon_sym_RBRACE, + STATE(7), 3, + sym_key, sym_substitution, + aux_sym_substitution_repeat1, + STATE(20), 4, + sym__index, sym_escape, - sym__linebreak, sym__char, - aux_sym_value_repeat1, - [36] = 8, - ACTIONS(89), 1, - anon_sym_DOT, - ACTIONS(92), 1, - anon_sym_LBRACK, + aux_sym_key_repeat1, + [34] = 10, + ACTIONS(91), 1, + aux_sym_file_token1, ACTIONS(95), 1, + anon_sym_DOLLAR_LBRACE, + ACTIONS(97), 1, aux_sym_escape_token1, - ACTIONS(98), 1, + ACTIONS(99), 1, aux_sym_escape_token2, ACTIONS(101), 1, anon_sym_BSLASH, ACTIONS(103), 1, - aux_sym__char_token1, - STATE(8), 4, - sym_index, - sym_escape, - sym__char, - aux_sym_key_repeat1, - ACTIONS(87), 5, - aux_sym_file_token1, - anon_sym_EQ, - anon_sym_COLON, - anon_sym_DOLLAR_LBRACE, sym__space, - [68] = 10, - ACTIONS(75), 1, - anon_sym_DOLLAR_LBRACE, - ACTIONS(77), 1, - aux_sym_escape_token1, - ACTIONS(79), 1, - aux_sym_escape_token2, - ACTIONS(81), 1, - anon_sym_BSLASH, - ACTIONS(85), 1, + ACTIONS(105), 1, aux_sym__char_token1, - ACTIONS(106), 1, - aux_sym_file_token1, - ACTIONS(110), 1, - sym__space, - STATE(46), 1, + STATE(47), 1, sym_value, - ACTIONS(108), 2, + ACTIONS(93), 2, anon_sym_EQ, anon_sym_COLON, - STATE(26), 5, + STATE(23), 5, sym_substitution, sym_escape, sym__linebreak, sym__char, aux_sym_value_repeat1, - [104] = 8, + [70] = 8, ACTIONS(9), 1, anon_sym_LBRACK, ACTIONS(11), 1, aux_sym_escape_token1, ACTIONS(13), 1, aux_sym_escape_token2, - ACTIONS(114), 1, + ACTIONS(109), 1, anon_sym_DOT, - ACTIONS(116), 1, + ACTIONS(111), 1, anon_sym_BSLASH, - ACTIONS(118), 1, + ACTIONS(113), 1, aux_sym__char_token1, - STATE(8), 4, - sym_index, + STATE(10), 4, + sym__index, sym_escape, sym__char, aux_sym_key_repeat1, - ACTIONS(112), 5, + ACTIONS(107), 5, aux_sym_file_token1, anon_sym_EQ, anon_sym_COLON, anon_sym_DOLLAR_LBRACE, sym__space, - [136] = 9, - ACTIONS(122), 1, + [102] = 8, + ACTIONS(117), 1, anon_sym_DOT, - ACTIONS(125), 1, - anon_sym_LBRACK, - ACTIONS(128), 1, - anon_sym_DOLLAR_LBRACE, - ACTIONS(131), 1, - aux_sym_escape_token1, - ACTIONS(134), 1, - aux_sym_escape_token2, - ACTIONS(137), 1, - aux_sym__char_token1, - ACTIONS(120), 2, - anon_sym_COLON, - anon_sym_RBRACE, - STATE(11), 3, - sym_key, - sym_substitution, - aux_sym__content, - STATE(24), 4, - sym_index, - sym_escape, - sym__char, - aux_sym_key_repeat1, - [170] = 9, - ACTIONS(140), 1, - anon_sym_DOT, - ACTIONS(142), 1, - anon_sym_LBRACK, - ACTIONS(144), 1, - anon_sym_DOLLAR_LBRACE, - ACTIONS(146), 1, - anon_sym_RBRACE, - ACTIONS(148), 1, - aux_sym_escape_token1, - ACTIONS(150), 1, - aux_sym_escape_token2, - ACTIONS(152), 1, - aux_sym__char_token1, - STATE(13), 3, - sym_key, - sym_substitution, - aux_sym__content, - STATE(25), 4, - sym_index, - sym_escape, - sym__char, - aux_sym_key_repeat1, - [203] = 9, ACTIONS(120), 1, - anon_sym_RBRACE, - ACTIONS(154), 1, - anon_sym_DOT, - ACTIONS(157), 1, anon_sym_LBRACK, - ACTIONS(160), 1, - anon_sym_DOLLAR_LBRACE, - ACTIONS(163), 1, + ACTIONS(123), 1, aux_sym_escape_token1, - ACTIONS(166), 1, + ACTIONS(126), 1, aux_sym_escape_token2, - ACTIONS(169), 1, + ACTIONS(129), 1, + anon_sym_BSLASH, + ACTIONS(131), 1, aux_sym__char_token1, - STATE(13), 3, - sym_key, - sym_substitution, - aux_sym__content, - STATE(25), 4, - sym_index, + STATE(10), 4, + sym__index, sym_escape, sym__char, aux_sym_key_repeat1, - [236] = 8, - ACTIONS(23), 1, - anon_sym_DOT, - ACTIONS(25), 1, - anon_sym_LBRACK, - ACTIONS(27), 1, + ACTIONS(115), 5, + aux_sym_file_token1, + anon_sym_EQ, + anon_sym_COLON, anon_sym_DOLLAR_LBRACE, - ACTIONS(31), 1, + sym__space, + [134] = 10, + ACTIONS(95), 1, + anon_sym_DOLLAR_LBRACE, + ACTIONS(97), 1, aux_sym_escape_token1, - ACTIONS(33), 1, + ACTIONS(99), 1, aux_sym_escape_token2, - ACTIONS(35), 1, + ACTIONS(101), 1, + anon_sym_BSLASH, + ACTIONS(105), 1, aux_sym__char_token1, - STATE(3), 3, - sym_key, + ACTIONS(134), 1, + aux_sym_file_token1, + ACTIONS(138), 1, + sym__space, + STATE(48), 1, + sym_value, + ACTIONS(136), 2, + anon_sym_EQ, + anon_sym_COLON, + STATE(23), 5, sym_substitution, - aux_sym__content, - STATE(24), 4, - sym_index, sym_escape, + sym__linebreak, sym__char, - aux_sym_key_repeat1, - [266] = 10, + aux_sym_value_repeat1, + [170] = 10, ACTIONS(7), 1, anon_sym_DOT, ACTIONS(9), 1, @@ -949,257 +880,257 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_escape_token2, ACTIONS(19), 1, aux_sym__char_token1, - ACTIONS(172), 1, + ACTIONS(140), 1, aux_sym_file_token1, - ACTIONS(174), 1, + ACTIONS(142), 1, sym_comment, - STATE(9), 1, + STATE(8), 1, sym_key, - STATE(53), 1, + STATE(46), 1, sym_property, - STATE(10), 4, - sym_index, + STATE(9), 4, + sym__index, sym_escape, sym__char, aux_sym_key_repeat1, - [300] = 8, - ACTIONS(23), 1, + [204] = 9, + ACTIONS(95), 1, + anon_sym_DOLLAR_LBRACE, + ACTIONS(97), 1, + aux_sym_escape_token1, + ACTIONS(99), 1, + aux_sym_escape_token2, + ACTIONS(101), 1, + anon_sym_BSLASH, + ACTIONS(105), 1, + aux_sym__char_token1, + ACTIONS(134), 1, + aux_sym_file_token1, + ACTIONS(138), 1, + sym__space, + STATE(48), 1, + sym_value, + STATE(23), 5, + sym_substitution, + sym_escape, + sym__linebreak, + sym__char, + aux_sym_value_repeat1, + [236] = 8, + ACTIONS(27), 1, anon_sym_DOT, - ACTIONS(25), 1, + ACTIONS(29), 1, anon_sym_LBRACK, - ACTIONS(27), 1, - anon_sym_DOLLAR_LBRACE, ACTIONS(31), 1, + anon_sym_DOLLAR_LBRACE, + ACTIONS(35), 1, aux_sym_escape_token1, - ACTIONS(33), 1, + ACTIONS(37), 1, aux_sym_escape_token2, - ACTIONS(35), 1, + ACTIONS(39), 1, aux_sym__char_token1, - STATE(6), 3, + STATE(3), 3, sym_key, sym_substitution, - aux_sym__content, - STATE(24), 4, - sym_index, + aux_sym_substitution_repeat1, + STATE(20), 4, + sym__index, sym_escape, sym__char, aux_sym_key_repeat1, - [330] = 8, - ACTIONS(23), 1, + [266] = 8, + ACTIONS(27), 1, anon_sym_DOT, - ACTIONS(25), 1, + ACTIONS(29), 1, anon_sym_LBRACK, - ACTIONS(27), 1, - anon_sym_DOLLAR_LBRACE, ACTIONS(31), 1, + anon_sym_DOLLAR_LBRACE, + ACTIONS(35), 1, aux_sym_escape_token1, - ACTIONS(33), 1, + ACTIONS(37), 1, aux_sym_escape_token2, - ACTIONS(35), 1, + ACTIONS(39), 1, aux_sym__char_token1, - STATE(2), 3, + STATE(4), 3, sym_key, sym_substitution, - aux_sym__content, - STATE(24), 4, - sym_index, + aux_sym_substitution_repeat1, + STATE(20), 4, + sym__index, sym_escape, sym__char, aux_sym_key_repeat1, - [360] = 9, - ACTIONS(75), 1, + [296] = 9, + ACTIONS(95), 1, anon_sym_DOLLAR_LBRACE, - ACTIONS(77), 1, + ACTIONS(97), 1, aux_sym_escape_token1, - ACTIONS(79), 1, + ACTIONS(99), 1, aux_sym_escape_token2, - ACTIONS(81), 1, + ACTIONS(101), 1, anon_sym_BSLASH, - ACTIONS(85), 1, + ACTIONS(105), 1, aux_sym__char_token1, - ACTIONS(176), 1, + ACTIONS(144), 1, aux_sym_file_token1, - ACTIONS(178), 1, + ACTIONS(146), 1, sym__space, - STATE(49), 1, + STATE(44), 1, sym_value, - STATE(26), 5, + STATE(23), 5, sym_substitution, sym_escape, sym__linebreak, sym__char, aux_sym_value_repeat1, - [392] = 8, - ACTIONS(140), 1, + [328] = 8, + ACTIONS(27), 1, anon_sym_DOT, - ACTIONS(142), 1, + ACTIONS(29), 1, anon_sym_LBRACK, - ACTIONS(144), 1, + ACTIONS(31), 1, anon_sym_DOLLAR_LBRACE, - ACTIONS(148), 1, + ACTIONS(35), 1, aux_sym_escape_token1, - ACTIONS(150), 1, + ACTIONS(37), 1, aux_sym_escape_token2, - ACTIONS(152), 1, + ACTIONS(39), 1, aux_sym__char_token1, - STATE(12), 3, + STATE(5), 3, sym_key, sym_substitution, - aux_sym__content, - STATE(25), 4, - sym_index, + aux_sym_substitution_repeat1, + STATE(20), 4, + sym__index, sym_escape, sym__char, aux_sym_key_repeat1, - [422] = 9, - ACTIONS(71), 1, - aux_sym_file_token1, - ACTIONS(75), 1, - anon_sym_DOLLAR_LBRACE, - ACTIONS(77), 1, - aux_sym_escape_token1, - ACTIONS(79), 1, - aux_sym_escape_token2, - ACTIONS(81), 1, - anon_sym_BSLASH, - ACTIONS(83), 1, - sym__space, - ACTIONS(85), 1, - aux_sym__char_token1, - STATE(45), 1, - sym_value, - STATE(26), 5, - sym_substitution, - sym_escape, - sym__linebreak, - sym__char, - aux_sym_value_repeat1, - [454] = 8, - ACTIONS(75), 1, + [358] = 8, + ACTIONS(95), 1, anon_sym_DOLLAR_LBRACE, - ACTIONS(77), 1, + ACTIONS(97), 1, aux_sym_escape_token1, - ACTIONS(79), 1, + ACTIONS(99), 1, aux_sym_escape_token2, - ACTIONS(81), 1, + ACTIONS(101), 1, anon_sym_BSLASH, - ACTIONS(85), 1, + ACTIONS(105), 1, aux_sym__char_token1, - ACTIONS(180), 1, + ACTIONS(148), 1, aux_sym_file_token1, - STATE(50), 1, + STATE(43), 1, sym_value, - STATE(26), 5, + STATE(23), 5, sym_substitution, sym_escape, sym__linebreak, sym__char, aux_sym_value_repeat1, - [483] = 8, - ACTIONS(75), 1, + [387] = 8, + ACTIONS(95), 1, anon_sym_DOLLAR_LBRACE, - ACTIONS(77), 1, + ACTIONS(97), 1, aux_sym_escape_token1, - ACTIONS(79), 1, + ACTIONS(99), 1, aux_sym_escape_token2, - ACTIONS(81), 1, + ACTIONS(101), 1, anon_sym_BSLASH, - ACTIONS(85), 1, + ACTIONS(105), 1, aux_sym__char_token1, - ACTIONS(176), 1, + ACTIONS(144), 1, aux_sym_file_token1, - STATE(49), 1, + STATE(44), 1, sym_value, - STATE(26), 5, + STATE(23), 5, sym_substitution, sym_escape, sym__linebreak, sym__char, aux_sym_value_repeat1, - [512] = 7, - ACTIONS(182), 1, - anon_sym_DOT, - ACTIONS(185), 1, + [416] = 7, + ACTIONS(29), 1, anon_sym_LBRACK, - ACTIONS(188), 1, + ACTIONS(35), 1, aux_sym_escape_token1, - ACTIONS(191), 1, + ACTIONS(37), 1, aux_sym_escape_token2, - ACTIONS(194), 1, + ACTIONS(150), 1, + anon_sym_DOT, + ACTIONS(152), 1, aux_sym__char_token1, - ACTIONS(87), 3, + ACTIONS(107), 3, anon_sym_COLON, anon_sym_DOLLAR_LBRACE, anon_sym_RBRACE, - STATE(23), 4, - sym_index, + STATE(21), 4, + sym__index, sym_escape, sym__char, aux_sym_key_repeat1, - [539] = 7, - ACTIONS(25), 1, + [443] = 7, + ACTIONS(154), 1, + anon_sym_DOT, + ACTIONS(157), 1, anon_sym_LBRACK, - ACTIONS(31), 1, + ACTIONS(160), 1, aux_sym_escape_token1, - ACTIONS(33), 1, + ACTIONS(163), 1, aux_sym_escape_token2, - ACTIONS(197), 1, - anon_sym_DOT, - ACTIONS(199), 1, + ACTIONS(166), 1, aux_sym__char_token1, - ACTIONS(112), 3, + ACTIONS(115), 3, anon_sym_COLON, anon_sym_DOLLAR_LBRACE, anon_sym_RBRACE, - STATE(23), 4, - sym_index, + STATE(21), 4, + sym__index, sym_escape, sym__char, aux_sym_key_repeat1, - [566] = 7, - ACTIONS(142), 1, - anon_sym_LBRACK, - ACTIONS(148), 1, + [470] = 7, + ACTIONS(169), 1, + aux_sym_file_token1, + ACTIONS(171), 1, + anon_sym_DOLLAR_LBRACE, + ACTIONS(174), 1, aux_sym_escape_token1, - ACTIONS(150), 1, + ACTIONS(177), 1, aux_sym_escape_token2, - ACTIONS(201), 1, - anon_sym_DOT, - ACTIONS(203), 1, + ACTIONS(180), 1, + anon_sym_BSLASH, + ACTIONS(183), 1, aux_sym__char_token1, - ACTIONS(112), 2, - anon_sym_DOLLAR_LBRACE, - anon_sym_RBRACE, - STATE(30), 4, - sym_index, + STATE(22), 5, + sym_substitution, sym_escape, + sym__linebreak, sym__char, - aux_sym_key_repeat1, - [592] = 7, - ACTIONS(75), 1, + aux_sym_value_repeat1, + [496] = 7, + ACTIONS(95), 1, anon_sym_DOLLAR_LBRACE, - ACTIONS(77), 1, + ACTIONS(97), 1, aux_sym_escape_token1, - ACTIONS(79), 1, + ACTIONS(99), 1, aux_sym_escape_token2, - ACTIONS(81), 1, + ACTIONS(101), 1, anon_sym_BSLASH, - ACTIONS(205), 1, + ACTIONS(186), 1, aux_sym_file_token1, - ACTIONS(207), 1, + ACTIONS(188), 1, aux_sym__char_token1, - STATE(29), 5, + STATE(22), 5, sym_substitution, sym_escape, sym__linebreak, sym__char, aux_sym_value_repeat1, - [618] = 2, - ACTIONS(211), 3, + [522] = 2, + ACTIONS(192), 3, aux_sym_escape_token1, anon_sym_BSLASH, aux_sym__char_token1, - ACTIONS(209), 8, + ACTIONS(190), 8, aux_sym_file_token1, anon_sym_EQ, anon_sym_COLON, @@ -1208,12 +1139,12 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_DOLLAR_LBRACE, aux_sym_escape_token2, sym__space, - [634] = 2, - ACTIONS(215), 3, + [538] = 2, + ACTIONS(196), 3, aux_sym_escape_token1, anon_sym_BSLASH, aux_sym__char_token1, - ACTIONS(213), 8, + ACTIONS(194), 8, aux_sym_file_token1, anon_sym_EQ, anon_sym_COLON, @@ -1222,49 +1153,27 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_DOLLAR_LBRACE, aux_sym_escape_token2, sym__space, - [650] = 7, - ACTIONS(217), 1, - aux_sym_file_token1, - ACTIONS(219), 1, + [554] = 6, + ACTIONS(198), 1, anon_sym_DOLLAR_LBRACE, - ACTIONS(222), 1, + ACTIONS(200), 1, + anon_sym_RBRACE, + ACTIONS(202), 1, aux_sym_escape_token1, - ACTIONS(225), 1, + ACTIONS(204), 1, aux_sym_escape_token2, - ACTIONS(228), 1, - anon_sym_BSLASH, - ACTIONS(231), 1, + ACTIONS(206), 1, aux_sym__char_token1, - STATE(29), 5, + STATE(29), 4, sym_substitution, sym_escape, - sym__linebreak, sym__char, - aux_sym_value_repeat1, - [676] = 7, - ACTIONS(234), 1, - anon_sym_DOT, - ACTIONS(237), 1, - anon_sym_LBRACK, - ACTIONS(240), 1, - aux_sym_escape_token1, - ACTIONS(243), 1, - aux_sym_escape_token2, - ACTIONS(246), 1, - aux_sym__char_token1, - ACTIONS(87), 2, - anon_sym_DOLLAR_LBRACE, - anon_sym_RBRACE, - STATE(30), 4, - sym_index, - sym_escape, - sym__char, - aux_sym_key_repeat1, - [702] = 2, - ACTIONS(251), 2, + aux_sym__default_repeat1, + [576] = 2, + ACTIONS(210), 2, aux_sym_escape_token1, aux_sym__char_token1, - ACTIONS(249), 7, + ACTIONS(208), 7, ts_builtin_sym_end, aux_sym_file_token1, anon_sym_DOT, @@ -1272,11 +1181,11 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_escape_token2, sym_comment, sym__space, - [716] = 2, - ACTIONS(253), 2, + [590] = 2, + ACTIONS(212), 2, aux_sym_escape_token1, aux_sym__char_token1, - ACTIONS(39), 7, + ACTIONS(45), 7, ts_builtin_sym_end, aux_sym_file_token1, anon_sym_DOT, @@ -1284,365 +1193,357 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_escape_token2, sym_comment, sym__space, - [730] = 2, - ACTIONS(257), 2, - aux_sym_escape_token1, - aux_sym__char_token1, - ACTIONS(255), 6, - anon_sym_COLON, - anon_sym_DOT, - anon_sym_LBRACK, + [604] = 6, + ACTIONS(214), 1, anon_sym_DOLLAR_LBRACE, + ACTIONS(217), 1, anon_sym_RBRACE, + ACTIONS(219), 1, + aux_sym_escape_token1, + ACTIONS(222), 1, aux_sym_escape_token2, - [743] = 2, - ACTIONS(211), 2, + ACTIONS(225), 1, + aux_sym__char_token1, + STATE(29), 4, + sym_substitution, + sym_escape, + sym__char, + aux_sym__default_repeat1, + [626] = 2, + ACTIONS(196), 2, aux_sym_escape_token1, aux_sym__char_token1, - ACTIONS(209), 6, + ACTIONS(194), 6, anon_sym_COLON, anon_sym_DOT, anon_sym_LBRACK, anon_sym_DOLLAR_LBRACE, anon_sym_RBRACE, aux_sym_escape_token2, - [756] = 2, - ACTIONS(215), 2, + [639] = 2, + ACTIONS(230), 2, aux_sym_escape_token1, aux_sym__char_token1, - ACTIONS(213), 6, + ACTIONS(228), 6, anon_sym_COLON, anon_sym_DOT, anon_sym_LBRACK, anon_sym_DOLLAR_LBRACE, anon_sym_RBRACE, aux_sym_escape_token2, - [769] = 2, - ACTIONS(261), 2, + [652] = 2, + ACTIONS(234), 2, aux_sym_escape_token1, aux_sym__char_token1, - ACTIONS(259), 6, + ACTIONS(232), 6, anon_sym_COLON, anon_sym_DOT, anon_sym_LBRACK, anon_sym_DOLLAR_LBRACE, anon_sym_RBRACE, aux_sym_escape_token2, - [782] = 2, - ACTIONS(211), 2, - aux_sym_escape_token1, - aux_sym__char_token1, - ACTIONS(209), 5, - anon_sym_DOT, - anon_sym_LBRACK, + [665] = 5, + ACTIONS(198), 1, anon_sym_DOLLAR_LBRACE, - anon_sym_RBRACE, - aux_sym_escape_token2, - [794] = 2, - ACTIONS(215), 2, + ACTIONS(202), 1, aux_sym_escape_token1, - aux_sym__char_token1, - ACTIONS(213), 5, - anon_sym_DOT, - anon_sym_LBRACK, - anon_sym_DOLLAR_LBRACE, - anon_sym_RBRACE, + ACTIONS(204), 1, aux_sym_escape_token2, - [806] = 2, - ACTIONS(257), 2, - aux_sym_escape_token1, + ACTIONS(236), 1, aux_sym__char_token1, - ACTIONS(255), 5, - anon_sym_DOT, - anon_sym_LBRACK, - anon_sym_DOLLAR_LBRACE, - anon_sym_RBRACE, - aux_sym_escape_token2, - [818] = 2, - ACTIONS(261), 2, + STATE(26), 4, + sym_substitution, + sym_escape, + sym__char, + aux_sym__default_repeat1, + [684] = 2, + ACTIONS(192), 2, aux_sym_escape_token1, aux_sym__char_token1, - ACTIONS(259), 5, + ACTIONS(190), 6, + anon_sym_COLON, anon_sym_DOT, anon_sym_LBRACK, anon_sym_DOLLAR_LBRACE, anon_sym_RBRACE, aux_sym_escape_token2, - [830] = 2, - ACTIONS(255), 3, + [697] = 2, + ACTIONS(194), 3, aux_sym_file_token1, anon_sym_DOLLAR_LBRACE, aux_sym_escape_token2, - ACTIONS(257), 3, + ACTIONS(196), 3, aux_sym_escape_token1, anon_sym_BSLASH, aux_sym__char_token1, - [841] = 2, - ACTIONS(259), 3, + [708] = 2, + ACTIONS(232), 3, aux_sym_file_token1, anon_sym_DOLLAR_LBRACE, aux_sym_escape_token2, - ACTIONS(261), 3, + ACTIONS(234), 3, aux_sym_escape_token1, anon_sym_BSLASH, aux_sym__char_token1, - [852] = 2, - ACTIONS(263), 3, + [719] = 2, + ACTIONS(238), 3, aux_sym_file_token1, anon_sym_DOLLAR_LBRACE, aux_sym_escape_token2, - ACTIONS(265), 3, + ACTIONS(240), 3, aux_sym_escape_token1, anon_sym_BSLASH, aux_sym__char_token1, - [863] = 2, - ACTIONS(213), 3, + [730] = 2, + ACTIONS(228), 3, aux_sym_file_token1, anon_sym_DOLLAR_LBRACE, aux_sym_escape_token2, - ACTIONS(215), 3, + ACTIONS(230), 3, aux_sym_escape_token1, anon_sym_BSLASH, aux_sym__char_token1, - [874] = 1, - ACTIONS(176), 1, + [741] = 2, + ACTIONS(196), 2, + aux_sym_escape_token1, + aux_sym__char_token1, + ACTIONS(194), 3, + anon_sym_DOLLAR_LBRACE, + anon_sym_RBRACE, + aux_sym_escape_token2, + [751] = 2, + ACTIONS(230), 2, + aux_sym_escape_token1, + aux_sym__char_token1, + ACTIONS(228), 3, + anon_sym_DOLLAR_LBRACE, + anon_sym_RBRACE, + aux_sym_escape_token2, + [761] = 2, + ACTIONS(234), 2, + aux_sym_escape_token1, + aux_sym__char_token1, + ACTIONS(232), 3, + anon_sym_DOLLAR_LBRACE, + anon_sym_RBRACE, + aux_sym_escape_token2, + [771] = 1, + ACTIONS(242), 1, aux_sym_file_token1, - [878] = 1, - ACTIONS(71), 1, + [775] = 1, + ACTIONS(244), 1, aux_sym_file_token1, - [882] = 1, - ACTIONS(267), 1, + [779] = 1, + ACTIONS(148), 1, aux_sym_file_token1, - [886] = 1, - ACTIONS(269), 1, + [783] = 1, + ACTIONS(246), 1, anon_sym_RBRACE, - [890] = 1, - ACTIONS(180), 1, + [787] = 1, + ACTIONS(248), 1, aux_sym_file_token1, - [894] = 1, - ACTIONS(271), 1, + [791] = 1, + ACTIONS(134), 1, aux_sym_file_token1, - [898] = 1, - ACTIONS(273), 1, - aux_sym_index_token1, - [902] = 1, - ACTIONS(275), 1, - anon_sym_RBRACK, - [906] = 1, - ACTIONS(277), 1, + [795] = 1, + ACTIONS(144), 1, aux_sym_file_token1, - [910] = 1, - ACTIONS(279), 1, - anon_sym_RBRACE, - [914] = 1, - ACTIONS(281), 1, + [799] = 1, + ACTIONS(250), 1, anon_sym_RBRACK, - [918] = 1, - ACTIONS(283), 1, + [803] = 1, + ACTIONS(252), 1, anon_sym_RBRACK, - [922] = 1, - ACTIONS(285), 1, + [807] = 1, + ACTIONS(254), 1, anon_sym_RBRACE, - [926] = 1, - ACTIONS(287), 1, - aux_sym_index_token1, - [930] = 1, - ACTIONS(289), 1, + [811] = 1, + ACTIONS(256), 1, ts_builtin_sym_end, - [934] = 1, - ACTIONS(291), 1, - aux_sym_index_token1, - [938] = 1, - ACTIONS(172), 1, + [815] = 1, + ACTIONS(258), 1, + anon_sym_RBRACE, + [819] = 1, + ACTIONS(260), 1, + aux_sym__index_token1, + [823] = 1, + ACTIONS(140), 1, aux_sym_file_token1, + [827] = 1, + ACTIONS(262), 1, + aux_sym__index_token1, }; static const uint32_t ts_small_parse_table_map[] = { [SMALL_STATE(7)] = 0, - [SMALL_STATE(8)] = 36, - [SMALL_STATE(9)] = 68, - [SMALL_STATE(10)] = 104, - [SMALL_STATE(11)] = 136, + [SMALL_STATE(8)] = 34, + [SMALL_STATE(9)] = 70, + [SMALL_STATE(10)] = 102, + [SMALL_STATE(11)] = 134, [SMALL_STATE(12)] = 170, - [SMALL_STATE(13)] = 203, + [SMALL_STATE(13)] = 204, [SMALL_STATE(14)] = 236, [SMALL_STATE(15)] = 266, - [SMALL_STATE(16)] = 300, - [SMALL_STATE(17)] = 330, - [SMALL_STATE(18)] = 360, - [SMALL_STATE(19)] = 392, - [SMALL_STATE(20)] = 422, - [SMALL_STATE(21)] = 454, - [SMALL_STATE(22)] = 483, - [SMALL_STATE(23)] = 512, - [SMALL_STATE(24)] = 539, - [SMALL_STATE(25)] = 566, - [SMALL_STATE(26)] = 592, - [SMALL_STATE(27)] = 618, - [SMALL_STATE(28)] = 634, - [SMALL_STATE(29)] = 650, - [SMALL_STATE(30)] = 676, - [SMALL_STATE(31)] = 702, - [SMALL_STATE(32)] = 716, - [SMALL_STATE(33)] = 730, - [SMALL_STATE(34)] = 743, - [SMALL_STATE(35)] = 756, - [SMALL_STATE(36)] = 769, - [SMALL_STATE(37)] = 782, - [SMALL_STATE(38)] = 794, - [SMALL_STATE(39)] = 806, - [SMALL_STATE(40)] = 818, - [SMALL_STATE(41)] = 830, - [SMALL_STATE(42)] = 841, - [SMALL_STATE(43)] = 852, - [SMALL_STATE(44)] = 863, - [SMALL_STATE(45)] = 874, - [SMALL_STATE(46)] = 878, - [SMALL_STATE(47)] = 882, - [SMALL_STATE(48)] = 886, - [SMALL_STATE(49)] = 890, - [SMALL_STATE(50)] = 894, - [SMALL_STATE(51)] = 898, - [SMALL_STATE(52)] = 902, - [SMALL_STATE(53)] = 906, - [SMALL_STATE(54)] = 910, - [SMALL_STATE(55)] = 914, - [SMALL_STATE(56)] = 918, - [SMALL_STATE(57)] = 922, - [SMALL_STATE(58)] = 926, - [SMALL_STATE(59)] = 930, - [SMALL_STATE(60)] = 934, - [SMALL_STATE(61)] = 938, + [SMALL_STATE(16)] = 296, + [SMALL_STATE(17)] = 328, + [SMALL_STATE(18)] = 358, + [SMALL_STATE(19)] = 387, + [SMALL_STATE(20)] = 416, + [SMALL_STATE(21)] = 443, + [SMALL_STATE(22)] = 470, + [SMALL_STATE(23)] = 496, + [SMALL_STATE(24)] = 522, + [SMALL_STATE(25)] = 538, + [SMALL_STATE(26)] = 554, + [SMALL_STATE(27)] = 576, + [SMALL_STATE(28)] = 590, + [SMALL_STATE(29)] = 604, + [SMALL_STATE(30)] = 626, + [SMALL_STATE(31)] = 639, + [SMALL_STATE(32)] = 652, + [SMALL_STATE(33)] = 665, + [SMALL_STATE(34)] = 684, + [SMALL_STATE(35)] = 697, + [SMALL_STATE(36)] = 708, + [SMALL_STATE(37)] = 719, + [SMALL_STATE(38)] = 730, + [SMALL_STATE(39)] = 741, + [SMALL_STATE(40)] = 751, + [SMALL_STATE(41)] = 761, + [SMALL_STATE(42)] = 771, + [SMALL_STATE(43)] = 775, + [SMALL_STATE(44)] = 779, + [SMALL_STATE(45)] = 783, + [SMALL_STATE(46)] = 787, + [SMALL_STATE(47)] = 791, + [SMALL_STATE(48)] = 795, + [SMALL_STATE(49)] = 799, + [SMALL_STATE(50)] = 803, + [SMALL_STATE(51)] = 807, + [SMALL_STATE(52)] = 811, + [SMALL_STATE(53)] = 815, + [SMALL_STATE(54)] = 819, + [SMALL_STATE(55)] = 823, + [SMALL_STATE(56)] = 827, }; 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_file, 0), - [5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5), - [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), - [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(51), - [11] = {.entry = {.count = 1, .reusable = false}}, SHIFT(28), - [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(28), - [15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(61), - [17] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15), - [19] = {.entry = {.count = 1, .reusable = false}}, SHIFT(10), - [21] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19), - [23] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24), - [25] = {.entry = {.count = 1, .reusable = true}}, SHIFT(58), - [27] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17), - [29] = {.entry = {.count = 1, .reusable = true}}, SHIFT(36), - [31] = {.entry = {.count = 1, .reusable = false}}, SHIFT(35), - [33] = {.entry = {.count = 1, .reusable = true}}, SHIFT(35), - [35] = {.entry = {.count = 1, .reusable = false}}, SHIFT(24), - [37] = {.entry = {.count = 1, .reusable = true}}, SHIFT(42), - [39] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_file_repeat1, 2), - [41] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_file_repeat1, 2), SHIFT_REPEAT(4), - [44] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_file_repeat1, 2), SHIFT_REPEAT(10), - [47] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_file_repeat1, 2), SHIFT_REPEAT(51), - [50] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_file_repeat1, 2), SHIFT_REPEAT(28), - [53] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_file_repeat1, 2), SHIFT_REPEAT(28), - [56] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_file_repeat1, 2), SHIFT_REPEAT(61), - [59] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_file_repeat1, 2), SHIFT_REPEAT(15), - [62] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_file_repeat1, 2), SHIFT_REPEAT(10), - [65] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_file, 1), - [67] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), - [69] = {.entry = {.count = 1, .reusable = true}}, SHIFT(40), - [71] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_property, 2), - [73] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), - [75] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), - [77] = {.entry = {.count = 1, .reusable = false}}, SHIFT(44), - [79] = {.entry = {.count = 1, .reusable = true}}, SHIFT(44), - [81] = {.entry = {.count = 1, .reusable = false}}, SHIFT(47), - [83] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22), - [85] = {.entry = {.count = 1, .reusable = false}}, SHIFT(26), - [87] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_key_repeat1, 2), - [89] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_key_repeat1, 2), SHIFT_REPEAT(8), - [92] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_key_repeat1, 2), SHIFT_REPEAT(51), - [95] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_key_repeat1, 2), SHIFT_REPEAT(28), - [98] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_key_repeat1, 2), SHIFT_REPEAT(28), - [101] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_key_repeat1, 2), - [103] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_key_repeat1, 2), SHIFT_REPEAT(8), - [106] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_property, 1), - [108] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20), - [110] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7), - [112] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_key, 1), - [114] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8), - [116] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_key, 1), - [118] = {.entry = {.count = 1, .reusable = false}}, SHIFT(8), - [120] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym__content, 2), - [122] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym__content, 2), SHIFT_REPEAT(24), - [125] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym__content, 2), SHIFT_REPEAT(58), - [128] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym__content, 2), SHIFT_REPEAT(17), - [131] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym__content, 2), SHIFT_REPEAT(35), - [134] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym__content, 2), SHIFT_REPEAT(35), - [137] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym__content, 2), SHIFT_REPEAT(24), - [140] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25), - [142] = {.entry = {.count = 1, .reusable = true}}, SHIFT(60), - [144] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), - [146] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__default, 2, .production_id = 1), - [148] = {.entry = {.count = 1, .reusable = false}}, SHIFT(38), - [150] = {.entry = {.count = 1, .reusable = true}}, SHIFT(38), - [152] = {.entry = {.count = 1, .reusable = false}}, SHIFT(25), - [154] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym__content, 2), SHIFT_REPEAT(25), - [157] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym__content, 2), SHIFT_REPEAT(60), - [160] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym__content, 2), SHIFT_REPEAT(16), - [163] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym__content, 2), SHIFT_REPEAT(38), - [166] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym__content, 2), SHIFT_REPEAT(38), - [169] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym__content, 2), SHIFT_REPEAT(25), - [172] = {.entry = {.count = 1, .reusable = true}}, SHIFT(32), - [174] = {.entry = {.count = 1, .reusable = true}}, SHIFT(53), - [176] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_property, 3), - [178] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21), - [180] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_property, 4), - [182] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_key_repeat1, 2), SHIFT_REPEAT(23), - [185] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_key_repeat1, 2), SHIFT_REPEAT(58), - [188] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_key_repeat1, 2), SHIFT_REPEAT(35), - [191] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_key_repeat1, 2), SHIFT_REPEAT(35), - [194] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_key_repeat1, 2), SHIFT_REPEAT(23), - [197] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23), - [199] = {.entry = {.count = 1, .reusable = false}}, SHIFT(23), - [201] = {.entry = {.count = 1, .reusable = true}}, SHIFT(30), - [203] = {.entry = {.count = 1, .reusable = false}}, SHIFT(30), - [205] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_value, 1), - [207] = {.entry = {.count = 1, .reusable = false}}, SHIFT(29), - [209] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_index, 3), - [211] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_index, 3), - [213] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_escape, 1), - [215] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_escape, 1), - [217] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_value_repeat1, 2), - [219] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_value_repeat1, 2), SHIFT_REPEAT(14), - [222] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_value_repeat1, 2), SHIFT_REPEAT(44), - [225] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_value_repeat1, 2), SHIFT_REPEAT(44), - [228] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_value_repeat1, 2), SHIFT_REPEAT(47), - [231] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_value_repeat1, 2), SHIFT_REPEAT(29), - [234] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_key_repeat1, 2), SHIFT_REPEAT(30), - [237] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_key_repeat1, 2), SHIFT_REPEAT(60), - [240] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_key_repeat1, 2), SHIFT_REPEAT(38), - [243] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_key_repeat1, 2), SHIFT_REPEAT(38), - [246] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_key_repeat1, 2), SHIFT_REPEAT(30), - [249] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_file_repeat1, 3), - [251] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_file_repeat1, 3), - [253] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_file_repeat1, 2), - [255] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_substitution, 4, .production_id = 2), - [257] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_substitution, 4, .production_id = 2), - [259] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_substitution, 3), - [261] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_substitution, 3), - [263] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__linebreak, 2), - [265] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__linebreak, 2), - [267] = {.entry = {.count = 1, .reusable = true}}, SHIFT(43), - [269] = {.entry = {.count = 1, .reusable = true}}, SHIFT(41), - [271] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_property, 5), - [273] = {.entry = {.count = 1, .reusable = true}}, SHIFT(56), - [275] = {.entry = {.count = 1, .reusable = true}}, SHIFT(34), - [277] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31), - [279] = {.entry = {.count = 1, .reusable = true}}, SHIFT(33), - [281] = {.entry = {.count = 1, .reusable = true}}, SHIFT(37), - [283] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27), - [285] = {.entry = {.count = 1, .reusable = true}}, SHIFT(39), - [287] = {.entry = {.count = 1, .reusable = true}}, SHIFT(52), - [289] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), - [291] = {.entry = {.count = 1, .reusable = true}}, SHIFT(55), + [5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2), + [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9), + [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(56), + [11] = {.entry = {.count = 1, .reusable = false}}, SHIFT(25), + [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25), + [15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(55), + [17] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12), + [19] = {.entry = {.count = 1, .reusable = false}}, SHIFT(9), + [21] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_file, 1), + [23] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), + [25] = {.entry = {.count = 1, .reusable = true}}, SHIFT(33), + [27] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20), + [29] = {.entry = {.count = 1, .reusable = true}}, SHIFT(54), + [31] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17), + [33] = {.entry = {.count = 1, .reusable = true}}, SHIFT(36), + [35] = {.entry = {.count = 1, .reusable = false}}, SHIFT(30), + [37] = {.entry = {.count = 1, .reusable = true}}, SHIFT(30), + [39] = {.entry = {.count = 1, .reusable = false}}, SHIFT(20), + [41] = {.entry = {.count = 1, .reusable = true}}, SHIFT(41), + [43] = {.entry = {.count = 1, .reusable = true}}, SHIFT(32), + [45] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_file_repeat1, 2), + [47] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_file_repeat1, 2), SHIFT_REPEAT(6), + [50] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_file_repeat1, 2), SHIFT_REPEAT(9), + [53] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_file_repeat1, 2), SHIFT_REPEAT(56), + [56] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_file_repeat1, 2), SHIFT_REPEAT(25), + [59] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_file_repeat1, 2), SHIFT_REPEAT(25), + [62] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_file_repeat1, 2), SHIFT_REPEAT(55), + [65] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_file_repeat1, 2), SHIFT_REPEAT(12), + [68] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_file_repeat1, 2), SHIFT_REPEAT(9), + [71] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_substitution_repeat1, 2), + [73] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_substitution_repeat1, 2), SHIFT_REPEAT(20), + [76] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_substitution_repeat1, 2), SHIFT_REPEAT(54), + [79] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_substitution_repeat1, 2), SHIFT_REPEAT(17), + [82] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_substitution_repeat1, 2), SHIFT_REPEAT(30), + [85] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_substitution_repeat1, 2), SHIFT_REPEAT(30), + [88] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_substitution_repeat1, 2), SHIFT_REPEAT(20), + [91] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_property, 1), + [93] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), + [95] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), + [97] = {.entry = {.count = 1, .reusable = false}}, SHIFT(35), + [99] = {.entry = {.count = 1, .reusable = true}}, SHIFT(35), + [101] = {.entry = {.count = 1, .reusable = false}}, SHIFT(42), + [103] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), + [105] = {.entry = {.count = 1, .reusable = false}}, SHIFT(23), + [107] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_key, 1), + [109] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), + [111] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_key, 1), + [113] = {.entry = {.count = 1, .reusable = false}}, SHIFT(10), + [115] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_key_repeat1, 2), + [117] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_key_repeat1, 2), SHIFT_REPEAT(10), + [120] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_key_repeat1, 2), SHIFT_REPEAT(56), + [123] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_key_repeat1, 2), SHIFT_REPEAT(25), + [126] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_key_repeat1, 2), SHIFT_REPEAT(25), + [129] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_key_repeat1, 2), + [131] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_key_repeat1, 2), SHIFT_REPEAT(10), + [134] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_property, 2), + [136] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), + [138] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19), + [140] = {.entry = {.count = 1, .reusable = true}}, SHIFT(28), + [142] = {.entry = {.count = 1, .reusable = true}}, SHIFT(46), + [144] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_property, 3), + [146] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), + [148] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_property, 4), + [150] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21), + [152] = {.entry = {.count = 1, .reusable = false}}, SHIFT(21), + [154] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_key_repeat1, 2), SHIFT_REPEAT(21), + [157] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_key_repeat1, 2), SHIFT_REPEAT(54), + [160] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_key_repeat1, 2), SHIFT_REPEAT(30), + [163] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_key_repeat1, 2), SHIFT_REPEAT(30), + [166] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_key_repeat1, 2), SHIFT_REPEAT(21), + [169] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_value_repeat1, 2), + [171] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_value_repeat1, 2), SHIFT_REPEAT(14), + [174] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_value_repeat1, 2), SHIFT_REPEAT(35), + [177] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_value_repeat1, 2), SHIFT_REPEAT(35), + [180] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_value_repeat1, 2), SHIFT_REPEAT(42), + [183] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_value_repeat1, 2), SHIFT_REPEAT(22), + [186] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_value, 1), + [188] = {.entry = {.count = 1, .reusable = false}}, SHIFT(22), + [190] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__index, 3), + [192] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__index, 3), + [194] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_escape, 1), + [196] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_escape, 1), + [198] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15), + [200] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__default, 2, .production_id = 1), + [202] = {.entry = {.count = 1, .reusable = false}}, SHIFT(39), + [204] = {.entry = {.count = 1, .reusable = true}}, SHIFT(39), + [206] = {.entry = {.count = 1, .reusable = false}}, SHIFT(29), + [208] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_file_repeat1, 3), + [210] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_file_repeat1, 3), + [212] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_file_repeat1, 2), + [214] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym__default_repeat1, 2), SHIFT_REPEAT(15), + [217] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym__default_repeat1, 2), + [219] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym__default_repeat1, 2), SHIFT_REPEAT(39), + [222] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym__default_repeat1, 2), SHIFT_REPEAT(39), + [225] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym__default_repeat1, 2), SHIFT_REPEAT(29), + [228] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_substitution, 4, .production_id = 2), + [230] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_substitution, 4, .production_id = 2), + [232] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_substitution, 3), + [234] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_substitution, 3), + [236] = {.entry = {.count = 1, .reusable = false}}, SHIFT(26), + [238] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__linebreak, 2), + [240] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__linebreak, 2), + [242] = {.entry = {.count = 1, .reusable = true}}, SHIFT(37), + [244] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_property, 5), + [246] = {.entry = {.count = 1, .reusable = true}}, SHIFT(38), + [248] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27), + [250] = {.entry = {.count = 1, .reusable = true}}, SHIFT(34), + [252] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24), + [254] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31), + [256] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), + [258] = {.entry = {.count = 1, .reusable = true}}, SHIFT(40), + [260] = {.entry = {.count = 1, .reusable = true}}, SHIFT(49), + [262] = {.entry = {.count = 1, .reusable = true}}, SHIFT(50), }; #ifdef __cplusplus diff --git a/src/tree_sitter/parser.h b/src/tree_sitter/parser.h index 17b4fde..2b14ac1 100644 --- a/src/tree_sitter/parser.h +++ b/src/tree_sitter/parser.h @@ -13,8 +13,9 @@ extern "C" { #define ts_builtin_sym_end 0 #define TREE_SITTER_SERIALIZATION_BUFFER_SIZE 1024 -#ifndef TREE_SITTER_API_H_ typedef uint16_t TSStateId; + +#ifndef TREE_SITTER_API_H_ typedef uint16_t TSSymbol; typedef uint16_t TSFieldId; typedef struct TSLanguage TSLanguage; @@ -129,16 +130,9 @@ struct TSLanguage { * Lexer Macros */ -#ifdef _MSC_VER -#define UNUSED __pragma(warning(suppress : 4101)) -#else -#define UNUSED __attribute__((unused)) -#endif - #define START_LEXER() \ bool result = false; \ bool skip = false; \ - UNUSED \ bool eof = false; \ int32_t lookahead; \ goto start; \ @@ -172,7 +166,7 @@ struct TSLanguage { * Parse Table Macros */ -#define SMALL_STATE(id) ((id) - LARGE_STATE_COUNT) +#define SMALL_STATE(id) id - LARGE_STATE_COUNT #define STATE(id) id @@ -182,7 +176,7 @@ struct TSLanguage { {{ \ .shift = { \ .type = TSParseActionTypeShift, \ - .state = (state_value) \ + .state = state_value \ } \ }} @@ -190,7 +184,7 @@ struct TSLanguage { {{ \ .shift = { \ .type = TSParseActionTypeShift, \ - .state = (state_value), \ + .state = state_value, \ .repetition = true \ } \ }}