diff --git a/corpus/main.txt b/corpus/main.txt index 777b5ce..fc78cb5 100644 --- a/corpus/main.txt +++ b/corpus/main.txt @@ -148,12 +148,12 @@ Raw text elements --- (fragment - (raw_element + (script_element (start_tag (tag_name)) (raw_text) (end_tag (tag_name))) (text) - (raw_element + (style_element (start_tag (tag_name)) (raw_text) (end_tag (tag_name))) diff --git a/grammar.js b/grammar.js index da5b26b..d8daa91 100644 --- a/grammar.js +++ b/grammar.js @@ -8,7 +8,8 @@ module.exports = grammar({ externals: $ => [ $._start_tag_name, - $._start_raw_tag_name, + $._script_start_tag_name, + $._style_start_tag_name, $._end_tag_name, $.erroneous_end_tag_name, '/>', @@ -33,8 +34,9 @@ module.exports = grammar({ $.doctype, $.text, $.element, - $.erroneous_end_tag, - $.raw_element + $.script_element, + $.style_element, + $.erroneous_end_tag ), element: $ => choice( @@ -46,8 +48,14 @@ module.exports = grammar({ $.self_closing_tag ), - raw_element: $ => seq( - alias($._raw_start_tag, $.start_tag), + script_element: $ => seq( + alias($.script_start_tag, $.start_tag), + optional($.raw_text), + $.end_tag + ), + + style_element: $ => seq( + alias($.style_start_tag, $.start_tag), optional($.raw_text), $.end_tag ), @@ -59,9 +67,16 @@ module.exports = grammar({ '>' ), - _raw_start_tag: $ => seq( + script_start_tag: $ => seq( '<', - alias($._start_raw_tag_name, $.tag_name), + alias($._script_start_tag_name, $.tag_name), + repeat($.attribute), + '>' + ), + + style_start_tag: $ => seq( + '<', + alias($._style_start_tag_name, $.tag_name), repeat($.attribute), '>' ), diff --git a/properties/highlights.css b/properties/highlights.css index 13877ca..4760604 100644 --- a/properties/highlights.css +++ b/properties/highlights.css @@ -1,3 +1,5 @@ +@import "./injections.css"; + tag_name { scope: 'tag'; } diff --git a/properties/injections.css b/properties/injections.css new file mode 100644 index 0000000..36d8657 --- /dev/null +++ b/properties/injections.css @@ -0,0 +1,9 @@ +script_element { + injection-language: 'javascript'; + injection-content: child(this(), 1); +} + +style_element { + injection-language: 'css'; + injection-content: child(this(), 1); +} diff --git a/src/grammar.json b/src/grammar.json index cf4677e..a3517d0 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -55,11 +55,15 @@ }, { "type": "SYMBOL", - "name": "erroneous_end_tag" + "name": "script_element" }, { "type": "SYMBOL", - "name": "raw_element" + "name": "style_element" + }, + { + "type": "SYMBOL", + "name": "erroneous_end_tag" } ] }, @@ -101,14 +105,44 @@ } ] }, - "raw_element": { + "script_element": { "type": "SEQ", "members": [ { "type": "ALIAS", "content": { "type": "SYMBOL", - "name": "_raw_start_tag" + "name": "script_start_tag" + }, + "named": true, + "value": "start_tag" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "raw_text" + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "SYMBOL", + "name": "end_tag" + } + ] + }, + "style_element": { + "type": "SEQ", + "members": [ + { + "type": "ALIAS", + "content": { + "type": "SYMBOL", + "name": "style_start_tag" }, "named": true, "value": "start_tag" @@ -160,7 +194,7 @@ } ] }, - "_raw_start_tag": { + "script_start_tag": { "type": "SEQ", "members": [ { @@ -171,7 +205,36 @@ "type": "ALIAS", "content": { "type": "SYMBOL", - "name": "_start_raw_tag_name" + "name": "_script_start_tag_name" + }, + "named": true, + "value": "tag_name" + }, + { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "attribute" + } + }, + { + "type": "STRING", + "value": ">" + } + ] + }, + "style_start_tag": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "<" + }, + { + "type": "ALIAS", + "content": { + "type": "SYMBOL", + "name": "_style_start_tag_name" }, "named": true, "value": "tag_name" @@ -392,7 +455,11 @@ }, { "type": "SYMBOL", - "name": "_start_raw_tag_name" + "name": "_script_start_tag_name" + }, + { + "type": "SYMBOL", + "name": "_style_start_tag_name" }, { "type": "SYMBOL", diff --git a/src/highlights.json b/src/highlights.json index 45ad141..f100b0b 100644 --- a/src/highlights.json +++ b/src/highlights.json @@ -7,7 +7,7 @@ { "type": "attribute_name", "named": true, - "state_id": 4 + "state_id": 5 }, { "type": "attribute_value", @@ -22,17 +22,27 @@ { "type": "doctype", "named": true, - "state_id": 5 + "state_id": 3 }, { "type": "erroneous_end_tag_name", "named": true, - "state_id": 3 + "state_id": 4 + }, + { + "type": "script_element", + "named": true, + "state_id": 7 + }, + { + "type": "style_element", + "named": true, + "state_id": 6 }, { "type": "tag_name", "named": true, - "state_id": 3 + "state_id": 4 } ], "default_next_state_id": 0 @@ -44,7 +54,7 @@ { "type": "attribute_name", "named": true, - "state_id": 4 + "state_id": 5 }, { "type": "attribute_value", @@ -59,17 +69,27 @@ { "type": "doctype", "named": true, - "state_id": 5 + "state_id": 3 }, { "type": "erroneous_end_tag_name", "named": true, - "state_id": 3 + "state_id": 4 + }, + { + "type": "script_element", + "named": true, + "state_id": 7 + }, + { + "type": "style_element", + "named": true, + "state_id": 6 }, { "type": "tag_name", "named": true, - "state_id": 3 + "state_id": 4 } ], "default_next_state_id": 0 @@ -81,7 +101,7 @@ { "type": "attribute_name", "named": true, - "state_id": 4 + "state_id": 5 }, { "type": "attribute_value", @@ -96,17 +116,27 @@ { "type": "doctype", "named": true, - "state_id": 5 + "state_id": 3 }, { "type": "erroneous_end_tag_name", "named": true, - "state_id": 3 + "state_id": 4 + }, + { + "type": "script_element", + "named": true, + "state_id": 7 + }, + { + "type": "style_element", + "named": true, + "state_id": 6 }, { "type": "tag_name", "named": true, - "state_id": 3 + "state_id": 4 } ], "default_next_state_id": 0 @@ -118,7 +148,7 @@ { "type": "attribute_name", "named": true, - "state_id": 4 + "state_id": 5 }, { "type": "attribute_value", @@ -133,17 +163,27 @@ { "type": "doctype", "named": true, - "state_id": 5 + "state_id": 3 }, { "type": "erroneous_end_tag_name", "named": true, - "state_id": 3 + "state_id": 4 + }, + { + "type": "script_element", + "named": true, + "state_id": 7 + }, + { + "type": "style_element", + "named": true, + "state_id": 6 }, { "type": "tag_name", "named": true, - "state_id": 3 + "state_id": 4 } ], "default_next_state_id": 0 @@ -155,7 +195,7 @@ { "type": "attribute_name", "named": true, - "state_id": 4 + "state_id": 5 }, { "type": "attribute_value", @@ -170,17 +210,27 @@ { "type": "doctype", "named": true, - "state_id": 5 + "state_id": 3 }, { "type": "erroneous_end_tag_name", "named": true, - "state_id": 3 + "state_id": 4 + }, + { + "type": "script_element", + "named": true, + "state_id": 7 + }, + { + "type": "style_element", + "named": true, + "state_id": 6 }, { "type": "tag_name", "named": true, - "state_id": 3 + "state_id": 4 } ], "default_next_state_id": 0 @@ -192,7 +242,7 @@ { "type": "attribute_name", "named": true, - "state_id": 4 + "state_id": 5 }, { "type": "attribute_value", @@ -207,17 +257,121 @@ { "type": "doctype", "named": true, - "state_id": 5 + "state_id": 3 }, { "type": "erroneous_end_tag_name", "named": true, - "state_id": 3 + "state_id": 4 + }, + { + "type": "script_element", + "named": true, + "state_id": 7 + }, + { + "type": "style_element", + "named": true, + "state_id": 6 }, { "type": "tag_name", "named": true, + "state_id": 4 + } + ], + "default_next_state_id": 0 + }, + { + "id": 6, + "property_set_id": 6, + "transitions": [ + { + "type": "attribute_name", + "named": true, + "state_id": 5 + }, + { + "type": "attribute_value", + "named": true, + "state_id": 2 + }, + { + "type": "comment", + "named": true, + "state_id": 1 + }, + { + "type": "doctype", + "named": true, "state_id": 3 + }, + { + "type": "erroneous_end_tag_name", + "named": true, + "state_id": 4 + }, + { + "type": "script_element", + "named": true, + "state_id": 7 + }, + { + "type": "style_element", + "named": true, + "state_id": 6 + }, + { + "type": "tag_name", + "named": true, + "state_id": 4 + } + ], + "default_next_state_id": 0 + }, + { + "id": 7, + "property_set_id": 7, + "transitions": [ + { + "type": "attribute_name", + "named": true, + "state_id": 5 + }, + { + "type": "attribute_value", + "named": true, + "state_id": 2 + }, + { + "type": "comment", + "named": true, + "state_id": 1 + }, + { + "type": "doctype", + "named": true, + "state_id": 3 + }, + { + "type": "erroneous_end_tag_name", + "named": true, + "state_id": 4 + }, + { + "type": "script_element", + "named": true, + "state_id": 7 + }, + { + "type": "style_element", + "named": true, + "state_id": 6 + }, + { + "type": "tag_name", + "named": true, + "state_id": 4 } ], "default_next_state_id": 0 @@ -231,6 +385,9 @@ { "scope": "string" }, + { + "scope": "constant" + }, { "scope": "tag" }, @@ -238,7 +395,30 @@ "scope": "attribute" }, { - "scope": "constant" + "injection-content": { + "name": "child", + "args": [ + { + "name": "this", + "args": [] + }, + 1 + ] + }, + "injection-language": "css" + }, + { + "injection-content": { + "name": "child", + "args": [ + { + "name": "this", + "args": [] + }, + 1 + ] + }, + "injection-language": "javascript" } ] } \ No newline at end of file diff --git a/src/injections.json b/src/injections.json new file mode 100644 index 0000000..9b9a48c --- /dev/null +++ b/src/injections.json @@ -0,0 +1,84 @@ +{ + "states": [ + { + "id": 0, + "property_set_id": 0, + "transitions": [ + { + "type": "script_element", + "named": true, + "state_id": 2 + }, + { + "type": "style_element", + "named": true, + "state_id": 1 + } + ], + "default_next_state_id": 0 + }, + { + "id": 1, + "property_set_id": 1, + "transitions": [ + { + "type": "script_element", + "named": true, + "state_id": 2 + }, + { + "type": "style_element", + "named": true, + "state_id": 1 + } + ], + "default_next_state_id": 0 + }, + { + "id": 2, + "property_set_id": 2, + "transitions": [ + { + "type": "script_element", + "named": true, + "state_id": 2 + }, + { + "type": "style_element", + "named": true, + "state_id": 1 + } + ], + "default_next_state_id": 0 + } + ], + "property_sets": [ + {}, + { + "injection-content": { + "name": "child", + "args": [ + { + "name": "this", + "args": [] + }, + 1 + ] + }, + "injection-language": "css" + }, + { + "injection-content": { + "name": "child", + "args": [ + { + "name": "this", + "args": [] + }, + 1 + ] + }, + "injection-language": "javascript" + } + ] +} \ No newline at end of file diff --git a/src/parser.c b/src/parser.c index c650b49..e0b5761 100644 --- a/src/parser.c +++ b/src/parser.c @@ -6,55 +6,59 @@ #endif #define LANGUAGE_VERSION 9 -#define STATE_COUNT 82 -#define SYMBOL_COUNT 37 +#define STATE_COUNT 94 +#define SYMBOL_COUNT 40 #define ALIAS_COUNT 0 -#define TOKEN_COUNT 23 -#define EXTERNAL_TOKEN_COUNT 8 +#define TOKEN_COUNT 24 +#define EXTERNAL_TOKEN_COUNT 9 #define MAX_ALIAS_SEQUENCE_LENGTH 0 enum { sym__start_tag_name = 1, - sym__start_raw_tag_name = 2, - sym__end_tag_name = 3, - sym_erroneous_end_tag_name = 4, - sym__implicit_end_tag = 5, - sym_raw_text = 6, - sym_comment = 7, - anon_sym_LT_BANG = 8, - aux_sym_SLASH_LBRACK_CARET_GT_RBRACK_PLUS_SLASH = 9, - anon_sym_GT = 10, - sym__doctype = 11, - anon_sym_LT = 12, - anon_sym_SLASH_GT = 13, - anon_sym_LT_SLASH = 14, - anon_sym_EQ = 15, - sym_attribute_name = 16, - sym_attribute_value = 17, - anon_sym_SQUOTE = 18, - aux_sym_SLASH_LBRACK_CARET_SQUOTE_RBRACK_PLUS_SLASH = 19, - anon_sym_DQUOTE = 20, - aux_sym_SLASH_LBRACK_CARET_DQUOTE_RBRACK_PLUS_SLASH = 21, - sym_text = 22, - sym_fragment = 23, - sym_doctype = 24, - sym__node = 25, - sym_element = 26, - sym_raw_element = 27, - sym_start_tag = 28, - sym__raw_start_tag = 29, - sym_self_closing_tag = 30, - sym_end_tag = 31, - sym_erroneous_end_tag = 32, - sym_attribute = 33, - sym_quoted_attribute_value = 34, - aux_sym_fragment_repeat1 = 35, - aux_sym_start_tag_repeat1 = 36, + sym__script_start_tag_name = 2, + sym__style_start_tag_name = 3, + sym__end_tag_name = 4, + sym_erroneous_end_tag_name = 5, + sym__implicit_end_tag = 6, + sym_raw_text = 7, + sym_comment = 8, + anon_sym_LT_BANG = 9, + aux_sym_SLASH_LBRACK_CARET_GT_RBRACK_PLUS_SLASH = 10, + anon_sym_GT = 11, + sym__doctype = 12, + anon_sym_LT = 13, + anon_sym_SLASH_GT = 14, + anon_sym_LT_SLASH = 15, + anon_sym_EQ = 16, + sym_attribute_name = 17, + sym_attribute_value = 18, + anon_sym_SQUOTE = 19, + aux_sym_SLASH_LBRACK_CARET_SQUOTE_RBRACK_PLUS_SLASH = 20, + anon_sym_DQUOTE = 21, + aux_sym_SLASH_LBRACK_CARET_DQUOTE_RBRACK_PLUS_SLASH = 22, + sym_text = 23, + sym_fragment = 24, + sym_doctype = 25, + sym__node = 26, + sym_element = 27, + sym_script_element = 28, + sym_style_element = 29, + sym_start_tag = 30, + sym_script_start_tag = 31, + sym_style_start_tag = 32, + sym_self_closing_tag = 33, + sym_end_tag = 34, + sym_erroneous_end_tag = 35, + sym_attribute = 36, + sym_quoted_attribute_value = 37, + aux_sym_fragment_repeat1 = 38, + aux_sym_start_tag_repeat1 = 39, }; static const char *ts_symbol_names[] = { [sym__start_tag_name] = "tag_name", - [sym__start_raw_tag_name] = "tag_name", + [sym__script_start_tag_name] = "tag_name", + [sym__style_start_tag_name] = "tag_name", [sym__end_tag_name] = "tag_name", [sym_erroneous_end_tag_name] = "erroneous_end_tag_name", [sym__implicit_end_tag] = "_implicit_end_tag", @@ -80,9 +84,11 @@ static const char *ts_symbol_names[] = { [sym_doctype] = "doctype", [sym__node] = "_node", [sym_element] = "element", - [sym_raw_element] = "raw_element", + [sym_script_element] = "script_element", + [sym_style_element] = "style_element", [sym_start_tag] = "start_tag", - [sym__raw_start_tag] = "start_tag", + [sym_script_start_tag] = "start_tag", + [sym_style_start_tag] = "start_tag", [sym_self_closing_tag] = "self_closing_tag", [sym_end_tag] = "end_tag", [sym_erroneous_end_tag] = "erroneous_end_tag", @@ -97,7 +103,11 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = true, }, - [sym__start_raw_tag_name] = { + [sym__script_start_tag_name] = { + .visible = true, + .named = true, + }, + [sym__style_start_tag_name] = { .visible = true, .named = true, }, @@ -201,7 +211,11 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = true, }, - [sym_raw_element] = { + [sym_script_element] = { + .visible = true, + .named = true, + }, + [sym_style_element] = { .visible = true, .named = true, }, @@ -209,7 +223,11 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = true, }, - [sym__raw_start_tag] = { + [sym_script_start_tag] = { + .visible = true, + .named = true, + }, + [sym_style_start_tag] = { .visible = true, .named = true, }, @@ -432,6 +450,8 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { case 28: if (lookahead == '/') ADVANCE(4); + if (lookahead == '=') + ADVANCE(9); if (lookahead == '>') ADVANCE(10); if (lookahead == '\t' || @@ -459,10 +479,6 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { ADVANCE(29); END_STATE(); case 30: - if (lookahead == '/') - ADVANCE(4); - if (lookahead == '=') - ADVANCE(9); if (lookahead == '>') ADVANCE(10); if (lookahead == '\t' || @@ -470,11 +486,6 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead == '\r' || lookahead == ' ') SKIP(30); - if (lookahead != 0 && - lookahead != '\"' && - lookahead != '\'' && - (lookahead < '<' || lookahead > '>')) - ADVANCE(29); END_STATE(); case 31: if (lookahead == '\"') @@ -590,85 +601,98 @@ static TSLexMode ts_lex_modes[STATE_COUNT] = { [5] = {.lex_state = 22, .external_lex_state = 2}, [6] = {.lex_state = 18, .external_lex_state = 5}, [7] = {.lex_state = 23, .external_lex_state = 6}, - [8] = {.lex_state = 18, .external_lex_state = 2}, + [8] = {.lex_state = 23, .external_lex_state = 6}, [9] = {.lex_state = 18, .external_lex_state = 2}, - [10] = {.lex_state = 25, .external_lex_state = 2}, - [11] = {.lex_state = 28, .external_lex_state = 7}, - [12] = {.lex_state = 28, .external_lex_state = 2}, + [10] = {.lex_state = 18, .external_lex_state = 2}, + [11] = {.lex_state = 25, .external_lex_state = 2}, + [12] = {.lex_state = 28, .external_lex_state = 7}, [13] = {.lex_state = 28, .external_lex_state = 2}, - [14] = {.lex_state = 18, .external_lex_state = 2}, - [15] = {.lex_state = 21, .external_lex_state = 2}, - [16] = {.lex_state = 22, .external_lex_state = 3}, - [17] = {.lex_state = 22, .external_lex_state = 8}, - [18] = {.lex_state = 18, .external_lex_state = 5}, - [19] = {.lex_state = 23, .external_lex_state = 6}, + [14] = {.lex_state = 28, .external_lex_state = 2}, + [15] = {.lex_state = 30, .external_lex_state = 2}, + [16] = {.lex_state = 18, .external_lex_state = 2}, + [17] = {.lex_state = 21, .external_lex_state = 2}, + [18] = {.lex_state = 22, .external_lex_state = 3}, + [19] = {.lex_state = 22, .external_lex_state = 8}, [20] = {.lex_state = 18, .external_lex_state = 5}, - [21] = {.lex_state = 18, .external_lex_state = 5}, - [22] = {.lex_state = 23, .external_lex_state = 2}, - [23] = {.lex_state = 22, .external_lex_state = 9}, - [24] = {.lex_state = 18, .external_lex_state = 2}, - [25] = {.lex_state = 18, .external_lex_state = 2}, - [26] = {.lex_state = 28, .external_lex_state = 2}, - [27] = {.lex_state = 18, .external_lex_state = 5}, - [28] = {.lex_state = 18, .external_lex_state = 2}, - [29] = {.lex_state = 30, .external_lex_state = 7}, - [30] = {.lex_state = 28, .external_lex_state = 7}, - [31] = {.lex_state = 23, .external_lex_state = 6}, - [32] = {.lex_state = 30, .external_lex_state = 2}, - [33] = {.lex_state = 28, .external_lex_state = 2}, - [34] = {.lex_state = 18, .external_lex_state = 2}, - [35] = {.lex_state = 25, .external_lex_state = 2}, - [36] = {.lex_state = 28, .external_lex_state = 7}, + [21] = {.lex_state = 23, .external_lex_state = 6}, + [22] = {.lex_state = 23, .external_lex_state = 6}, + [23] = {.lex_state = 18, .external_lex_state = 5}, + [24] = {.lex_state = 18, .external_lex_state = 5}, + [25] = {.lex_state = 23, .external_lex_state = 2}, + [26] = {.lex_state = 22, .external_lex_state = 9}, + [27] = {.lex_state = 18, .external_lex_state = 2}, + [28] = {.lex_state = 23, .external_lex_state = 2}, + [29] = {.lex_state = 18, .external_lex_state = 2}, + [30] = {.lex_state = 18, .external_lex_state = 2}, + [31] = {.lex_state = 30, .external_lex_state = 2}, + [32] = {.lex_state = 18, .external_lex_state = 5}, + [33] = {.lex_state = 18, .external_lex_state = 2}, + [34] = {.lex_state = 28, .external_lex_state = 7}, + [35] = {.lex_state = 28, .external_lex_state = 7}, + [36] = {.lex_state = 23, .external_lex_state = 6}, [37] = {.lex_state = 28, .external_lex_state = 2}, [38] = {.lex_state = 28, .external_lex_state = 2}, - [39] = {.lex_state = 18, .external_lex_state = 5}, - [40] = {.lex_state = 22, .external_lex_state = 8}, - [41] = {.lex_state = 18, .external_lex_state = 5}, - [42] = {.lex_state = 23, .external_lex_state = 2}, - [43] = {.lex_state = 22, .external_lex_state = 9}, - [44] = {.lex_state = 18, .external_lex_state = 5}, - [45] = {.lex_state = 18, .external_lex_state = 2}, + [39] = {.lex_state = 23, .external_lex_state = 6}, + [40] = {.lex_state = 28, .external_lex_state = 2}, + [41] = {.lex_state = 18, .external_lex_state = 2}, + [42] = {.lex_state = 25, .external_lex_state = 2}, + [43] = {.lex_state = 28, .external_lex_state = 7}, + [44] = {.lex_state = 30, .external_lex_state = 2}, + [45] = {.lex_state = 30, .external_lex_state = 2}, [46] = {.lex_state = 18, .external_lex_state = 5}, - [47] = {.lex_state = 18, .external_lex_state = 2}, - [48] = {.lex_state = 18, .external_lex_state = 2}, - [49] = {.lex_state = 31, .external_lex_state = 2}, - [50] = {.lex_state = 18, .external_lex_state = 5}, - [51] = {.lex_state = 18, .external_lex_state = 2}, - [52] = {.lex_state = 28, .external_lex_state = 7}, - [53] = {.lex_state = 31, .external_lex_state = 2}, - [54] = {.lex_state = 23, .external_lex_state = 6}, - [55] = {.lex_state = 28, .external_lex_state = 2}, - [56] = {.lex_state = 28, .external_lex_state = 2}, - [57] = {.lex_state = 18, .external_lex_state = 5}, - [58] = {.lex_state = 28, .external_lex_state = 7}, - [59] = {.lex_state = 18, .external_lex_state = 2}, + [47] = {.lex_state = 22, .external_lex_state = 8}, + [48] = {.lex_state = 18, .external_lex_state = 5}, + [49] = {.lex_state = 23, .external_lex_state = 2}, + [50] = {.lex_state = 22, .external_lex_state = 9}, + [51] = {.lex_state = 18, .external_lex_state = 5}, + [52] = {.lex_state = 23, .external_lex_state = 2}, + [53] = {.lex_state = 18, .external_lex_state = 5}, + [54] = {.lex_state = 18, .external_lex_state = 2}, + [55] = {.lex_state = 18, .external_lex_state = 5}, + [56] = {.lex_state = 18, .external_lex_state = 2}, + [57] = {.lex_state = 18, .external_lex_state = 2}, + [58] = {.lex_state = 18, .external_lex_state = 2}, + [59] = {.lex_state = 31, .external_lex_state = 2}, [60] = {.lex_state = 18, .external_lex_state = 5}, - [61] = {.lex_state = 28, .external_lex_state = 2}, - [62] = {.lex_state = 18, .external_lex_state = 5}, - [63] = {.lex_state = 18, .external_lex_state = 5}, - [64] = {.lex_state = 22, .external_lex_state = 4}, - [65] = {.lex_state = 28, .external_lex_state = 7}, - [66] = {.lex_state = 33, .external_lex_state = 2}, - [67] = {.lex_state = 36, .external_lex_state = 2}, - [68] = {.lex_state = 28, .external_lex_state = 2}, - [69] = {.lex_state = 33, .external_lex_state = 2}, - [70] = {.lex_state = 36, .external_lex_state = 2}, + [61] = {.lex_state = 18, .external_lex_state = 2}, + [62] = {.lex_state = 28, .external_lex_state = 7}, + [63] = {.lex_state = 31, .external_lex_state = 2}, + [64] = {.lex_state = 23, .external_lex_state = 6}, + [65] = {.lex_state = 28, .external_lex_state = 2}, + [66] = {.lex_state = 23, .external_lex_state = 6}, + [67] = {.lex_state = 30, .external_lex_state = 2}, + [68] = {.lex_state = 18, .external_lex_state = 5}, + [69] = {.lex_state = 28, .external_lex_state = 7}, + [70] = {.lex_state = 18, .external_lex_state = 2}, [71] = {.lex_state = 18, .external_lex_state = 5}, - [72] = {.lex_state = 18, .external_lex_state = 5}, + [72] = {.lex_state = 30, .external_lex_state = 2}, [73] = {.lex_state = 18, .external_lex_state = 5}, - [74] = {.lex_state = 28, .external_lex_state = 7}, - [75] = {.lex_state = 39, .external_lex_state = 2}, - [76] = {.lex_state = 40, .external_lex_state = 2}, - [77] = {.lex_state = 28, .external_lex_state = 2}, - [78] = {.lex_state = 39, .external_lex_state = 2}, - [79] = {.lex_state = 40, .external_lex_state = 2}, - [80] = {.lex_state = 28, .external_lex_state = 7}, - [81] = {.lex_state = 28, .external_lex_state = 2}, + [74] = {.lex_state = 18, .external_lex_state = 5}, + [75] = {.lex_state = 18, .external_lex_state = 5}, + [76] = {.lex_state = 22, .external_lex_state = 4}, + [77] = {.lex_state = 28, .external_lex_state = 7}, + [78] = {.lex_state = 33, .external_lex_state = 2}, + [79] = {.lex_state = 36, .external_lex_state = 2}, + [80] = {.lex_state = 28, .external_lex_state = 2}, + [81] = {.lex_state = 33, .external_lex_state = 2}, + [82] = {.lex_state = 36, .external_lex_state = 2}, + [83] = {.lex_state = 18, .external_lex_state = 5}, + [84] = {.lex_state = 18, .external_lex_state = 5}, + [85] = {.lex_state = 18, .external_lex_state = 5}, + [86] = {.lex_state = 28, .external_lex_state = 7}, + [87] = {.lex_state = 39, .external_lex_state = 2}, + [88] = {.lex_state = 40, .external_lex_state = 2}, + [89] = {.lex_state = 28, .external_lex_state = 2}, + [90] = {.lex_state = 39, .external_lex_state = 2}, + [91] = {.lex_state = 40, .external_lex_state = 2}, + [92] = {.lex_state = 28, .external_lex_state = 7}, + [93] = {.lex_state = 28, .external_lex_state = 2}, }; enum { ts_external_token__start_tag_name, - ts_external_token__start_raw_tag_name, + ts_external_token__script_start_tag_name, + ts_external_token__style_start_tag_name, ts_external_token__end_tag_name, ts_external_token_erroneous_end_tag_name, ts_external_token_SLASH_GT, @@ -679,7 +703,8 @@ enum { static TSSymbol ts_external_scanner_symbol_map[EXTERNAL_TOKEN_COUNT] = { [ts_external_token__start_tag_name] = sym__start_tag_name, - [ts_external_token__start_raw_tag_name] = sym__start_raw_tag_name, + [ts_external_token__script_start_tag_name] = sym__script_start_tag_name, + [ts_external_token__style_start_tag_name] = sym__style_start_tag_name, [ts_external_token__end_tag_name] = sym__end_tag_name, [ts_external_token_erroneous_end_tag_name] = sym_erroneous_end_tag_name, [ts_external_token_SLASH_GT] = anon_sym_SLASH_GT, @@ -691,7 +716,8 @@ static TSSymbol ts_external_scanner_symbol_map[EXTERNAL_TOKEN_COUNT] = { static bool ts_external_scanner_states[10][EXTERNAL_TOKEN_COUNT] = { [1] = { [ts_external_token__start_tag_name] = true, - [ts_external_token__start_raw_tag_name] = true, + [ts_external_token__script_start_tag_name] = true, + [ts_external_token__style_start_tag_name] = true, [ts_external_token__end_tag_name] = true, [ts_external_token_erroneous_end_tag_name] = true, [ts_external_token_SLASH_GT] = true, @@ -704,7 +730,8 @@ static bool ts_external_scanner_states[10][EXTERNAL_TOKEN_COUNT] = { }, [3] = { [ts_external_token__start_tag_name] = true, - [ts_external_token__start_raw_tag_name] = true, + [ts_external_token__script_start_tag_name] = true, + [ts_external_token__style_start_tag_name] = true, [ts_external_token_comment] = true, }, [4] = { @@ -737,7 +764,8 @@ static bool ts_external_scanner_states[10][EXTERNAL_TOKEN_COUNT] = { static uint16_t ts_parse_table[STATE_COUNT][SYMBOL_COUNT] = { [0] = { [sym__start_tag_name] = ACTIONS(1), - [sym__start_raw_tag_name] = ACTIONS(1), + [sym__script_start_tag_name] = ACTIONS(1), + [sym__style_start_tag_name] = ACTIONS(1), [sym__end_tag_name] = ACTIONS(1), [sym_erroneous_end_tag_name] = ACTIONS(1), [sym__implicit_end_tag] = ACTIONS(1), @@ -756,15 +784,17 @@ static uint16_t ts_parse_table[STATE_COUNT][SYMBOL_COUNT] = { }, [1] = { [sym_fragment] = STATE(5), - [sym_doctype] = STATE(9), - [sym__node] = STATE(9), - [sym_element] = STATE(9), - [sym_raw_element] = STATE(9), + [sym_doctype] = STATE(10), + [sym__node] = STATE(10), + [sym_element] = STATE(10), + [sym_script_element] = STATE(10), + [sym_style_element] = STATE(10), [sym_start_tag] = STATE(6), - [sym__raw_start_tag] = STATE(7), - [sym_self_closing_tag] = STATE(8), - [sym_erroneous_end_tag] = STATE(9), - [aux_sym_fragment_repeat1] = STATE(9), + [sym_script_start_tag] = STATE(7), + [sym_style_start_tag] = STATE(8), + [sym_self_closing_tag] = STATE(9), + [sym_erroneous_end_tag] = STATE(10), + [aux_sym_fragment_repeat1] = STATE(10), [sym_comment] = ACTIONS(5), [ts_builtin_sym_end] = ACTIONS(7), [anon_sym_LT_BANG] = ACTIONS(9), @@ -778,325 +808,305 @@ static uint16_t ts_parse_table[STATE_COUNT][SYMBOL_COUNT] = { }, [3] = { [sym__start_tag_name] = ACTIONS(19), - [sym__start_raw_tag_name] = ACTIONS(21), + [sym__script_start_tag_name] = ACTIONS(21), + [sym__style_start_tag_name] = ACTIONS(23), [sym_comment] = ACTIONS(5), }, [4] = { - [sym_erroneous_end_tag_name] = ACTIONS(23), + [sym_erroneous_end_tag_name] = ACTIONS(25), [sym_comment] = ACTIONS(5), }, [5] = { [sym_comment] = ACTIONS(5), - [ts_builtin_sym_end] = ACTIONS(25), + [ts_builtin_sym_end] = ACTIONS(27), }, [6] = { - [sym_doctype] = STATE(21), - [sym__node] = STATE(21), - [sym_element] = STATE(21), - [sym_raw_element] = STATE(21), - [sym_start_tag] = STATE(18), - [sym__raw_start_tag] = STATE(19), - [sym_self_closing_tag] = STATE(20), - [sym_end_tag] = STATE(14), - [sym_erroneous_end_tag] = STATE(21), - [aux_sym_fragment_repeat1] = STATE(21), - [sym__implicit_end_tag] = ACTIONS(27), + [sym_doctype] = STATE(24), + [sym__node] = STATE(24), + [sym_element] = STATE(24), + [sym_script_element] = STATE(24), + [sym_style_element] = STATE(24), + [sym_start_tag] = STATE(20), + [sym_script_start_tag] = STATE(21), + [sym_style_start_tag] = STATE(22), + [sym_self_closing_tag] = STATE(23), + [sym_end_tag] = STATE(16), + [sym_erroneous_end_tag] = STATE(24), + [aux_sym_fragment_repeat1] = STATE(24), + [sym__implicit_end_tag] = ACTIONS(29), [sym_comment] = ACTIONS(5), - [anon_sym_LT_BANG] = ACTIONS(29), - [anon_sym_LT] = ACTIONS(31), - [anon_sym_LT_SLASH] = ACTIONS(33), - [sym_text] = ACTIONS(35), + [anon_sym_LT_BANG] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(33), + [anon_sym_LT_SLASH] = ACTIONS(35), + [sym_text] = ACTIONS(37), }, [7] = { - [sym_end_tag] = STATE(24), - [sym_raw_text] = ACTIONS(37), + [sym_end_tag] = STATE(27), + [sym_raw_text] = ACTIONS(39), [sym_comment] = ACTIONS(5), - [anon_sym_LT_SLASH] = ACTIONS(39), + [anon_sym_LT_SLASH] = ACTIONS(41), }, [8] = { + [sym_end_tag] = STATE(29), + [sym_raw_text] = ACTIONS(43), [sym_comment] = ACTIONS(5), - [ts_builtin_sym_end] = ACTIONS(41), - [anon_sym_LT_BANG] = ACTIONS(43), - [anon_sym_LT] = ACTIONS(43), - [anon_sym_LT_SLASH] = ACTIONS(43), - [sym_text] = ACTIONS(41), + [anon_sym_LT_SLASH] = ACTIONS(41), }, [9] = { - [sym_doctype] = STATE(25), - [sym__node] = STATE(25), - [sym_element] = STATE(25), - [sym_raw_element] = STATE(25), - [sym_start_tag] = STATE(6), - [sym__raw_start_tag] = STATE(7), - [sym_self_closing_tag] = STATE(8), - [sym_erroneous_end_tag] = STATE(25), - [aux_sym_fragment_repeat1] = STATE(25), [sym_comment] = ACTIONS(5), [ts_builtin_sym_end] = ACTIONS(45), + [anon_sym_LT_BANG] = ACTIONS(47), + [anon_sym_LT] = ACTIONS(47), + [anon_sym_LT_SLASH] = ACTIONS(47), + [sym_text] = ACTIONS(45), + }, + [10] = { + [sym_doctype] = STATE(30), + [sym__node] = STATE(30), + [sym_element] = STATE(30), + [sym_script_element] = STATE(30), + [sym_style_element] = STATE(30), + [sym_start_tag] = STATE(6), + [sym_script_start_tag] = STATE(7), + [sym_style_start_tag] = STATE(8), + [sym_self_closing_tag] = STATE(9), + [sym_erroneous_end_tag] = STATE(30), + [aux_sym_fragment_repeat1] = STATE(30), + [sym_comment] = ACTIONS(5), + [ts_builtin_sym_end] = ACTIONS(49), [anon_sym_LT_BANG] = ACTIONS(9), [anon_sym_LT] = ACTIONS(11), [anon_sym_LT_SLASH] = ACTIONS(13), - [sym_text] = ACTIONS(47), - }, - [10] = { - [sym_comment] = ACTIONS(5), - [aux_sym_SLASH_LBRACK_CARET_GT_RBRACK_PLUS_SLASH] = ACTIONS(49), + [sym_text] = ACTIONS(51), }, [11] = { - [sym_attribute] = STATE(30), - [aux_sym_start_tag_repeat1] = STATE(30), [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(51), - [anon_sym_SLASH_GT] = ACTIONS(53), - [sym_attribute_name] = ACTIONS(55), + [aux_sym_SLASH_LBRACK_CARET_GT_RBRACK_PLUS_SLASH] = ACTIONS(53), }, [12] = { - [sym_attribute] = STATE(33), - [aux_sym_start_tag_repeat1] = STATE(33), + [sym_attribute] = STATE(35), + [aux_sym_start_tag_repeat1] = STATE(35), [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(57), + [anon_sym_GT] = ACTIONS(55), + [anon_sym_SLASH_GT] = ACTIONS(57), [sym_attribute_name] = ACTIONS(59), }, [13] = { + [sym_attribute] = STATE(38), + [aux_sym_start_tag_repeat1] = STATE(38), [sym_comment] = ACTIONS(5), [anon_sym_GT] = ACTIONS(61), + [sym_attribute_name] = ACTIONS(63), }, [14] = { + [sym_attribute] = STATE(40), + [aux_sym_start_tag_repeat1] = STATE(40), [sym_comment] = ACTIONS(5), - [ts_builtin_sym_end] = ACTIONS(63), - [anon_sym_LT_BANG] = ACTIONS(65), - [anon_sym_LT] = ACTIONS(65), - [anon_sym_LT_SLASH] = ACTIONS(65), - [sym_text] = ACTIONS(63), + [anon_sym_GT] = ACTIONS(65), + [sym_attribute_name] = ACTIONS(63), }, [15] = { [sym_comment] = ACTIONS(5), - [sym__doctype] = ACTIONS(67), + [anon_sym_GT] = ACTIONS(67), }, [16] = { - [sym__start_tag_name] = ACTIONS(69), - [sym__start_raw_tag_name] = ACTIONS(21), [sym_comment] = ACTIONS(5), + [ts_builtin_sym_end] = ACTIONS(69), + [anon_sym_LT_BANG] = ACTIONS(71), + [anon_sym_LT] = ACTIONS(71), + [anon_sym_LT_SLASH] = ACTIONS(71), + [sym_text] = ACTIONS(69), }, [17] = { - [sym__end_tag_name] = ACTIONS(71), - [sym_erroneous_end_tag_name] = ACTIONS(73), [sym_comment] = ACTIONS(5), + [sym__doctype] = ACTIONS(73), }, [18] = { - [sym_doctype] = STATE(41), - [sym__node] = STATE(41), - [sym_element] = STATE(41), - [sym_raw_element] = STATE(41), - [sym_start_tag] = STATE(18), - [sym__raw_start_tag] = STATE(19), - [sym_self_closing_tag] = STATE(20), - [sym_end_tag] = STATE(39), - [sym_erroneous_end_tag] = STATE(41), - [aux_sym_fragment_repeat1] = STATE(41), - [sym__implicit_end_tag] = ACTIONS(75), + [sym__start_tag_name] = ACTIONS(75), + [sym__script_start_tag_name] = ACTIONS(21), + [sym__style_start_tag_name] = ACTIONS(23), [sym_comment] = ACTIONS(5), - [anon_sym_LT_BANG] = ACTIONS(29), - [anon_sym_LT] = ACTIONS(31), - [anon_sym_LT_SLASH] = ACTIONS(77), - [sym_text] = ACTIONS(79), }, [19] = { - [sym_end_tag] = STATE(44), - [sym_raw_text] = ACTIONS(81), + [sym__end_tag_name] = ACTIONS(77), + [sym_erroneous_end_tag_name] = ACTIONS(79), [sym_comment] = ACTIONS(5), - [anon_sym_LT_SLASH] = ACTIONS(83), }, [20] = { - [sym__implicit_end_tag] = ACTIONS(41), + [sym_doctype] = STATE(48), + [sym__node] = STATE(48), + [sym_element] = STATE(48), + [sym_script_element] = STATE(48), + [sym_style_element] = STATE(48), + [sym_start_tag] = STATE(20), + [sym_script_start_tag] = STATE(21), + [sym_style_start_tag] = STATE(22), + [sym_self_closing_tag] = STATE(23), + [sym_end_tag] = STATE(46), + [sym_erroneous_end_tag] = STATE(48), + [aux_sym_fragment_repeat1] = STATE(48), + [sym__implicit_end_tag] = ACTIONS(81), [sym_comment] = ACTIONS(5), - [anon_sym_LT_BANG] = ACTIONS(43), - [anon_sym_LT] = ACTIONS(43), - [anon_sym_LT_SLASH] = ACTIONS(43), - [sym_text] = ACTIONS(41), + [anon_sym_LT_BANG] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(33), + [anon_sym_LT_SLASH] = ACTIONS(83), + [sym_text] = ACTIONS(85), }, [21] = { - [sym_doctype] = STATE(46), - [sym__node] = STATE(46), - [sym_element] = STATE(46), - [sym_raw_element] = STATE(46), - [sym_start_tag] = STATE(18), - [sym__raw_start_tag] = STATE(19), - [sym_self_closing_tag] = STATE(20), - [sym_end_tag] = STATE(45), - [sym_erroneous_end_tag] = STATE(46), - [aux_sym_fragment_repeat1] = STATE(46), - [sym__implicit_end_tag] = ACTIONS(85), + [sym_end_tag] = STATE(51), + [sym_raw_text] = ACTIONS(87), [sym_comment] = ACTIONS(5), - [anon_sym_LT_BANG] = ACTIONS(29), - [anon_sym_LT] = ACTIONS(31), - [anon_sym_LT_SLASH] = ACTIONS(33), - [sym_text] = ACTIONS(87), + [anon_sym_LT_SLASH] = ACTIONS(89), }, [22] = { - [sym_end_tag] = STATE(47), + [sym_end_tag] = STATE(53), + [sym_raw_text] = ACTIONS(91), [sym_comment] = ACTIONS(5), - [anon_sym_LT_SLASH] = ACTIONS(39), + [anon_sym_LT_SLASH] = ACTIONS(89), }, [23] = { - [sym__end_tag_name] = ACTIONS(71), + [sym__implicit_end_tag] = ACTIONS(45), [sym_comment] = ACTIONS(5), + [anon_sym_LT_BANG] = ACTIONS(47), + [anon_sym_LT] = ACTIONS(47), + [anon_sym_LT_SLASH] = ACTIONS(47), + [sym_text] = ACTIONS(45), }, [24] = { + [sym_doctype] = STATE(55), + [sym__node] = STATE(55), + [sym_element] = STATE(55), + [sym_script_element] = STATE(55), + [sym_style_element] = STATE(55), + [sym_start_tag] = STATE(20), + [sym_script_start_tag] = STATE(21), + [sym_style_start_tag] = STATE(22), + [sym_self_closing_tag] = STATE(23), + [sym_end_tag] = STATE(54), + [sym_erroneous_end_tag] = STATE(55), + [aux_sym_fragment_repeat1] = STATE(55), + [sym__implicit_end_tag] = ACTIONS(93), [sym_comment] = ACTIONS(5), - [ts_builtin_sym_end] = ACTIONS(89), - [anon_sym_LT_BANG] = ACTIONS(91), - [anon_sym_LT] = ACTIONS(91), - [anon_sym_LT_SLASH] = ACTIONS(91), - [sym_text] = ACTIONS(89), + [anon_sym_LT_BANG] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(33), + [anon_sym_LT_SLASH] = ACTIONS(35), + [sym_text] = ACTIONS(95), }, [25] = { - [sym_doctype] = STATE(25), - [sym__node] = STATE(25), - [sym_element] = STATE(25), - [sym_raw_element] = STATE(25), - [sym_start_tag] = STATE(6), - [sym__raw_start_tag] = STATE(7), - [sym_self_closing_tag] = STATE(8), - [sym_erroneous_end_tag] = STATE(25), - [aux_sym_fragment_repeat1] = STATE(25), + [sym_end_tag] = STATE(56), [sym_comment] = ACTIONS(5), - [ts_builtin_sym_end] = ACTIONS(93), - [anon_sym_LT_BANG] = ACTIONS(95), - [anon_sym_LT] = ACTIONS(98), - [anon_sym_LT_SLASH] = ACTIONS(101), - [sym_text] = ACTIONS(104), + [anon_sym_LT_SLASH] = ACTIONS(41), }, [26] = { + [sym__end_tag_name] = ACTIONS(77), [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(107), }, [27] = { - [sym__implicit_end_tag] = ACTIONS(109), [sym_comment] = ACTIONS(5), - [anon_sym_LT_BANG] = ACTIONS(111), - [anon_sym_LT] = ACTIONS(111), - [anon_sym_LT_SLASH] = ACTIONS(111), - [sym_text] = ACTIONS(109), + [ts_builtin_sym_end] = ACTIONS(97), + [anon_sym_LT_BANG] = ACTIONS(99), + [anon_sym_LT] = ACTIONS(99), + [anon_sym_LT_SLASH] = ACTIONS(99), + [sym_text] = ACTIONS(97), }, [28] = { + [sym_end_tag] = STATE(57), [sym_comment] = ACTIONS(5), - [ts_builtin_sym_end] = ACTIONS(113), - [anon_sym_LT_BANG] = ACTIONS(115), - [anon_sym_LT] = ACTIONS(115), - [anon_sym_LT_SLASH] = ACTIONS(115), - [sym_text] = ACTIONS(113), + [anon_sym_LT_SLASH] = ACTIONS(41), }, [29] = { [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(117), - [anon_sym_SLASH_GT] = ACTIONS(117), - [anon_sym_EQ] = ACTIONS(119), - [sym_attribute_name] = ACTIONS(117), + [ts_builtin_sym_end] = ACTIONS(101), + [anon_sym_LT_BANG] = ACTIONS(103), + [anon_sym_LT] = ACTIONS(103), + [anon_sym_LT_SLASH] = ACTIONS(103), + [sym_text] = ACTIONS(101), }, [30] = { - [sym_attribute] = STATE(52), - [aux_sym_start_tag_repeat1] = STATE(52), + [sym_doctype] = STATE(30), + [sym__node] = STATE(30), + [sym_element] = STATE(30), + [sym_script_element] = STATE(30), + [sym_style_element] = STATE(30), + [sym_start_tag] = STATE(6), + [sym_script_start_tag] = STATE(7), + [sym_style_start_tag] = STATE(8), + [sym_self_closing_tag] = STATE(9), + [sym_erroneous_end_tag] = STATE(30), + [aux_sym_fragment_repeat1] = STATE(30), [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(121), - [anon_sym_SLASH_GT] = ACTIONS(123), - [sym_attribute_name] = ACTIONS(55), + [ts_builtin_sym_end] = ACTIONS(105), + [anon_sym_LT_BANG] = ACTIONS(107), + [anon_sym_LT] = ACTIONS(110), + [anon_sym_LT_SLASH] = ACTIONS(113), + [sym_text] = ACTIONS(116), }, [31] = { - [sym_raw_text] = ACTIONS(125), [sym_comment] = ACTIONS(5), - [anon_sym_LT_SLASH] = ACTIONS(125), + [anon_sym_GT] = ACTIONS(119), }, [32] = { + [sym__implicit_end_tag] = ACTIONS(121), [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(117), - [anon_sym_EQ] = ACTIONS(127), - [sym_attribute_name] = ACTIONS(117), + [anon_sym_LT_BANG] = ACTIONS(123), + [anon_sym_LT] = ACTIONS(123), + [anon_sym_LT_SLASH] = ACTIONS(123), + [sym_text] = ACTIONS(121), }, [33] = { - [sym_attribute] = STATE(55), - [aux_sym_start_tag_repeat1] = STATE(55), [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(129), - [sym_attribute_name] = ACTIONS(59), + [ts_builtin_sym_end] = ACTIONS(125), + [anon_sym_LT_BANG] = ACTIONS(127), + [anon_sym_LT] = ACTIONS(127), + [anon_sym_LT_SLASH] = ACTIONS(127), + [sym_text] = ACTIONS(125), }, [34] = { [sym_comment] = ACTIONS(5), - [ts_builtin_sym_end] = ACTIONS(131), - [anon_sym_LT_BANG] = ACTIONS(133), - [anon_sym_LT] = ACTIONS(133), - [anon_sym_LT_SLASH] = ACTIONS(133), - [sym_text] = ACTIONS(131), + [anon_sym_GT] = ACTIONS(129), + [anon_sym_SLASH_GT] = ACTIONS(129), + [anon_sym_EQ] = ACTIONS(131), + [sym_attribute_name] = ACTIONS(129), }, [35] = { + [sym_attribute] = STATE(62), + [aux_sym_start_tag_repeat1] = STATE(62), [sym_comment] = ACTIONS(5), - [aux_sym_SLASH_LBRACK_CARET_GT_RBRACK_PLUS_SLASH] = ACTIONS(135), + [anon_sym_GT] = ACTIONS(133), + [anon_sym_SLASH_GT] = ACTIONS(135), + [sym_attribute_name] = ACTIONS(59), }, [36] = { - [sym_attribute] = STATE(58), - [aux_sym_start_tag_repeat1] = STATE(58), + [sym_raw_text] = ACTIONS(137), [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(51), - [anon_sym_SLASH_GT] = ACTIONS(137), - [sym_attribute_name] = ACTIONS(55), + [anon_sym_LT_SLASH] = ACTIONS(137), }, [37] = { [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(139), + [anon_sym_GT] = ACTIONS(129), + [anon_sym_EQ] = ACTIONS(139), + [sym_attribute_name] = ACTIONS(129), }, [38] = { + [sym_attribute] = STATE(65), + [aux_sym_start_tag_repeat1] = STATE(65), [sym_comment] = ACTIONS(5), [anon_sym_GT] = ACTIONS(141), + [sym_attribute_name] = ACTIONS(63), }, [39] = { - [sym__implicit_end_tag] = ACTIONS(63), + [sym_raw_text] = ACTIONS(143), [sym_comment] = ACTIONS(5), - [anon_sym_LT_BANG] = ACTIONS(65), - [anon_sym_LT] = ACTIONS(65), - [anon_sym_LT_SLASH] = ACTIONS(65), - [sym_text] = ACTIONS(63), + [anon_sym_LT_SLASH] = ACTIONS(143), }, [40] = { - [sym__end_tag_name] = ACTIONS(143), - [sym_erroneous_end_tag_name] = ACTIONS(73), + [sym_attribute] = STATE(65), + [aux_sym_start_tag_repeat1] = STATE(65), [sym_comment] = ACTIONS(5), + [anon_sym_GT] = ACTIONS(145), + [sym_attribute_name] = ACTIONS(63), }, [41] = { - [sym_doctype] = STATE(46), - [sym__node] = STATE(46), - [sym_element] = STATE(46), - [sym_raw_element] = STATE(46), - [sym_start_tag] = STATE(18), - [sym__raw_start_tag] = STATE(19), - [sym_self_closing_tag] = STATE(20), - [sym_end_tag] = STATE(62), - [sym_erroneous_end_tag] = STATE(46), - [aux_sym_fragment_repeat1] = STATE(46), - [sym__implicit_end_tag] = ACTIONS(145), - [sym_comment] = ACTIONS(5), - [anon_sym_LT_BANG] = ACTIONS(29), - [anon_sym_LT] = ACTIONS(31), - [anon_sym_LT_SLASH] = ACTIONS(77), - [sym_text] = ACTIONS(87), - }, - [42] = { - [sym_end_tag] = STATE(63), - [sym_comment] = ACTIONS(5), - [anon_sym_LT_SLASH] = ACTIONS(83), - }, - [43] = { - [sym__end_tag_name] = ACTIONS(143), - [sym_comment] = ACTIONS(5), - }, - [44] = { - [sym__implicit_end_tag] = ACTIONS(89), - [sym_comment] = ACTIONS(5), - [anon_sym_LT_BANG] = ACTIONS(91), - [anon_sym_LT] = ACTIONS(91), - [anon_sym_LT_SLASH] = ACTIONS(91), - [sym_text] = ACTIONS(89), - }, - [45] = { [sym_comment] = ACTIONS(5), [ts_builtin_sym_end] = ACTIONS(147), [anon_sym_LT_BANG] = ACTIONS(149), @@ -1104,24 +1114,90 @@ static uint16_t ts_parse_table[STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_LT_SLASH] = ACTIONS(149), [sym_text] = ACTIONS(147), }, - [46] = { - [sym_doctype] = STATE(46), - [sym__node] = STATE(46), - [sym_element] = STATE(46), - [sym_raw_element] = STATE(46), - [sym_start_tag] = STATE(18), - [sym__raw_start_tag] = STATE(19), - [sym_self_closing_tag] = STATE(20), - [sym_erroneous_end_tag] = STATE(46), - [aux_sym_fragment_repeat1] = STATE(46), - [sym__implicit_end_tag] = ACTIONS(93), + [42] = { [sym_comment] = ACTIONS(5), - [anon_sym_LT_BANG] = ACTIONS(151), - [anon_sym_LT] = ACTIONS(154), - [anon_sym_LT_SLASH] = ACTIONS(157), - [sym_text] = ACTIONS(160), + [aux_sym_SLASH_LBRACK_CARET_GT_RBRACK_PLUS_SLASH] = ACTIONS(151), + }, + [43] = { + [sym_attribute] = STATE(69), + [aux_sym_start_tag_repeat1] = STATE(69), + [sym_comment] = ACTIONS(5), + [anon_sym_GT] = ACTIONS(55), + [anon_sym_SLASH_GT] = ACTIONS(153), + [sym_attribute_name] = ACTIONS(59), + }, + [44] = { + [sym_comment] = ACTIONS(5), + [anon_sym_GT] = ACTIONS(155), + }, + [45] = { + [sym_comment] = ACTIONS(5), + [anon_sym_GT] = ACTIONS(157), + }, + [46] = { + [sym__implicit_end_tag] = ACTIONS(69), + [sym_comment] = ACTIONS(5), + [anon_sym_LT_BANG] = ACTIONS(71), + [anon_sym_LT] = ACTIONS(71), + [anon_sym_LT_SLASH] = ACTIONS(71), + [sym_text] = ACTIONS(69), }, [47] = { + [sym__end_tag_name] = ACTIONS(159), + [sym_erroneous_end_tag_name] = ACTIONS(79), + [sym_comment] = ACTIONS(5), + }, + [48] = { + [sym_doctype] = STATE(55), + [sym__node] = STATE(55), + [sym_element] = STATE(55), + [sym_script_element] = STATE(55), + [sym_style_element] = STATE(55), + [sym_start_tag] = STATE(20), + [sym_script_start_tag] = STATE(21), + [sym_style_start_tag] = STATE(22), + [sym_self_closing_tag] = STATE(23), + [sym_end_tag] = STATE(73), + [sym_erroneous_end_tag] = STATE(55), + [aux_sym_fragment_repeat1] = STATE(55), + [sym__implicit_end_tag] = ACTIONS(161), + [sym_comment] = ACTIONS(5), + [anon_sym_LT_BANG] = ACTIONS(31), + [anon_sym_LT] = ACTIONS(33), + [anon_sym_LT_SLASH] = ACTIONS(83), + [sym_text] = ACTIONS(95), + }, + [49] = { + [sym_end_tag] = STATE(74), + [sym_comment] = ACTIONS(5), + [anon_sym_LT_SLASH] = ACTIONS(89), + }, + [50] = { + [sym__end_tag_name] = ACTIONS(159), + [sym_comment] = ACTIONS(5), + }, + [51] = { + [sym__implicit_end_tag] = ACTIONS(97), + [sym_comment] = ACTIONS(5), + [anon_sym_LT_BANG] = ACTIONS(99), + [anon_sym_LT] = ACTIONS(99), + [anon_sym_LT_SLASH] = ACTIONS(99), + [sym_text] = ACTIONS(97), + }, + [52] = { + [sym_end_tag] = STATE(75), + [sym_comment] = ACTIONS(5), + [anon_sym_LT_SLASH] = ACTIONS(89), + }, + [53] = { + [sym__implicit_end_tag] = ACTIONS(101), + [sym_comment] = ACTIONS(5), + [anon_sym_LT_BANG] = ACTIONS(103), + [anon_sym_LT] = ACTIONS(103), + [anon_sym_LT_SLASH] = ACTIONS(103), + [sym_text] = ACTIONS(101), + }, + [54] = { [sym_comment] = ACTIONS(5), [ts_builtin_sym_end] = ACTIONS(163), [anon_sym_LT_BANG] = ACTIONS(165), @@ -1129,105 +1205,133 @@ static uint16_t ts_parse_table[STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_LT_SLASH] = ACTIONS(165), [sym_text] = ACTIONS(163), }, - [48] = { - [sym_comment] = ACTIONS(5), - [ts_builtin_sym_end] = ACTIONS(167), - [anon_sym_LT_BANG] = ACTIONS(169), - [anon_sym_LT] = ACTIONS(169), - [anon_sym_LT_SLASH] = ACTIONS(169), - [sym_text] = ACTIONS(167), - }, - [49] = { - [sym_quoted_attribute_value] = STATE(65), - [sym_comment] = ACTIONS(5), - [sym_attribute_value] = ACTIONS(171), - [anon_sym_SQUOTE] = ACTIONS(173), - [anon_sym_DQUOTE] = ACTIONS(175), - }, - [50] = { - [sym__implicit_end_tag] = ACTIONS(177), - [sym_comment] = ACTIONS(5), - [anon_sym_LT_BANG] = ACTIONS(179), - [anon_sym_LT] = ACTIONS(179), - [anon_sym_LT_SLASH] = ACTIONS(179), - [sym_text] = ACTIONS(177), - }, - [51] = { - [sym_comment] = ACTIONS(5), - [ts_builtin_sym_end] = ACTIONS(181), - [anon_sym_LT_BANG] = ACTIONS(183), - [anon_sym_LT] = ACTIONS(183), - [anon_sym_LT_SLASH] = ACTIONS(183), - [sym_text] = ACTIONS(181), - }, - [52] = { - [sym_attribute] = STATE(52), - [aux_sym_start_tag_repeat1] = STATE(52), - [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(185), - [anon_sym_SLASH_GT] = ACTIONS(185), - [sym_attribute_name] = ACTIONS(187), - }, - [53] = { - [sym_quoted_attribute_value] = STATE(68), - [sym_comment] = ACTIONS(5), - [sym_attribute_value] = ACTIONS(190), - [anon_sym_SQUOTE] = ACTIONS(192), - [anon_sym_DQUOTE] = ACTIONS(194), - }, - [54] = { - [sym_raw_text] = ACTIONS(196), - [sym_comment] = ACTIONS(5), - [anon_sym_LT_SLASH] = ACTIONS(196), - }, [55] = { - [sym_attribute] = STATE(55), - [aux_sym_start_tag_repeat1] = STATE(55), + [sym_doctype] = STATE(55), + [sym__node] = STATE(55), + [sym_element] = STATE(55), + [sym_script_element] = STATE(55), + [sym_style_element] = STATE(55), + [sym_start_tag] = STATE(20), + [sym_script_start_tag] = STATE(21), + [sym_style_start_tag] = STATE(22), + [sym_self_closing_tag] = STATE(23), + [sym_erroneous_end_tag] = STATE(55), + [aux_sym_fragment_repeat1] = STATE(55), + [sym__implicit_end_tag] = ACTIONS(105), [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(185), - [sym_attribute_name] = ACTIONS(198), + [anon_sym_LT_BANG] = ACTIONS(167), + [anon_sym_LT] = ACTIONS(170), + [anon_sym_LT_SLASH] = ACTIONS(173), + [sym_text] = ACTIONS(176), }, [56] = { [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(201), + [ts_builtin_sym_end] = ACTIONS(179), + [anon_sym_LT_BANG] = ACTIONS(181), + [anon_sym_LT] = ACTIONS(181), + [anon_sym_LT_SLASH] = ACTIONS(181), + [sym_text] = ACTIONS(179), }, [57] = { - [sym__implicit_end_tag] = ACTIONS(113), [sym_comment] = ACTIONS(5), - [anon_sym_LT_BANG] = ACTIONS(115), - [anon_sym_LT] = ACTIONS(115), - [anon_sym_LT_SLASH] = ACTIONS(115), - [sym_text] = ACTIONS(113), + [ts_builtin_sym_end] = ACTIONS(183), + [anon_sym_LT_BANG] = ACTIONS(185), + [anon_sym_LT] = ACTIONS(185), + [anon_sym_LT_SLASH] = ACTIONS(185), + [sym_text] = ACTIONS(183), }, [58] = { - [sym_attribute] = STATE(52), - [aux_sym_start_tag_repeat1] = STATE(52), [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(121), - [anon_sym_SLASH_GT] = ACTIONS(203), - [sym_attribute_name] = ACTIONS(55), + [ts_builtin_sym_end] = ACTIONS(187), + [anon_sym_LT_BANG] = ACTIONS(189), + [anon_sym_LT] = ACTIONS(189), + [anon_sym_LT_SLASH] = ACTIONS(189), + [sym_text] = ACTIONS(187), }, [59] = { + [sym_quoted_attribute_value] = STATE(77), [sym_comment] = ACTIONS(5), - [ts_builtin_sym_end] = ACTIONS(205), - [anon_sym_LT_BANG] = ACTIONS(207), - [anon_sym_LT] = ACTIONS(207), - [anon_sym_LT_SLASH] = ACTIONS(207), - [sym_text] = ACTIONS(205), + [sym_attribute_value] = ACTIONS(191), + [anon_sym_SQUOTE] = ACTIONS(193), + [anon_sym_DQUOTE] = ACTIONS(195), }, [60] = { - [sym__implicit_end_tag] = ACTIONS(131), + [sym__implicit_end_tag] = ACTIONS(197), [sym_comment] = ACTIONS(5), - [anon_sym_LT_BANG] = ACTIONS(133), - [anon_sym_LT] = ACTIONS(133), - [anon_sym_LT_SLASH] = ACTIONS(133), - [sym_text] = ACTIONS(131), + [anon_sym_LT_BANG] = ACTIONS(199), + [anon_sym_LT] = ACTIONS(199), + [anon_sym_LT_SLASH] = ACTIONS(199), + [sym_text] = ACTIONS(197), }, [61] = { [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(209), + [ts_builtin_sym_end] = ACTIONS(201), + [anon_sym_LT_BANG] = ACTIONS(203), + [anon_sym_LT] = ACTIONS(203), + [anon_sym_LT_SLASH] = ACTIONS(203), + [sym_text] = ACTIONS(201), }, [62] = { + [sym_attribute] = STATE(62), + [aux_sym_start_tag_repeat1] = STATE(62), + [sym_comment] = ACTIONS(5), + [anon_sym_GT] = ACTIONS(205), + [anon_sym_SLASH_GT] = ACTIONS(205), + [sym_attribute_name] = ACTIONS(207), + }, + [63] = { + [sym_quoted_attribute_value] = STATE(80), + [sym_comment] = ACTIONS(5), + [sym_attribute_value] = ACTIONS(210), + [anon_sym_SQUOTE] = ACTIONS(212), + [anon_sym_DQUOTE] = ACTIONS(214), + }, + [64] = { + [sym_raw_text] = ACTIONS(216), + [sym_comment] = ACTIONS(5), + [anon_sym_LT_SLASH] = ACTIONS(216), + }, + [65] = { + [sym_attribute] = STATE(65), + [aux_sym_start_tag_repeat1] = STATE(65), + [sym_comment] = ACTIONS(5), + [anon_sym_GT] = ACTIONS(205), + [sym_attribute_name] = ACTIONS(218), + }, + [66] = { + [sym_raw_text] = ACTIONS(221), + [sym_comment] = ACTIONS(5), + [anon_sym_LT_SLASH] = ACTIONS(221), + }, + [67] = { + [sym_comment] = ACTIONS(5), + [anon_sym_GT] = ACTIONS(223), + }, + [68] = { + [sym__implicit_end_tag] = ACTIONS(125), + [sym_comment] = ACTIONS(5), + [anon_sym_LT_BANG] = ACTIONS(127), + [anon_sym_LT] = ACTIONS(127), + [anon_sym_LT_SLASH] = ACTIONS(127), + [sym_text] = ACTIONS(125), + }, + [69] = { + [sym_attribute] = STATE(62), + [aux_sym_start_tag_repeat1] = STATE(62), + [sym_comment] = ACTIONS(5), + [anon_sym_GT] = ACTIONS(133), + [anon_sym_SLASH_GT] = ACTIONS(225), + [sym_attribute_name] = ACTIONS(59), + }, + [70] = { + [sym_comment] = ACTIONS(5), + [ts_builtin_sym_end] = ACTIONS(227), + [anon_sym_LT_BANG] = ACTIONS(229), + [anon_sym_LT] = ACTIONS(229), + [anon_sym_LT_SLASH] = ACTIONS(229), + [sym_text] = ACTIONS(227), + }, + [71] = { [sym__implicit_end_tag] = ACTIONS(147), [sym_comment] = ACTIONS(5), [anon_sym_LT_BANG] = ACTIONS(149), @@ -1235,7 +1339,11 @@ static uint16_t ts_parse_table[STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_LT_SLASH] = ACTIONS(149), [sym_text] = ACTIONS(147), }, - [63] = { + [72] = { + [sym_comment] = ACTIONS(5), + [anon_sym_GT] = ACTIONS(231), + }, + [73] = { [sym__implicit_end_tag] = ACTIONS(163), [sym_comment] = ACTIONS(5), [anon_sym_LT_BANG] = ACTIONS(165), @@ -1243,102 +1351,118 @@ static uint16_t ts_parse_table[STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_LT_SLASH] = ACTIONS(165), [sym_text] = ACTIONS(163), }, - [64] = { - [sym_erroneous_end_tag_name] = ACTIONS(73), - [sym_comment] = ACTIONS(5), - }, - [65] = { - [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(211), - [anon_sym_SLASH_GT] = ACTIONS(211), - [sym_attribute_name] = ACTIONS(211), - }, - [66] = { - [sym_comment] = ACTIONS(5), - [anon_sym_SQUOTE] = ACTIONS(213), - [aux_sym_SLASH_LBRACK_CARET_SQUOTE_RBRACK_PLUS_SLASH] = ACTIONS(215), - }, - [67] = { - [sym_comment] = ACTIONS(5), - [anon_sym_DQUOTE] = ACTIONS(213), - [aux_sym_SLASH_LBRACK_CARET_DQUOTE_RBRACK_PLUS_SLASH] = ACTIONS(217), - }, - [68] = { - [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(211), - [sym_attribute_name] = ACTIONS(211), - }, - [69] = { - [sym_comment] = ACTIONS(5), - [anon_sym_SQUOTE] = ACTIONS(219), - [aux_sym_SLASH_LBRACK_CARET_SQUOTE_RBRACK_PLUS_SLASH] = ACTIONS(221), - }, - [70] = { - [sym_comment] = ACTIONS(5), - [anon_sym_DQUOTE] = ACTIONS(219), - [aux_sym_SLASH_LBRACK_CARET_DQUOTE_RBRACK_PLUS_SLASH] = ACTIONS(223), - }, - [71] = { - [sym__implicit_end_tag] = ACTIONS(167), - [sym_comment] = ACTIONS(5), - [anon_sym_LT_BANG] = ACTIONS(169), - [anon_sym_LT] = ACTIONS(169), - [anon_sym_LT_SLASH] = ACTIONS(169), - [sym_text] = ACTIONS(167), - }, - [72] = { - [sym__implicit_end_tag] = ACTIONS(181), - [sym_comment] = ACTIONS(5), - [anon_sym_LT_BANG] = ACTIONS(183), - [anon_sym_LT] = ACTIONS(183), - [anon_sym_LT_SLASH] = ACTIONS(183), - [sym_text] = ACTIONS(181), - }, - [73] = { - [sym__implicit_end_tag] = ACTIONS(205), - [sym_comment] = ACTIONS(5), - [anon_sym_LT_BANG] = ACTIONS(207), - [anon_sym_LT] = ACTIONS(207), - [anon_sym_LT_SLASH] = ACTIONS(207), - [sym_text] = ACTIONS(205), - }, [74] = { + [sym__implicit_end_tag] = ACTIONS(179), [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(225), - [anon_sym_SLASH_GT] = ACTIONS(225), - [sym_attribute_name] = ACTIONS(225), + [anon_sym_LT_BANG] = ACTIONS(181), + [anon_sym_LT] = ACTIONS(181), + [anon_sym_LT_SLASH] = ACTIONS(181), + [sym_text] = ACTIONS(179), }, [75] = { + [sym__implicit_end_tag] = ACTIONS(183), [sym_comment] = ACTIONS(5), - [anon_sym_SQUOTE] = ACTIONS(227), + [anon_sym_LT_BANG] = ACTIONS(185), + [anon_sym_LT] = ACTIONS(185), + [anon_sym_LT_SLASH] = ACTIONS(185), + [sym_text] = ACTIONS(183), }, [76] = { + [sym_erroneous_end_tag_name] = ACTIONS(79), [sym_comment] = ACTIONS(5), - [anon_sym_DQUOTE] = ACTIONS(227), }, [77] = { [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(225), - [sym_attribute_name] = ACTIONS(225), + [anon_sym_GT] = ACTIONS(233), + [anon_sym_SLASH_GT] = ACTIONS(233), + [sym_attribute_name] = ACTIONS(233), }, [78] = { [sym_comment] = ACTIONS(5), - [anon_sym_SQUOTE] = ACTIONS(229), + [anon_sym_SQUOTE] = ACTIONS(235), + [aux_sym_SLASH_LBRACK_CARET_SQUOTE_RBRACK_PLUS_SLASH] = ACTIONS(237), }, [79] = { [sym_comment] = ACTIONS(5), - [anon_sym_DQUOTE] = ACTIONS(229), + [anon_sym_DQUOTE] = ACTIONS(235), + [aux_sym_SLASH_LBRACK_CARET_DQUOTE_RBRACK_PLUS_SLASH] = ACTIONS(239), }, [80] = { [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(231), - [anon_sym_SLASH_GT] = ACTIONS(231), - [sym_attribute_name] = ACTIONS(231), + [anon_sym_GT] = ACTIONS(233), + [sym_attribute_name] = ACTIONS(233), }, [81] = { [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(231), - [sym_attribute_name] = ACTIONS(231), + [anon_sym_SQUOTE] = ACTIONS(241), + [aux_sym_SLASH_LBRACK_CARET_SQUOTE_RBRACK_PLUS_SLASH] = ACTIONS(243), + }, + [82] = { + [sym_comment] = ACTIONS(5), + [anon_sym_DQUOTE] = ACTIONS(241), + [aux_sym_SLASH_LBRACK_CARET_DQUOTE_RBRACK_PLUS_SLASH] = ACTIONS(245), + }, + [83] = { + [sym__implicit_end_tag] = ACTIONS(187), + [sym_comment] = ACTIONS(5), + [anon_sym_LT_BANG] = ACTIONS(189), + [anon_sym_LT] = ACTIONS(189), + [anon_sym_LT_SLASH] = ACTIONS(189), + [sym_text] = ACTIONS(187), + }, + [84] = { + [sym__implicit_end_tag] = ACTIONS(201), + [sym_comment] = ACTIONS(5), + [anon_sym_LT_BANG] = ACTIONS(203), + [anon_sym_LT] = ACTIONS(203), + [anon_sym_LT_SLASH] = ACTIONS(203), + [sym_text] = ACTIONS(201), + }, + [85] = { + [sym__implicit_end_tag] = ACTIONS(227), + [sym_comment] = ACTIONS(5), + [anon_sym_LT_BANG] = ACTIONS(229), + [anon_sym_LT] = ACTIONS(229), + [anon_sym_LT_SLASH] = ACTIONS(229), + [sym_text] = ACTIONS(227), + }, + [86] = { + [sym_comment] = ACTIONS(5), + [anon_sym_GT] = ACTIONS(247), + [anon_sym_SLASH_GT] = ACTIONS(247), + [sym_attribute_name] = ACTIONS(247), + }, + [87] = { + [sym_comment] = ACTIONS(5), + [anon_sym_SQUOTE] = ACTIONS(249), + }, + [88] = { + [sym_comment] = ACTIONS(5), + [anon_sym_DQUOTE] = ACTIONS(249), + }, + [89] = { + [sym_comment] = ACTIONS(5), + [anon_sym_GT] = ACTIONS(247), + [sym_attribute_name] = ACTIONS(247), + }, + [90] = { + [sym_comment] = ACTIONS(5), + [anon_sym_SQUOTE] = ACTIONS(251), + }, + [91] = { + [sym_comment] = ACTIONS(5), + [anon_sym_DQUOTE] = ACTIONS(251), + }, + [92] = { + [sym_comment] = ACTIONS(5), + [anon_sym_GT] = ACTIONS(253), + [anon_sym_SLASH_GT] = ACTIONS(253), + [sym_attribute_name] = ACTIONS(253), + }, + [93] = { + [sym_comment] = ACTIONS(5), + [anon_sym_GT] = ACTIONS(253), + [sym_attribute_name] = ACTIONS(253), }, }; @@ -1351,110 +1475,121 @@ static TSParseActionEntry ts_parse_actions[] = { [9] = {.count = 1, .reusable = false}, SHIFT(2), [11] = {.count = 1, .reusable = false}, SHIFT(3), [13] = {.count = 1, .reusable = false}, SHIFT(4), - [15] = {.count = 1, .reusable = true}, SHIFT(9), - [17] = {.count = 1, .reusable = true}, SHIFT(10), - [19] = {.count = 1, .reusable = true}, SHIFT(11), - [21] = {.count = 1, .reusable = true}, SHIFT(12), - [23] = {.count = 1, .reusable = true}, SHIFT(13), - [25] = {.count = 1, .reusable = true}, ACCEPT_INPUT(), - [27] = {.count = 1, .reusable = true}, SHIFT(14), - [29] = {.count = 1, .reusable = false}, SHIFT(15), - [31] = {.count = 1, .reusable = false}, SHIFT(16), - [33] = {.count = 1, .reusable = false}, SHIFT(17), - [35] = {.count = 1, .reusable = true}, SHIFT(21), - [37] = {.count = 1, .reusable = true}, SHIFT(22), - [39] = {.count = 1, .reusable = true}, SHIFT(23), - [41] = {.count = 1, .reusable = true}, REDUCE(sym_element, 1), - [43] = {.count = 1, .reusable = false}, REDUCE(sym_element, 1), - [45] = {.count = 1, .reusable = true}, REDUCE(sym_fragment, 1), - [47] = {.count = 1, .reusable = true}, SHIFT(25), - [49] = {.count = 1, .reusable = true}, SHIFT(26), - [51] = {.count = 1, .reusable = true}, SHIFT(27), - [53] = {.count = 1, .reusable = true}, SHIFT(28), - [55] = {.count = 1, .reusable = true}, SHIFT(29), - [57] = {.count = 1, .reusable = true}, SHIFT(31), - [59] = {.count = 1, .reusable = true}, SHIFT(32), - [61] = {.count = 1, .reusable = true}, SHIFT(34), - [63] = {.count = 1, .reusable = true}, REDUCE(sym_element, 2), - [65] = {.count = 1, .reusable = false}, REDUCE(sym_element, 2), - [67] = {.count = 1, .reusable = true}, SHIFT(35), - [69] = {.count = 1, .reusable = true}, SHIFT(36), - [71] = {.count = 1, .reusable = true}, SHIFT(37), - [73] = {.count = 1, .reusable = true}, SHIFT(38), - [75] = {.count = 1, .reusable = true}, SHIFT(39), - [77] = {.count = 1, .reusable = false}, SHIFT(40), - [79] = {.count = 1, .reusable = true}, SHIFT(41), - [81] = {.count = 1, .reusable = true}, SHIFT(42), - [83] = {.count = 1, .reusable = true}, SHIFT(43), - [85] = {.count = 1, .reusable = true}, SHIFT(45), - [87] = {.count = 1, .reusable = true}, SHIFT(46), - [89] = {.count = 1, .reusable = true}, REDUCE(sym_raw_element, 2), - [91] = {.count = 1, .reusable = false}, REDUCE(sym_raw_element, 2), - [93] = {.count = 1, .reusable = true}, REDUCE(aux_sym_fragment_repeat1, 2), - [95] = {.count = 2, .reusable = false}, REDUCE(aux_sym_fragment_repeat1, 2), SHIFT_REPEAT(2), - [98] = {.count = 2, .reusable = false}, REDUCE(aux_sym_fragment_repeat1, 2), SHIFT_REPEAT(3), - [101] = {.count = 2, .reusable = false}, REDUCE(aux_sym_fragment_repeat1, 2), SHIFT_REPEAT(4), - [104] = {.count = 2, .reusable = true}, REDUCE(aux_sym_fragment_repeat1, 2), SHIFT_REPEAT(25), - [107] = {.count = 1, .reusable = true}, SHIFT(48), - [109] = {.count = 1, .reusable = true}, REDUCE(sym_start_tag, 3), - [111] = {.count = 1, .reusable = false}, REDUCE(sym_start_tag, 3), - [113] = {.count = 1, .reusable = true}, REDUCE(sym_self_closing_tag, 3), - [115] = {.count = 1, .reusable = false}, REDUCE(sym_self_closing_tag, 3), - [117] = {.count = 1, .reusable = true}, REDUCE(sym_attribute, 1), - [119] = {.count = 1, .reusable = true}, SHIFT(49), - [121] = {.count = 1, .reusable = true}, SHIFT(50), - [123] = {.count = 1, .reusable = true}, SHIFT(51), - [125] = {.count = 1, .reusable = true}, REDUCE(sym__raw_start_tag, 3), - [127] = {.count = 1, .reusable = true}, SHIFT(53), - [129] = {.count = 1, .reusable = true}, SHIFT(54), - [131] = {.count = 1, .reusable = true}, REDUCE(sym_erroneous_end_tag, 3), - [133] = {.count = 1, .reusable = false}, REDUCE(sym_erroneous_end_tag, 3), - [135] = {.count = 1, .reusable = true}, SHIFT(56), - [137] = {.count = 1, .reusable = true}, SHIFT(57), - [139] = {.count = 1, .reusable = true}, SHIFT(59), - [141] = {.count = 1, .reusable = true}, SHIFT(60), - [143] = {.count = 1, .reusable = true}, SHIFT(61), - [145] = {.count = 1, .reusable = true}, SHIFT(62), - [147] = {.count = 1, .reusable = true}, REDUCE(sym_element, 3), - [149] = {.count = 1, .reusable = false}, REDUCE(sym_element, 3), - [151] = {.count = 2, .reusable = false}, REDUCE(aux_sym_fragment_repeat1, 2), SHIFT_REPEAT(15), - [154] = {.count = 2, .reusable = false}, REDUCE(aux_sym_fragment_repeat1, 2), SHIFT_REPEAT(16), - [157] = {.count = 2, .reusable = false}, REDUCE(aux_sym_fragment_repeat1, 2), SHIFT_REPEAT(64), - [160] = {.count = 2, .reusable = true}, REDUCE(aux_sym_fragment_repeat1, 2), SHIFT_REPEAT(46), - [163] = {.count = 1, .reusable = true}, REDUCE(sym_raw_element, 3), - [165] = {.count = 1, .reusable = false}, REDUCE(sym_raw_element, 3), - [167] = {.count = 1, .reusable = true}, REDUCE(sym_doctype, 4), - [169] = {.count = 1, .reusable = false}, REDUCE(sym_doctype, 4), - [171] = {.count = 1, .reusable = true}, SHIFT(65), - [173] = {.count = 1, .reusable = true}, SHIFT(66), - [175] = {.count = 1, .reusable = true}, SHIFT(67), - [177] = {.count = 1, .reusable = true}, REDUCE(sym_start_tag, 4), - [179] = {.count = 1, .reusable = false}, REDUCE(sym_start_tag, 4), - [181] = {.count = 1, .reusable = true}, REDUCE(sym_self_closing_tag, 4), - [183] = {.count = 1, .reusable = false}, REDUCE(sym_self_closing_tag, 4), - [185] = {.count = 1, .reusable = true}, REDUCE(aux_sym_start_tag_repeat1, 2), - [187] = {.count = 2, .reusable = true}, REDUCE(aux_sym_start_tag_repeat1, 2), SHIFT_REPEAT(29), - [190] = {.count = 1, .reusable = true}, SHIFT(68), - [192] = {.count = 1, .reusable = true}, SHIFT(69), - [194] = {.count = 1, .reusable = true}, SHIFT(70), - [196] = {.count = 1, .reusable = true}, REDUCE(sym__raw_start_tag, 4), - [198] = {.count = 2, .reusable = true}, REDUCE(aux_sym_start_tag_repeat1, 2), SHIFT_REPEAT(32), - [201] = {.count = 1, .reusable = true}, SHIFT(71), - [203] = {.count = 1, .reusable = true}, SHIFT(72), - [205] = {.count = 1, .reusable = true}, REDUCE(sym_end_tag, 3), - [207] = {.count = 1, .reusable = false}, REDUCE(sym_end_tag, 3), - [209] = {.count = 1, .reusable = true}, SHIFT(73), - [211] = {.count = 1, .reusable = true}, REDUCE(sym_attribute, 3), - [213] = {.count = 1, .reusable = false}, SHIFT(74), - [215] = {.count = 1, .reusable = true}, SHIFT(75), - [217] = {.count = 1, .reusable = true}, SHIFT(76), - [219] = {.count = 1, .reusable = false}, SHIFT(77), - [221] = {.count = 1, .reusable = true}, SHIFT(78), - [223] = {.count = 1, .reusable = true}, SHIFT(79), - [225] = {.count = 1, .reusable = true}, REDUCE(sym_quoted_attribute_value, 2), - [227] = {.count = 1, .reusable = true}, SHIFT(80), - [229] = {.count = 1, .reusable = true}, SHIFT(81), - [231] = {.count = 1, .reusable = true}, REDUCE(sym_quoted_attribute_value, 3), + [15] = {.count = 1, .reusable = true}, SHIFT(10), + [17] = {.count = 1, .reusable = true}, SHIFT(11), + [19] = {.count = 1, .reusable = true}, SHIFT(12), + [21] = {.count = 1, .reusable = true}, SHIFT(13), + [23] = {.count = 1, .reusable = true}, SHIFT(14), + [25] = {.count = 1, .reusable = true}, SHIFT(15), + [27] = {.count = 1, .reusable = true}, ACCEPT_INPUT(), + [29] = {.count = 1, .reusable = true}, SHIFT(16), + [31] = {.count = 1, .reusable = false}, SHIFT(17), + [33] = {.count = 1, .reusable = false}, SHIFT(18), + [35] = {.count = 1, .reusable = false}, SHIFT(19), + [37] = {.count = 1, .reusable = true}, SHIFT(24), + [39] = {.count = 1, .reusable = true}, SHIFT(25), + [41] = {.count = 1, .reusable = true}, SHIFT(26), + [43] = {.count = 1, .reusable = true}, SHIFT(28), + [45] = {.count = 1, .reusable = true}, REDUCE(sym_element, 1), + [47] = {.count = 1, .reusable = false}, REDUCE(sym_element, 1), + [49] = {.count = 1, .reusable = true}, REDUCE(sym_fragment, 1), + [51] = {.count = 1, .reusable = true}, SHIFT(30), + [53] = {.count = 1, .reusable = true}, SHIFT(31), + [55] = {.count = 1, .reusable = true}, SHIFT(32), + [57] = {.count = 1, .reusable = true}, SHIFT(33), + [59] = {.count = 1, .reusable = true}, SHIFT(34), + [61] = {.count = 1, .reusable = true}, SHIFT(36), + [63] = {.count = 1, .reusable = true}, SHIFT(37), + [65] = {.count = 1, .reusable = true}, SHIFT(39), + [67] = {.count = 1, .reusable = true}, SHIFT(41), + [69] = {.count = 1, .reusable = true}, REDUCE(sym_element, 2), + [71] = {.count = 1, .reusable = false}, REDUCE(sym_element, 2), + [73] = {.count = 1, .reusable = true}, SHIFT(42), + [75] = {.count = 1, .reusable = true}, SHIFT(43), + [77] = {.count = 1, .reusable = true}, SHIFT(44), + [79] = {.count = 1, .reusable = true}, SHIFT(45), + [81] = {.count = 1, .reusable = true}, SHIFT(46), + [83] = {.count = 1, .reusable = false}, SHIFT(47), + [85] = {.count = 1, .reusable = true}, SHIFT(48), + [87] = {.count = 1, .reusable = true}, SHIFT(49), + [89] = {.count = 1, .reusable = true}, SHIFT(50), + [91] = {.count = 1, .reusable = true}, SHIFT(52), + [93] = {.count = 1, .reusable = true}, SHIFT(54), + [95] = {.count = 1, .reusable = true}, SHIFT(55), + [97] = {.count = 1, .reusable = true}, REDUCE(sym_script_element, 2), + [99] = {.count = 1, .reusable = false}, REDUCE(sym_script_element, 2), + [101] = {.count = 1, .reusable = true}, REDUCE(sym_style_element, 2), + [103] = {.count = 1, .reusable = false}, REDUCE(sym_style_element, 2), + [105] = {.count = 1, .reusable = true}, REDUCE(aux_sym_fragment_repeat1, 2), + [107] = {.count = 2, .reusable = false}, REDUCE(aux_sym_fragment_repeat1, 2), SHIFT_REPEAT(2), + [110] = {.count = 2, .reusable = false}, REDUCE(aux_sym_fragment_repeat1, 2), SHIFT_REPEAT(3), + [113] = {.count = 2, .reusable = false}, REDUCE(aux_sym_fragment_repeat1, 2), SHIFT_REPEAT(4), + [116] = {.count = 2, .reusable = true}, REDUCE(aux_sym_fragment_repeat1, 2), SHIFT_REPEAT(30), + [119] = {.count = 1, .reusable = true}, SHIFT(58), + [121] = {.count = 1, .reusable = true}, REDUCE(sym_start_tag, 3), + [123] = {.count = 1, .reusable = false}, REDUCE(sym_start_tag, 3), + [125] = {.count = 1, .reusable = true}, REDUCE(sym_self_closing_tag, 3), + [127] = {.count = 1, .reusable = false}, REDUCE(sym_self_closing_tag, 3), + [129] = {.count = 1, .reusable = true}, REDUCE(sym_attribute, 1), + [131] = {.count = 1, .reusable = true}, SHIFT(59), + [133] = {.count = 1, .reusable = true}, SHIFT(60), + [135] = {.count = 1, .reusable = true}, SHIFT(61), + [137] = {.count = 1, .reusable = true}, REDUCE(sym_script_start_tag, 3), + [139] = {.count = 1, .reusable = true}, SHIFT(63), + [141] = {.count = 1, .reusable = true}, SHIFT(64), + [143] = {.count = 1, .reusable = true}, REDUCE(sym_style_start_tag, 3), + [145] = {.count = 1, .reusable = true}, SHIFT(66), + [147] = {.count = 1, .reusable = true}, REDUCE(sym_erroneous_end_tag, 3), + [149] = {.count = 1, .reusable = false}, REDUCE(sym_erroneous_end_tag, 3), + [151] = {.count = 1, .reusable = true}, SHIFT(67), + [153] = {.count = 1, .reusable = true}, SHIFT(68), + [155] = {.count = 1, .reusable = true}, SHIFT(70), + [157] = {.count = 1, .reusable = true}, SHIFT(71), + [159] = {.count = 1, .reusable = true}, SHIFT(72), + [161] = {.count = 1, .reusable = true}, SHIFT(73), + [163] = {.count = 1, .reusable = true}, REDUCE(sym_element, 3), + [165] = {.count = 1, .reusable = false}, REDUCE(sym_element, 3), + [167] = {.count = 2, .reusable = false}, REDUCE(aux_sym_fragment_repeat1, 2), SHIFT_REPEAT(17), + [170] = {.count = 2, .reusable = false}, REDUCE(aux_sym_fragment_repeat1, 2), SHIFT_REPEAT(18), + [173] = {.count = 2, .reusable = false}, REDUCE(aux_sym_fragment_repeat1, 2), SHIFT_REPEAT(76), + [176] = {.count = 2, .reusable = true}, REDUCE(aux_sym_fragment_repeat1, 2), SHIFT_REPEAT(55), + [179] = {.count = 1, .reusable = true}, REDUCE(sym_script_element, 3), + [181] = {.count = 1, .reusable = false}, REDUCE(sym_script_element, 3), + [183] = {.count = 1, .reusable = true}, REDUCE(sym_style_element, 3), + [185] = {.count = 1, .reusable = false}, REDUCE(sym_style_element, 3), + [187] = {.count = 1, .reusable = true}, REDUCE(sym_doctype, 4), + [189] = {.count = 1, .reusable = false}, REDUCE(sym_doctype, 4), + [191] = {.count = 1, .reusable = true}, SHIFT(77), + [193] = {.count = 1, .reusable = true}, SHIFT(78), + [195] = {.count = 1, .reusable = true}, SHIFT(79), + [197] = {.count = 1, .reusable = true}, REDUCE(sym_start_tag, 4), + [199] = {.count = 1, .reusable = false}, REDUCE(sym_start_tag, 4), + [201] = {.count = 1, .reusable = true}, REDUCE(sym_self_closing_tag, 4), + [203] = {.count = 1, .reusable = false}, REDUCE(sym_self_closing_tag, 4), + [205] = {.count = 1, .reusable = true}, REDUCE(aux_sym_start_tag_repeat1, 2), + [207] = {.count = 2, .reusable = true}, REDUCE(aux_sym_start_tag_repeat1, 2), SHIFT_REPEAT(34), + [210] = {.count = 1, .reusable = true}, SHIFT(80), + [212] = {.count = 1, .reusable = true}, SHIFT(81), + [214] = {.count = 1, .reusable = true}, SHIFT(82), + [216] = {.count = 1, .reusable = true}, REDUCE(sym_script_start_tag, 4), + [218] = {.count = 2, .reusable = true}, REDUCE(aux_sym_start_tag_repeat1, 2), SHIFT_REPEAT(37), + [221] = {.count = 1, .reusable = true}, REDUCE(sym_style_start_tag, 4), + [223] = {.count = 1, .reusable = true}, SHIFT(83), + [225] = {.count = 1, .reusable = true}, SHIFT(84), + [227] = {.count = 1, .reusable = true}, REDUCE(sym_end_tag, 3), + [229] = {.count = 1, .reusable = false}, REDUCE(sym_end_tag, 3), + [231] = {.count = 1, .reusable = true}, SHIFT(85), + [233] = {.count = 1, .reusable = true}, REDUCE(sym_attribute, 3), + [235] = {.count = 1, .reusable = false}, SHIFT(86), + [237] = {.count = 1, .reusable = true}, SHIFT(87), + [239] = {.count = 1, .reusable = true}, SHIFT(88), + [241] = {.count = 1, .reusable = false}, SHIFT(89), + [243] = {.count = 1, .reusable = true}, SHIFT(90), + [245] = {.count = 1, .reusable = true}, SHIFT(91), + [247] = {.count = 1, .reusable = true}, REDUCE(sym_quoted_attribute_value, 2), + [249] = {.count = 1, .reusable = true}, SHIFT(92), + [251] = {.count = 1, .reusable = true}, SHIFT(93), + [253] = {.count = 1, .reusable = true}, REDUCE(sym_quoted_attribute_value, 3), }; void *tree_sitter_html_external_scanner_create(); diff --git a/src/scanner.cc b/src/scanner.cc index 4ea02a6..66018e0 100644 --- a/src/scanner.cc +++ b/src/scanner.cc @@ -13,7 +13,8 @@ using std::string; enum TokenType { START_TAG_NAME, - START_RAW_TAG_NAME, + SCRIPT_START_TAG_NAME, + STYLE_START_TAG_NAME, END_TAG_NAME, ERRONEOUS_END_TAG_NAME, SELF_CLOSING_TAG_DELIMITER, @@ -187,10 +188,16 @@ struct Scanner { if (tag_name.empty()) return false; Tag tag = Tag::for_name(tag_name); tags.push_back(tag); - if (tag.is_raw()) { - lexer->result_symbol = START_RAW_TAG_NAME; - } else { - lexer->result_symbol = START_TAG_NAME; + switch (tag.type) { + case SCRIPT: + lexer->result_symbol = SCRIPT_START_TAG_NAME; + break; + case STYLE: + lexer->result_symbol = STYLE_START_TAG_NAME; + break; + default: + lexer->result_symbol = START_TAG_NAME; + break; } return true; } diff --git a/src/tag.h b/src/tag.h index 22d1e93..b068eca 100644 --- a/src/tag.h +++ b/src/tag.h @@ -329,10 +329,6 @@ struct Tag { return type < END_OF_VOID_TAGS; } - inline bool is_raw() const { - return type == SCRIPT || type == STYLE; - } - inline bool can_contain(const Tag &tag) { TagType child = tag.type;