aboutsummaryrefslogtreecommitdiff
path: root/src/parser.c
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-11-09 23:32:39 +0100
committerThomas Voss <mail@thomasvoss.com> 2023-11-09 23:32:39 +0100
commitb168a6fb6d771e4efd99762767a32a80ef8fb6d7 (patch)
tree67986d3de922b18d5b208892bfdf3434987ea604 /src/parser.c
parent88fae5dda7d15936a5372cc738f5b70fb2a96550 (diff)
Modify the grammar a bit
Diffstat (limited to 'src/parser.c')
-rw-r--r--src/parser.c708
1 files changed, 349 insertions, 359 deletions
diff --git a/src/parser.c b/src/parser.c
index ceaf3b5..2567530 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -20,9 +20,9 @@ enum {
anon_sym_GT = 1,
anon_sym_LBRACE = 2,
anon_sym_RBRACE = 3,
- sym_node_name = 4,
- anon_sym_DASH = 5,
- anon_sym_EQ = 6,
+ anon_sym_DASH = 4,
+ anon_sym_EQ = 5,
+ sym_node_name = 6,
anon_sym_AT = 7,
sym_literal_text = 8,
sym_class_shorthand = 9,
@@ -33,11 +33,11 @@ enum {
sym_source_file = 14,
sym_node = 15,
sym_node_body = 16,
- sym_text_node = 17,
+ sym_text = 17,
sym_attribute_list = 18,
sym_attribute = 19,
aux_sym_source_file_repeat1 = 20,
- aux_sym_text_node_repeat1 = 21,
+ aux_sym_text_repeat1 = 21,
aux_sym_attribute_list_repeat1 = 22,
};
@@ -46,9 +46,9 @@ static const char * const ts_symbol_names[] = {
[anon_sym_GT] = ">",
[anon_sym_LBRACE] = "{",
[anon_sym_RBRACE] = "}",
- [sym_node_name] = "node_name",
[anon_sym_DASH] = "-",
[anon_sym_EQ] = "=",
+ [sym_node_name] = "node_name",
[anon_sym_AT] = "@",
[sym_literal_text] = "literal_text",
[sym_class_shorthand] = "class_shorthand",
@@ -59,11 +59,11 @@ static const char * const ts_symbol_names[] = {
[sym_source_file] = "source_file",
[sym_node] = "node",
[sym_node_body] = "node_body",
- [sym_text_node] = "text_node",
+ [sym_text] = "text",
[sym_attribute_list] = "attribute_list",
[sym_attribute] = "attribute",
[aux_sym_source_file_repeat1] = "source_file_repeat1",
- [aux_sym_text_node_repeat1] = "text_node_repeat1",
+ [aux_sym_text_repeat1] = "text_repeat1",
[aux_sym_attribute_list_repeat1] = "attribute_list_repeat1",
};
@@ -72,9 +72,9 @@ static const TSSymbol ts_symbol_map[] = {
[anon_sym_GT] = anon_sym_GT,
[anon_sym_LBRACE] = anon_sym_LBRACE,
[anon_sym_RBRACE] = anon_sym_RBRACE,
- [sym_node_name] = sym_node_name,
[anon_sym_DASH] = anon_sym_DASH,
[anon_sym_EQ] = anon_sym_EQ,
+ [sym_node_name] = sym_node_name,
[anon_sym_AT] = anon_sym_AT,
[sym_literal_text] = sym_literal_text,
[sym_class_shorthand] = sym_class_shorthand,
@@ -85,11 +85,11 @@ static const TSSymbol ts_symbol_map[] = {
[sym_source_file] = sym_source_file,
[sym_node] = sym_node,
[sym_node_body] = sym_node_body,
- [sym_text_node] = sym_text_node,
+ [sym_text] = sym_text,
[sym_attribute_list] = sym_attribute_list,
[sym_attribute] = sym_attribute,
[aux_sym_source_file_repeat1] = aux_sym_source_file_repeat1,
- [aux_sym_text_node_repeat1] = aux_sym_text_node_repeat1,
+ [aux_sym_text_repeat1] = aux_sym_text_repeat1,
[aux_sym_attribute_list_repeat1] = aux_sym_attribute_list_repeat1,
};
@@ -110,10 +110,6 @@ static const TSSymbolMetadata ts_symbol_metadata[] = {
.visible = true,
.named = false,
},
- [sym_node_name] = {
- .visible = true,
- .named = true,
- },
[anon_sym_DASH] = {
.visible = true,
.named = false,
@@ -122,6 +118,10 @@ static const TSSymbolMetadata ts_symbol_metadata[] = {
.visible = true,
.named = false,
},
+ [sym_node_name] = {
+ .visible = true,
+ .named = true,
+ },
[anon_sym_AT] = {
.visible = true,
.named = false,
@@ -162,7 +162,7 @@ static const TSSymbolMetadata ts_symbol_metadata[] = {
.visible = true,
.named = true,
},
- [sym_text_node] = {
+ [sym_text] = {
.visible = true,
.named = true,
},
@@ -178,7 +178,7 @@ static const TSSymbolMetadata ts_symbol_metadata[] = {
.visible = false,
.named = false,
},
- [aux_sym_text_node_repeat1] = {
+ [aux_sym_text_repeat1] = {
.visible = false,
.named = false,
},
@@ -203,8 +203,8 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = {
[3] = 3,
[4] = 4,
[5] = 3,
- [6] = 2,
- [7] = 4,
+ [6] = 4,
+ [7] = 2,
[8] = 8,
[9] = 9,
[10] = 9,
@@ -224,26 +224,26 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = {
[24] = 24,
[25] = 25,
[26] = 26,
- [27] = 18,
- [28] = 26,
- [29] = 24,
- [30] = 21,
- [31] = 31,
- [32] = 32,
+ [27] = 27,
+ [28] = 28,
+ [29] = 20,
+ [30] = 22,
+ [31] = 19,
+ [32] = 21,
[33] = 33,
[34] = 34,
[35] = 35,
[36] = 36,
[37] = 37,
[38] = 38,
- [39] = 39,
+ [39] = 38,
[40] = 36,
[41] = 41,
- [42] = 33,
- [43] = 39,
+ [42] = 34,
+ [43] = 43,
[44] = 44,
- [45] = 37,
- [46] = 34,
+ [45] = 43,
+ [46] = 41,
[47] = 35,
};
@@ -344,50 +344,55 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
eof = lexer->eof(lexer);
switch (state) {
case 0:
- if (eof) ADVANCE(7);
+ if (eof) ADVANCE(8);
if (lookahead == '"') ADVANCE(1);
- if (lookahead == '#') ADVANCE(3);
- if (lookahead == '-') ADVANCE(13);
- if (lookahead == '.') ADVANCE(4);
- if (lookahead == '=') ADVANCE(14);
- if (lookahead == '>') ADVANCE(8);
- if (lookahead == '@') ADVANCE(15);
- if (lookahead == '{') ADVANCE(9);
- if (lookahead == '}') ADVANCE(10);
- if (lookahead == 5760) ADVANCE(11);
+ if (lookahead == '#') ADVANCE(4);
+ if (lookahead == '-') ADVANCE(12);
+ if (lookahead == '.') ADVANCE(5);
+ if (lookahead == '=') ADVANCE(13);
+ if (lookahead == '>') ADVANCE(9);
+ if (lookahead == '@') ADVANCE(16);
+ if (lookahead == '{') ADVANCE(10);
+ if (lookahead == '}') ADVANCE(11);
+ if (lookahead == 5760) ADVANCE(14);
if (sym__S_character_set_1(lookahead)) ADVANCE(23);
- if (sym_node_name_character_set_1(lookahead)) ADVANCE(12);
+ if (sym_node_name_character_set_1(lookahead)) ADVANCE(15);
END_STATE();
case 1:
if (lookahead == '"') ADVANCE(22);
- if (lookahead == '\\') ADVANCE(5);
+ if (lookahead == '\\') ADVANCE(6);
if (lookahead != 0) ADVANCE(1);
END_STATE();
case 2:
- if (lookahead == '@') ADVANCE(15);
- if (lookahead == '\\') ADVANCE(18);
- if (lookahead == '}') ADVANCE(10);
- if (sym_literal_text_character_set_1(lookahead)) ADVANCE(16);
- if (lookahead != 0) ADVANCE(17);
+ if (lookahead == '@') ADVANCE(16);
+ if (lookahead == '\\') ADVANCE(3);
+ if (lookahead == '}') ADVANCE(11);
+ if (sym_literal_text_character_set_1(lookahead)) ADVANCE(17);
+ if (lookahead != 0) ADVANCE(18);
END_STATE();
case 3:
- if (!sym_id_shorthand_character_set_1(lookahead)) ADVANCE(20);
+ if (lookahead == '@' ||
+ lookahead == '\\' ||
+ lookahead == '}') ADVANCE(18);
END_STATE();
case 4:
- if (!sym_id_shorthand_character_set_1(lookahead)) ADVANCE(19);
+ if (!sym_id_shorthand_character_set_1(lookahead)) ADVANCE(20);
END_STATE();
case 5:
+ if (!sym_id_shorthand_character_set_1(lookahead)) ADVANCE(19);
+ END_STATE();
+ case 6:
if (lookahead != 0 &&
lookahead != '\n') ADVANCE(1);
END_STATE();
- case 6:
- if (eof) ADVANCE(7);
+ case 7:
+ if (eof) ADVANCE(8);
if (lookahead == '"') ADVANCE(1);
- if (lookahead == '#') ADVANCE(3);
- if (lookahead == '.') ADVANCE(4);
- if (lookahead == '=') ADVANCE(14);
- if (lookahead == '{') ADVANCE(9);
- if (lookahead == '}') ADVANCE(10);
+ if (lookahead == '#') ADVANCE(4);
+ if (lookahead == '.') ADVANCE(5);
+ if (lookahead == '=') ADVANCE(13);
+ if (lookahead == '{') ADVANCE(10);
+ if (lookahead == '}') ADVANCE(11);
if (sym_literal_text_character_set_1(lookahead)) ADVANCE(23);
if (lookahead == '-' ||
('0' <= lookahead && lookahead <= '9') ||
@@ -395,56 +400,51 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
lookahead == '_' ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(21);
END_STATE();
- case 7:
- ACCEPT_TOKEN(ts_builtin_sym_end);
- END_STATE();
case 8:
- ACCEPT_TOKEN(anon_sym_GT);
+ ACCEPT_TOKEN(ts_builtin_sym_end);
END_STATE();
case 9:
- ACCEPT_TOKEN(anon_sym_LBRACE);
+ ACCEPT_TOKEN(anon_sym_GT);
END_STATE();
case 10:
- ACCEPT_TOKEN(anon_sym_RBRACE);
+ ACCEPT_TOKEN(anon_sym_LBRACE);
END_STATE();
case 11:
- ACCEPT_TOKEN(sym_node_name);
- if (lookahead == 5760) ADVANCE(11);
- if (sym__S_character_set_1(lookahead)) ADVANCE(23);
- if (sym_node_name_character_set_2(lookahead)) ADVANCE(12);
+ ACCEPT_TOKEN(anon_sym_RBRACE);
END_STATE();
case 12:
- ACCEPT_TOKEN(sym_node_name);
- if (sym_node_name_character_set_2(lookahead)) ADVANCE(12);
+ ACCEPT_TOKEN(anon_sym_DASH);
END_STATE();
case 13:
- ACCEPT_TOKEN(anon_sym_DASH);
+ ACCEPT_TOKEN(anon_sym_EQ);
END_STATE();
case 14:
- ACCEPT_TOKEN(anon_sym_EQ);
+ ACCEPT_TOKEN(sym_node_name);
+ if (lookahead == 5760) ADVANCE(14);
+ if (sym__S_character_set_1(lookahead)) ADVANCE(23);
+ if (sym_node_name_character_set_2(lookahead)) ADVANCE(15);
END_STATE();
case 15:
- ACCEPT_TOKEN(anon_sym_AT);
+ ACCEPT_TOKEN(sym_node_name);
+ if (sym_node_name_character_set_2(lookahead)) ADVANCE(15);
END_STATE();
case 16:
- ACCEPT_TOKEN(sym_literal_text);
- if (lookahead == '\\') ADVANCE(18);
- if (sym_literal_text_character_set_1(lookahead)) ADVANCE(16);
- if (lookahead != 0 &&
- lookahead != '@' &&
- lookahead != '}') ADVANCE(17);
+ ACCEPT_TOKEN(anon_sym_AT);
END_STATE();
case 17:
ACCEPT_TOKEN(sym_literal_text);
- if (lookahead == '\\') ADVANCE(18);
+ if (lookahead == '\\') ADVANCE(3);
+ if (sym_literal_text_character_set_1(lookahead)) ADVANCE(17);
if (lookahead != 0 &&
lookahead != '@' &&
- lookahead != '}') ADVANCE(17);
+ lookahead != '}') ADVANCE(18);
END_STATE();
case 18:
ACCEPT_TOKEN(sym_literal_text);
- if (lookahead == '\\') ADVANCE(18);
- if (lookahead != 0) ADVANCE(17);
+ if (lookahead == '\\') ADVANCE(3);
+ if (lookahead != 0 &&
+ lookahead != '@' &&
+ lookahead != '}') ADVANCE(18);
END_STATE();
case 19:
ACCEPT_TOKEN(sym_class_shorthand);
@@ -483,45 +483,45 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = {
[5] = {.lex_state = 0},
[6] = {.lex_state = 0},
[7] = {.lex_state = 0},
- [8] = {.lex_state = 6},
- [9] = {.lex_state = 6},
- [10] = {.lex_state = 6},
- [11] = {.lex_state = 6},
+ [8] = {.lex_state = 7},
+ [9] = {.lex_state = 7},
+ [10] = {.lex_state = 7},
+ [11] = {.lex_state = 7},
[12] = {.lex_state = 0},
- [13] = {.lex_state = 6},
- [14] = {.lex_state = 6},
- [15] = {.lex_state = 0},
- [16] = {.lex_state = 6},
+ [13] = {.lex_state = 7},
+ [14] = {.lex_state = 7},
+ [15] = {.lex_state = 2},
+ [16] = {.lex_state = 0},
[17] = {.lex_state = 0},
- [18] = {.lex_state = 0},
- [19] = {.lex_state = 2},
- [20] = {.lex_state = 6},
+ [18] = {.lex_state = 7},
+ [19] = {.lex_state = 0},
+ [20] = {.lex_state = 0},
[21] = {.lex_state = 0},
- [22] = {.lex_state = 2},
- [23] = {.lex_state = 6},
- [24] = {.lex_state = 0},
+ [22] = {.lex_state = 0},
+ [23] = {.lex_state = 2},
+ [24] = {.lex_state = 7},
[25] = {.lex_state = 2},
- [26] = {.lex_state = 0},
- [27] = {.lex_state = 2},
+ [26] = {.lex_state = 7},
+ [27] = {.lex_state = 0},
[28] = {.lex_state = 2},
[29] = {.lex_state = 2},
[30] = {.lex_state = 2},
- [31] = {.lex_state = 0},
+ [31] = {.lex_state = 2},
[32] = {.lex_state = 2},
- [33] = {.lex_state = 6},
- [34] = {.lex_state = 6},
+ [33] = {.lex_state = 7},
+ [34] = {.lex_state = 7},
[35] = {.lex_state = 0},
- [36] = {.lex_state = 6},
- [37] = {.lex_state = 6},
- [38] = {.lex_state = 6},
- [39] = {.lex_state = 6},
- [40] = {.lex_state = 6},
- [41] = {.lex_state = 6},
- [42] = {.lex_state = 6},
- [43] = {.lex_state = 6},
- [44] = {.lex_state = 6},
- [45] = {.lex_state = 6},
- [46] = {.lex_state = 6},
+ [36] = {.lex_state = 7},
+ [37] = {.lex_state = 7},
+ [38] = {.lex_state = 7},
+ [39] = {.lex_state = 7},
+ [40] = {.lex_state = 7},
+ [41] = {.lex_state = 7},
+ [42] = {.lex_state = 7},
+ [43] = {.lex_state = 7},
+ [44] = {.lex_state = 7},
+ [45] = {.lex_state = 7},
+ [46] = {.lex_state = 7},
[47] = {.lex_state = 0},
};
@@ -531,9 +531,9 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = {
[anon_sym_GT] = ACTIONS(1),
[anon_sym_LBRACE] = ACTIONS(1),
[anon_sym_RBRACE] = ACTIONS(1),
- [sym_node_name] = ACTIONS(1),
[anon_sym_DASH] = ACTIONS(1),
[anon_sym_EQ] = ACTIONS(1),
+ [sym_node_name] = ACTIONS(1),
[anon_sym_AT] = ACTIONS(1),
[sym_class_shorthand] = ACTIONS(1),
[sym_id_shorthand] = ACTIONS(1),
@@ -542,8 +542,8 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = {
},
[1] = {
[sym_source_file] = STATE(44),
- [sym_node] = STATE(15),
- [aux_sym_source_file_repeat1] = STATE(15),
+ [sym_node] = STATE(16),
+ [aux_sym_source_file_repeat1] = STATE(16),
[ts_builtin_sym_end] = ACTIONS(5),
[anon_sym_GT] = ACTIONS(7),
[sym_node_name] = ACTIONS(9),
@@ -552,7 +552,7 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = {
};
static const uint16_t ts_small_parse_table[] = {
- [0] = 8,
+ [0] = 7,
ACTIONS(3), 1,
sym__S,
ACTIONS(7), 1,
@@ -561,9 +561,7 @@ static const uint16_t ts_small_parse_table[] = {
sym_node_name,
ACTIONS(11), 1,
anon_sym_RBRACE,
- STATE(41), 1,
- sym_text_node,
- STATE(42), 1,
+ STATE(40), 1,
sym_node_body,
ACTIONS(13), 2,
anon_sym_DASH,
@@ -571,7 +569,7 @@ static const uint16_t ts_small_parse_table[] = {
STATE(17), 2,
sym_node,
aux_sym_source_file_repeat1,
- [27] = 8,
+ [24] = 7,
ACTIONS(3), 1,
sym__S,
ACTIONS(7), 1,
@@ -580,9 +578,7 @@ static const uint16_t ts_small_parse_table[] = {
sym_node_name,
ACTIONS(15), 1,
anon_sym_RBRACE,
- STATE(41), 1,
- sym_text_node,
- STATE(43), 1,
+ STATE(38), 1,
sym_node_body,
ACTIONS(13), 2,
anon_sym_DASH,
@@ -590,7 +586,7 @@ static const uint16_t ts_small_parse_table[] = {
STATE(17), 2,
sym_node,
aux_sym_source_file_repeat1,
- [54] = 8,
+ [48] = 7,
ACTIONS(3), 1,
sym__S,
ACTIONS(7), 1,
@@ -599,17 +595,15 @@ static const uint16_t ts_small_parse_table[] = {
sym_node_name,
ACTIONS(17), 1,
anon_sym_RBRACE,
- STATE(40), 1,
+ STATE(34), 1,
sym_node_body,
- STATE(41), 1,
- sym_text_node,
ACTIONS(13), 2,
anon_sym_DASH,
anon_sym_EQ,
STATE(17), 2,
sym_node,
aux_sym_source_file_repeat1,
- [81] = 8,
+ [72] = 7,
ACTIONS(3), 1,
sym__S,
ACTIONS(7), 1,
@@ -620,15 +614,13 @@ static const uint16_t ts_small_parse_table[] = {
anon_sym_RBRACE,
STATE(39), 1,
sym_node_body,
- STATE(41), 1,
- sym_text_node,
ACTIONS(13), 2,
anon_sym_DASH,
anon_sym_EQ,
STATE(17), 2,
sym_node,
aux_sym_source_file_repeat1,
- [108] = 8,
+ [96] = 7,
ACTIONS(3), 1,
sym__S,
ACTIONS(7), 1,
@@ -637,17 +629,15 @@ static const uint16_t ts_small_parse_table[] = {
sym_node_name,
ACTIONS(21), 1,
anon_sym_RBRACE,
- STATE(33), 1,
+ STATE(42), 1,
sym_node_body,
- STATE(41), 1,
- sym_text_node,
ACTIONS(13), 2,
anon_sym_DASH,
anon_sym_EQ,
STATE(17), 2,
sym_node,
aux_sym_source_file_repeat1,
- [135] = 8,
+ [120] = 7,
ACTIONS(3), 1,
sym__S,
ACTIONS(7), 1,
@@ -658,15 +648,13 @@ static const uint16_t ts_small_parse_table[] = {
anon_sym_RBRACE,
STATE(36), 1,
sym_node_body,
- STATE(41), 1,
- sym_text_node,
ACTIONS(13), 2,
anon_sym_DASH,
anon_sym_EQ,
STATE(17), 2,
sym_node,
aux_sym_source_file_repeat1,
- [162] = 6,
+ [144] = 6,
ACTIONS(25), 1,
anon_sym_LBRACE,
ACTIONS(29), 1,
@@ -678,25 +666,25 @@ static const uint16_t ts_small_parse_table[] = {
ACTIONS(27), 2,
sym_class_shorthand,
sym_id_shorthand,
- STATE(14), 2,
+ STATE(13), 2,
sym_attribute,
aux_sym_attribute_list_repeat1,
- [183] = 6,
+ [165] = 6,
ACTIONS(29), 1,
sym_attribute_name,
ACTIONS(31), 1,
sym__S,
ACTIONS(33), 1,
anon_sym_LBRACE,
- STATE(37), 1,
+ STATE(43), 1,
sym_attribute_list,
ACTIONS(27), 2,
sym_class_shorthand,
sym_id_shorthand,
- STATE(14), 2,
+ STATE(13), 2,
sym_attribute,
aux_sym_attribute_list_repeat1,
- [204] = 6,
+ [186] = 6,
ACTIONS(29), 1,
sym_attribute_name,
ACTIONS(31), 1,
@@ -708,25 +696,25 @@ static const uint16_t ts_small_parse_table[] = {
ACTIONS(27), 2,
sym_class_shorthand,
sym_id_shorthand,
- STATE(14), 2,
+ STATE(13), 2,
sym_attribute,
aux_sym_attribute_list_repeat1,
- [225] = 6,
+ [207] = 6,
ACTIONS(29), 1,
sym_attribute_name,
ACTIONS(31), 1,
sym__S,
ACTIONS(37), 1,
anon_sym_LBRACE,
- STATE(34), 1,
+ STATE(41), 1,
sym_attribute_list,
ACTIONS(27), 2,
sym_class_shorthand,
sym_id_shorthand,
- STATE(14), 2,
+ STATE(13), 2,
sym_attribute,
aux_sym_attribute_list_repeat1,
- [246] = 5,
+ [228] = 5,
ACTIONS(3), 1,
sym__S,
ACTIONS(41), 1,
@@ -739,266 +727,268 @@ static const uint16_t ts_small_parse_table[] = {
STATE(12), 2,
sym_node,
aux_sym_source_file_repeat1,
- [264] = 5,
+ [246] = 5,
+ ACTIONS(29), 1,
+ sym_attribute_name,
ACTIONS(31), 1,
sym__S,
ACTIONS(47), 1,
anon_sym_LBRACE,
- ACTIONS(52), 1,
- sym_attribute_name,
- ACTIONS(49), 2,
+ ACTIONS(27), 2,
sym_class_shorthand,
sym_id_shorthand,
- STATE(13), 2,
+ STATE(14), 2,
sym_attribute,
aux_sym_attribute_list_repeat1,
- [282] = 5,
- ACTIONS(29), 1,
- sym_attribute_name,
+ [264] = 5,
ACTIONS(31), 1,
sym__S,
- ACTIONS(55), 1,
+ ACTIONS(49), 1,
anon_sym_LBRACE,
- ACTIONS(27), 2,
+ ACTIONS(54), 1,
+ sym_attribute_name,
+ ACTIONS(51), 2,
sym_class_shorthand,
sym_id_shorthand,
- STATE(13), 2,
+ STATE(14), 2,
sym_attribute,
aux_sym_attribute_list_repeat1,
- [300] = 5,
+ [282] = 6,
+ ACTIONS(3), 1,
+ sym__S,
+ ACTIONS(57), 1,
+ anon_sym_RBRACE,
+ ACTIONS(59), 1,
+ anon_sym_AT,
+ ACTIONS(61), 1,
+ sym_literal_text,
+ STATE(25), 1,
+ aux_sym_text_repeat1,
+ STATE(33), 1,
+ sym_text,
+ [301] = 5,
ACTIONS(3), 1,
sym__S,
ACTIONS(7), 1,
anon_sym_GT,
ACTIONS(9), 1,
sym_node_name,
- ACTIONS(57), 1,
+ ACTIONS(63), 1,
ts_builtin_sym_end,
STATE(12), 2,
sym_node,
aux_sym_source_file_repeat1,
- [317] = 3,
+ [318] = 5,
+ ACTIONS(3), 1,
+ sym__S,
+ ACTIONS(7), 1,
+ anon_sym_GT,
+ ACTIONS(9), 1,
+ sym_node_name,
+ ACTIONS(57), 1,
+ anon_sym_RBRACE,
+ STATE(12), 2,
+ sym_node,
+ aux_sym_source_file_repeat1,
+ [335] = 3,
ACTIONS(31), 1,
sym__S,
- ACTIONS(61), 1,
+ ACTIONS(67), 1,
anon_sym_EQ,
- ACTIONS(59), 4,
+ ACTIONS(65), 4,
anon_sym_LBRACE,
sym_class_shorthand,
sym_id_shorthand,
sym_attribute_name,
- [330] = 5,
+ [348] = 3,
ACTIONS(3), 1,
sym__S,
- ACTIONS(7), 1,
+ ACTIONS(71), 1,
+ sym_node_name,
+ ACTIONS(69), 3,
+ ts_builtin_sym_end,
anon_sym_GT,
- ACTIONS(9), 1,
+ anon_sym_RBRACE,
+ [360] = 3,
+ ACTIONS(3), 1,
+ sym__S,
+ ACTIONS(75), 1,
sym_node_name,
- ACTIONS(63), 1,
+ ACTIONS(73), 3,
+ ts_builtin_sym_end,
+ anon_sym_GT,
anon_sym_RBRACE,
- STATE(12), 2,
- sym_node,
- aux_sym_source_file_repeat1,
- [347] = 3,
+ [372] = 3,
ACTIONS(3), 1,
sym__S,
- ACTIONS(67), 1,
+ ACTIONS(79), 1,
sym_node_name,
- ACTIONS(65), 3,
+ ACTIONS(77), 3,
ts_builtin_sym_end,
anon_sym_GT,
anon_sym_RBRACE,
- [359] = 5,
+ [384] = 3,
ACTIONS(3), 1,
sym__S,
- ACTIONS(69), 1,
+ ACTIONS(83), 1,
+ sym_node_name,
+ ACTIONS(81), 3,
+ ts_builtin_sym_end,
+ anon_sym_GT,
anon_sym_RBRACE,
- ACTIONS(71), 1,
+ [396] = 5,
+ ACTIONS(3), 1,
+ sym__S,
+ ACTIONS(85), 1,
+ anon_sym_RBRACE,
+ ACTIONS(87), 1,
anon_sym_AT,
- ACTIONS(73), 1,
+ ACTIONS(90), 1,
sym_literal_text,
- STATE(22), 1,
- aux_sym_text_node_repeat1,
- [375] = 2,
+ STATE(23), 1,
+ aux_sym_text_repeat1,
+ [412] = 2,
ACTIONS(31), 1,
sym__S,
- ACTIONS(59), 4,
+ ACTIONS(65), 4,
anon_sym_LBRACE,
sym_class_shorthand,
sym_id_shorthand,
sym_attribute_name,
- [385] = 3,
+ [422] = 5,
ACTIONS(3), 1,
sym__S,
- ACTIONS(77), 1,
- sym_node_name,
- ACTIONS(75), 3,
- ts_builtin_sym_end,
- anon_sym_GT,
- anon_sym_RBRACE,
- [397] = 5,
- ACTIONS(3), 1,
- sym__S,
- ACTIONS(71), 1,
+ ACTIONS(59), 1,
anon_sym_AT,
- ACTIONS(79), 1,
+ ACTIONS(93), 1,
anon_sym_RBRACE,
- ACTIONS(81), 1,
+ ACTIONS(95), 1,
sym_literal_text,
- STATE(25), 1,
- aux_sym_text_node_repeat1,
- [413] = 2,
+ STATE(23), 1,
+ aux_sym_text_repeat1,
+ [438] = 2,
ACTIONS(31), 1,
sym__S,
- ACTIONS(83), 4,
+ ACTIONS(97), 4,
anon_sym_LBRACE,
sym_class_shorthand,
sym_id_shorthand,
sym_attribute_name,
- [423] = 3,
+ [448] = 4,
ACTIONS(3), 1,
sym__S,
- ACTIONS(87), 1,
- sym_node_name,
- ACTIONS(85), 3,
- ts_builtin_sym_end,
+ ACTIONS(99), 1,
anon_sym_GT,
- anon_sym_RBRACE,
- [435] = 5,
+ ACTIONS(101), 1,
+ sym_node_name,
+ STATE(28), 1,
+ sym_node,
+ [461] = 2,
ACTIONS(3), 1,
sym__S,
- ACTIONS(89), 1,
+ ACTIONS(85), 3,
anon_sym_RBRACE,
- ACTIONS(91), 1,
anon_sym_AT,
- ACTIONS(94), 1,
sym_literal_text,
- STATE(25), 1,
- aux_sym_text_node_repeat1,
- [451] = 3,
+ [470] = 2,
ACTIONS(3), 1,
sym__S,
- ACTIONS(99), 1,
- sym_node_name,
- ACTIONS(97), 3,
- ts_builtin_sym_end,
- anon_sym_GT,
- anon_sym_RBRACE,
- [463] = 2,
- ACTIONS(3), 1,
- sym__S,
- ACTIONS(65), 3,
+ ACTIONS(73), 3,
anon_sym_RBRACE,
anon_sym_AT,
sym_literal_text,
- [472] = 2,
+ [479] = 2,
ACTIONS(3), 1,
sym__S,
- ACTIONS(97), 3,
+ ACTIONS(81), 3,
anon_sym_RBRACE,
anon_sym_AT,
sym_literal_text,
- [481] = 2,
+ [488] = 2,
ACTIONS(3), 1,
sym__S,
- ACTIONS(85), 3,
+ ACTIONS(69), 3,
anon_sym_RBRACE,
anon_sym_AT,
sym_literal_text,
- [490] = 2,
+ [497] = 2,
ACTIONS(3), 1,
sym__S,
- ACTIONS(75), 3,
+ ACTIONS(77), 3,
anon_sym_RBRACE,
anon_sym_AT,
sym_literal_text,
- [499] = 4,
- ACTIONS(3), 1,
+ [506] = 2,
+ ACTIONS(31), 1,
sym__S,
- ACTIONS(101), 1,
- anon_sym_GT,
ACTIONS(103), 1,
- sym_node_name,
- STATE(32), 1,
- sym_node,
- [512] = 2,
- ACTIONS(3), 1,
- sym__S,
- ACTIONS(89), 3,
anon_sym_RBRACE,
- anon_sym_AT,
- sym_literal_text,
- [521] = 2,
+ [513] = 2,
ACTIONS(31), 1,
sym__S,
ACTIONS(105), 1,
anon_sym_RBRACE,
- [528] = 2,
- ACTIONS(31), 1,
- sym__S,
- ACTIONS(107), 1,
- anon_sym_LBRACE,
- [535] = 2,
+ [520] = 2,
ACTIONS(3), 1,
sym__S,
- ACTIONS(109), 1,
+ ACTIONS(107), 1,
sym_node_name,
- [542] = 2,
- ACTIONS(21), 1,
+ [527] = 2,
+ ACTIONS(17), 1,
anon_sym_RBRACE,
ACTIONS(31), 1,
sym__S,
- [549] = 2,
+ [534] = 2,
ACTIONS(31), 1,
sym__S,
- ACTIONS(37), 1,
- anon_sym_LBRACE,
- [556] = 2,
- ACTIONS(31), 1,
- sym__S,
- ACTIONS(111), 1,
+ ACTIONS(109), 1,
sym_attribute_value,
- [563] = 2,
- ACTIONS(17), 1,
+ [541] = 2,
+ ACTIONS(23), 1,
anon_sym_RBRACE,
ACTIONS(31), 1,
sym__S,
- [570] = 2,
+ [548] = 2,
ACTIONS(11), 1,
anon_sym_RBRACE,
ACTIONS(31), 1,
sym__S,
- [577] = 2,
+ [555] = 2,
+ ACTIONS(21), 1,
+ anon_sym_RBRACE,
ACTIONS(31), 1,
sym__S,
- ACTIONS(63), 1,
- anon_sym_RBRACE,
- [584] = 2,
+ [562] = 2,
+ ACTIONS(31), 1,
+ sym__S,
+ ACTIONS(111), 1,
+ anon_sym_LBRACE,
+ [569] = 2,
ACTIONS(31), 1,
sym__S,
ACTIONS(113), 1,
anon_sym_RBRACE,
- [591] = 2,
- ACTIONS(23), 1,
- anon_sym_RBRACE,
+ [576] = 2,
ACTIONS(31), 1,
sym__S,
- [598] = 2,
+ ACTIONS(37), 1,
+ anon_sym_LBRACE,
+ [583] = 2,
ACTIONS(31), 1,
sym__S,
ACTIONS(115), 1,
ts_builtin_sym_end,
- [605] = 2,
+ [590] = 2,
ACTIONS(25), 1,
anon_sym_LBRACE,
ACTIONS(31), 1,
sym__S,
- [612] = 2,
+ [597] = 2,
ACTIONS(31), 1,
sym__S,
ACTIONS(117), 1,
anon_sym_LBRACE,
- [619] = 2,
+ [604] = 2,
ACTIONS(3), 1,
sym__S,
ACTIONS(119), 1,
@@ -1007,51 +997,51 @@ static const uint16_t ts_small_parse_table[] = {
static const uint32_t ts_small_parse_table_map[] = {
[SMALL_STATE(2)] = 0,
- [SMALL_STATE(3)] = 27,
- [SMALL_STATE(4)] = 54,
- [SMALL_STATE(5)] = 81,
- [SMALL_STATE(6)] = 108,
- [SMALL_STATE(7)] = 135,
- [SMALL_STATE(8)] = 162,
- [SMALL_STATE(9)] = 183,
- [SMALL_STATE(10)] = 204,
- [SMALL_STATE(11)] = 225,
- [SMALL_STATE(12)] = 246,
- [SMALL_STATE(13)] = 264,
- [SMALL_STATE(14)] = 282,
- [SMALL_STATE(15)] = 300,
- [SMALL_STATE(16)] = 317,
- [SMALL_STATE(17)] = 330,
- [SMALL_STATE(18)] = 347,
- [SMALL_STATE(19)] = 359,
- [SMALL_STATE(20)] = 375,
- [SMALL_STATE(21)] = 385,
- [SMALL_STATE(22)] = 397,
- [SMALL_STATE(23)] = 413,
- [SMALL_STATE(24)] = 423,
- [SMALL_STATE(25)] = 435,
- [SMALL_STATE(26)] = 451,
- [SMALL_STATE(27)] = 463,
- [SMALL_STATE(28)] = 472,
- [SMALL_STATE(29)] = 481,
- [SMALL_STATE(30)] = 490,
- [SMALL_STATE(31)] = 499,
- [SMALL_STATE(32)] = 512,
- [SMALL_STATE(33)] = 521,
- [SMALL_STATE(34)] = 528,
- [SMALL_STATE(35)] = 535,
- [SMALL_STATE(36)] = 542,
- [SMALL_STATE(37)] = 549,
- [SMALL_STATE(38)] = 556,
- [SMALL_STATE(39)] = 563,
- [SMALL_STATE(40)] = 570,
- [SMALL_STATE(41)] = 577,
- [SMALL_STATE(42)] = 584,
- [SMALL_STATE(43)] = 591,
- [SMALL_STATE(44)] = 598,
- [SMALL_STATE(45)] = 605,
- [SMALL_STATE(46)] = 612,
- [SMALL_STATE(47)] = 619,
+ [SMALL_STATE(3)] = 24,
+ [SMALL_STATE(4)] = 48,
+ [SMALL_STATE(5)] = 72,
+ [SMALL_STATE(6)] = 96,
+ [SMALL_STATE(7)] = 120,
+ [SMALL_STATE(8)] = 144,
+ [SMALL_STATE(9)] = 165,
+ [SMALL_STATE(10)] = 186,
+ [SMALL_STATE(11)] = 207,
+ [SMALL_STATE(12)] = 228,
+ [SMALL_STATE(13)] = 246,
+ [SMALL_STATE(14)] = 264,
+ [SMALL_STATE(15)] = 282,
+ [SMALL_STATE(16)] = 301,
+ [SMALL_STATE(17)] = 318,
+ [SMALL_STATE(18)] = 335,
+ [SMALL_STATE(19)] = 348,
+ [SMALL_STATE(20)] = 360,
+ [SMALL_STATE(21)] = 372,
+ [SMALL_STATE(22)] = 384,
+ [SMALL_STATE(23)] = 396,
+ [SMALL_STATE(24)] = 412,
+ [SMALL_STATE(25)] = 422,
+ [SMALL_STATE(26)] = 438,
+ [SMALL_STATE(27)] = 448,
+ [SMALL_STATE(28)] = 461,
+ [SMALL_STATE(29)] = 470,
+ [SMALL_STATE(30)] = 479,
+ [SMALL_STATE(31)] = 488,
+ [SMALL_STATE(32)] = 497,
+ [SMALL_STATE(33)] = 506,
+ [SMALL_STATE(34)] = 513,
+ [SMALL_STATE(35)] = 520,
+ [SMALL_STATE(36)] = 527,
+ [SMALL_STATE(37)] = 534,
+ [SMALL_STATE(38)] = 541,
+ [SMALL_STATE(39)] = 548,
+ [SMALL_STATE(40)] = 555,
+ [SMALL_STATE(41)] = 562,
+ [SMALL_STATE(42)] = 569,
+ [SMALL_STATE(43)] = 576,
+ [SMALL_STATE(44)] = 583,
+ [SMALL_STATE(45)] = 590,
+ [SMALL_STATE(46)] = 597,
+ [SMALL_STATE(47)] = 604,
};
static const TSParseActionEntry ts_parse_actions[] = {
@@ -1061,16 +1051,16 @@ static const TSParseActionEntry ts_parse_actions[] = {
[5] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 0),
[7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(35),
[9] = {.entry = {.count = 1, .reusable = false}}, SHIFT(9),
- [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(29),
- [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19),
- [15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18),
- [17] = {.entry = {.count = 1, .reusable = true}}, SHIFT(30),
- [19] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27),
- [21] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24),
- [23] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21),
- [25] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4),
- [27] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20),
- [29] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16),
+ [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(30),
+ [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15),
+ [15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20),
+ [17] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19),
+ [19] = {.entry = {.count = 1, .reusable = true}}, SHIFT(29),
+ [21] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31),
+ [23] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22),
+ [25] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2),
+ [27] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24),
+ [29] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18),
[31] = {.entry = {.count = 1, .reusable = true}}, SHIFT_EXTRA(),
[33] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3),
[35] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5),
@@ -1078,40 +1068,40 @@ static const TSParseActionEntry ts_parse_actions[] = {
[39] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2),
[41] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(35),
[44] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(9),
- [47] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_attribute_list_repeat1, 2),
- [49] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_attribute_list_repeat1, 2), SHIFT_REPEAT(20),
- [52] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_attribute_list_repeat1, 2), SHIFT_REPEAT(16),
- [55] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute_list, 1),
- [57] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1),
- [59] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute, 1),
- [61] = {.entry = {.count = 1, .reusable = true}}, SHIFT(38),
- [63] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_node_body, 1),
- [65] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_node, 3),
- [67] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_node, 3),
- [69] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_text_node, 1),
- [71] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31),
- [73] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22),
- [75] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_node, 4),
- [77] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_node, 4),
- [79] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_text_node, 2),
- [81] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25),
- [83] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute, 3),
- [85] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_node, 5),
- [87] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_node, 5),
- [89] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_text_node_repeat1, 2),
- [91] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_text_node_repeat1, 2), SHIFT_REPEAT(31),
- [94] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_text_node_repeat1, 2), SHIFT_REPEAT(25),
- [97] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_node, 6),
- [99] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_node, 6),
- [101] = {.entry = {.count = 1, .reusable = true}}, SHIFT(47),
- [103] = {.entry = {.count = 1, .reusable = false}}, SHIFT(10),
- [105] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26),
- [107] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6),
- [109] = {.entry = {.count = 1, .reusable = false}}, SHIFT(11),
- [111] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23),
- [113] = {.entry = {.count = 1, .reusable = true}}, SHIFT(28),
+ [47] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute_list, 1),
+ [49] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_attribute_list_repeat1, 2),
+ [51] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_attribute_list_repeat1, 2), SHIFT_REPEAT(24),
+ [54] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_attribute_list_repeat1, 2), SHIFT_REPEAT(18),
+ [57] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_node_body, 1),
+ [59] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27),
+ [61] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25),
+ [63] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1),
+ [65] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute, 1),
+ [67] = {.entry = {.count = 1, .reusable = true}}, SHIFT(37),
+ [69] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_node, 5),
+ [71] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_node, 5),
+ [73] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_node, 3),
+ [75] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_node, 3),
+ [77] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_node, 6),
+ [79] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_node, 6),
+ [81] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_node, 4),
+ [83] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_node, 4),
+ [85] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_text_repeat1, 2),
+ [87] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_text_repeat1, 2), SHIFT_REPEAT(27),
+ [90] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_text_repeat1, 2), SHIFT_REPEAT(23),
+ [93] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_text, 1),
+ [95] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23),
+ [97] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute, 3),
+ [99] = {.entry = {.count = 1, .reusable = true}}, SHIFT(47),
+ [101] = {.entry = {.count = 1, .reusable = false}}, SHIFT(10),
+ [103] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_node_body, 2),
+ [105] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21),
+ [107] = {.entry = {.count = 1, .reusable = false}}, SHIFT(11),
+ [109] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26),
+ [111] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4),
+ [113] = {.entry = {.count = 1, .reusable = true}}, SHIFT(32),
[115] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(),
- [117] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2),
+ [117] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6),
[119] = {.entry = {.count = 1, .reusable = false}}, SHIFT(8),
};