diff --git a/.travis.yml b/.travis.yml index 98f7a6b..a1691e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ sudo: false node_js: node env: - - CXX=clang + - CXX=clang++ branches: only: diff --git a/appveyor.yml b/appveyor.yml index 9cb5290..b21947b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -13,7 +13,7 @@ install: - npm install test_script: - - npm test + - npm run test-windows build: off 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/package.json b/package.json index 6ae71cb..97045fc 100644 --- a/package.json +++ b/package.json @@ -16,10 +16,20 @@ "nan": "^2.10.0" }, "devDependencies": { - "tree-sitter-cli": "^0.13.8" + "tree-sitter-cli": "^0.14.4" }, "scripts": { "build": "tree-sitter generate && node-gyp build", - "test": "tree-sitter test && tree-sitter parse examples --quiet --time" - } + "test": "tree-sitter test && tree-sitter parse examples/*.html --quiet --time", + "test-windows": "tree-sitter test" + }, + "tree-sitter": [ + { + "name": "HTML", + "textmate-scope": "text.html.basic", + "file-types": ["html"], + "highlights": "src/highlights.json", + "injection-regex": "html" + } + ] } diff --git a/properties/highlights.css b/properties/highlights.css new file mode 100644 index 0000000..4760604 --- /dev/null +++ b/properties/highlights.css @@ -0,0 +1,26 @@ +@import "./injections.css"; + +tag_name { + scope: 'tag'; +} + +/* TODO - highlight as an error? */ +erroneous_end_tag_name { + scope: 'tag'; +} + +doctype { + scope: 'constant'; +} + +attribute_name { + scope: 'attribute'; +} + +attribute_value { + scope: 'string'; +} + +comment { + scope: 'comment'; +} 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..3cc5672 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", @@ -420,4 +487,4 @@ } ], "inline": [] -} \ No newline at end of file +} diff --git a/src/highlights.json b/src/highlights.json new file mode 100644 index 0000000..ef8bd2b --- /dev/null +++ b/src/highlights.json @@ -0,0 +1,424 @@ +{ + "states": [ + { + "id": 0, + "property_set_id": 0, + "transitions": [ + { + "type": "attribute_name", + "named": true, + "state_id": 1 + }, + { + "type": "attribute_value", + "named": true, + "state_id": 2 + }, + { + "type": "comment", + "named": true, + "state_id": 3 + }, + { + "type": "doctype", + "named": true, + "state_id": 4 + }, + { + "type": "erroneous_end_tag_name", + "named": true, + "state_id": 5 + }, + { + "type": "script_element", + "named": true, + "state_id": 6 + }, + { + "type": "style_element", + "named": true, + "state_id": 7 + }, + { + "type": "tag_name", + "named": true, + "state_id": 5 + } + ], + "default_next_state_id": 0 + }, + { + "id": 1, + "property_set_id": 1, + "transitions": [ + { + "type": "attribute_name", + "named": true, + "state_id": 1 + }, + { + "type": "attribute_value", + "named": true, + "state_id": 2 + }, + { + "type": "comment", + "named": true, + "state_id": 3 + }, + { + "type": "doctype", + "named": true, + "state_id": 4 + }, + { + "type": "erroneous_end_tag_name", + "named": true, + "state_id": 5 + }, + { + "type": "script_element", + "named": true, + "state_id": 6 + }, + { + "type": "style_element", + "named": true, + "state_id": 7 + }, + { + "type": "tag_name", + "named": true, + "state_id": 5 + } + ], + "default_next_state_id": 0 + }, + { + "id": 2, + "property_set_id": 2, + "transitions": [ + { + "type": "attribute_name", + "named": true, + "state_id": 1 + }, + { + "type": "attribute_value", + "named": true, + "state_id": 2 + }, + { + "type": "comment", + "named": true, + "state_id": 3 + }, + { + "type": "doctype", + "named": true, + "state_id": 4 + }, + { + "type": "erroneous_end_tag_name", + "named": true, + "state_id": 5 + }, + { + "type": "script_element", + "named": true, + "state_id": 6 + }, + { + "type": "style_element", + "named": true, + "state_id": 7 + }, + { + "type": "tag_name", + "named": true, + "state_id": 5 + } + ], + "default_next_state_id": 0 + }, + { + "id": 3, + "property_set_id": 3, + "transitions": [ + { + "type": "attribute_name", + "named": true, + "state_id": 1 + }, + { + "type": "attribute_value", + "named": true, + "state_id": 2 + }, + { + "type": "comment", + "named": true, + "state_id": 3 + }, + { + "type": "doctype", + "named": true, + "state_id": 4 + }, + { + "type": "erroneous_end_tag_name", + "named": true, + "state_id": 5 + }, + { + "type": "script_element", + "named": true, + "state_id": 6 + }, + { + "type": "style_element", + "named": true, + "state_id": 7 + }, + { + "type": "tag_name", + "named": true, + "state_id": 5 + } + ], + "default_next_state_id": 0 + }, + { + "id": 4, + "property_set_id": 4, + "transitions": [ + { + "type": "attribute_name", + "named": true, + "state_id": 1 + }, + { + "type": "attribute_value", + "named": true, + "state_id": 2 + }, + { + "type": "comment", + "named": true, + "state_id": 3 + }, + { + "type": "doctype", + "named": true, + "state_id": 4 + }, + { + "type": "erroneous_end_tag_name", + "named": true, + "state_id": 5 + }, + { + "type": "script_element", + "named": true, + "state_id": 6 + }, + { + "type": "style_element", + "named": true, + "state_id": 7 + }, + { + "type": "tag_name", + "named": true, + "state_id": 5 + } + ], + "default_next_state_id": 0 + }, + { + "id": 5, + "property_set_id": 5, + "transitions": [ + { + "type": "attribute_name", + "named": true, + "state_id": 1 + }, + { + "type": "attribute_value", + "named": true, + "state_id": 2 + }, + { + "type": "comment", + "named": true, + "state_id": 3 + }, + { + "type": "doctype", + "named": true, + "state_id": 4 + }, + { + "type": "erroneous_end_tag_name", + "named": true, + "state_id": 5 + }, + { + "type": "script_element", + "named": true, + "state_id": 6 + }, + { + "type": "style_element", + "named": true, + "state_id": 7 + }, + { + "type": "tag_name", + "named": true, + "state_id": 5 + } + ], + "default_next_state_id": 0 + }, + { + "id": 6, + "property_set_id": 6, + "transitions": [ + { + "type": "attribute_name", + "named": true, + "state_id": 1 + }, + { + "type": "attribute_value", + "named": true, + "state_id": 2 + }, + { + "type": "comment", + "named": true, + "state_id": 3 + }, + { + "type": "doctype", + "named": true, + "state_id": 4 + }, + { + "type": "erroneous_end_tag_name", + "named": true, + "state_id": 5 + }, + { + "type": "script_element", + "named": true, + "state_id": 6 + }, + { + "type": "style_element", + "named": true, + "state_id": 7 + }, + { + "type": "tag_name", + "named": true, + "state_id": 5 + } + ], + "default_next_state_id": 0 + }, + { + "id": 7, + "property_set_id": 7, + "transitions": [ + { + "type": "attribute_name", + "named": true, + "state_id": 1 + }, + { + "type": "attribute_value", + "named": true, + "state_id": 2 + }, + { + "type": "comment", + "named": true, + "state_id": 3 + }, + { + "type": "doctype", + "named": true, + "state_id": 4 + }, + { + "type": "erroneous_end_tag_name", + "named": true, + "state_id": 5 + }, + { + "type": "script_element", + "named": true, + "state_id": 6 + }, + { + "type": "style_element", + "named": true, + "state_id": 7 + }, + { + "type": "tag_name", + "named": true, + "state_id": 5 + } + ], + "default_next_state_id": 0 + } + ], + "property_sets": [ + {}, + { + "scope": "attribute" + }, + { + "scope": "string" + }, + { + "scope": "comment" + }, + { + "scope": "constant" + }, + { + "scope": "tag" + }, + { + "injection-content": { + "args": [ + { + "args": [], + "name": "this" + }, + 1 + ], + "name": "child" + }, + "injection-language": "javascript" + }, + { + "injection-content": { + "args": [ + { + "args": [], + "name": "this" + }, + 1 + ], + "name": "child" + }, + "injection-language": "css" + } + ] +} \ No newline at end of file diff --git a/src/injections.json b/src/injections.json new file mode 100644 index 0000000..1d47a53 --- /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": 1 + }, + { + "type": "style_element", + "named": true, + "state_id": 2 + } + ], + "default_next_state_id": 0 + }, + { + "id": 1, + "property_set_id": 1, + "transitions": [ + { + "type": "script_element", + "named": true, + "state_id": 1 + }, + { + "type": "style_element", + "named": true, + "state_id": 2 + } + ], + "default_next_state_id": 0 + }, + { + "id": 2, + "property_set_id": 2, + "transitions": [ + { + "type": "script_element", + "named": true, + "state_id": 1 + }, + { + "type": "style_element", + "named": true, + "state_id": 2 + } + ], + "default_next_state_id": 0 + } + ], + "property_sets": [ + {}, + { + "injection-content": { + "args": [ + { + "args": [], + "name": "this" + }, + 1 + ], + "name": "child" + }, + "injection-language": "javascript" + }, + { + "injection-content": { + "args": [ + { + "args": [], + "name": "this" + }, + 1 + ], + "name": "child" + }, + "injection-language": "css" + } + ] +} \ No newline at end of file diff --git a/src/parser.c b/src/parser.c index c650b49..5edd96b 100644 --- a/src/parser.c +++ b/src/parser.c @@ -6,63 +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 MAX_ALIAS_SEQUENCE_LENGTH 0 +#define TOKEN_COUNT 24 +#define EXTERNAL_TOKEN_COUNT 9 +#define MAX_ALIAS_SEQUENCE_LENGTH 4 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, + anon_sym_LT_BANG = 1, + aux_sym_doctype_token1 = 2, + anon_sym_GT = 3, + sym__doctype = 4, + anon_sym_LT = 5, + anon_sym_SLASH_GT = 6, + anon_sym_LT_SLASH = 7, + anon_sym_EQ = 8, + sym_attribute_name = 9, + sym_attribute_value = 10, + anon_sym_SQUOTE = 11, + aux_sym_quoted_attribute_value_token1 = 12, + anon_sym_DQUOTE = 13, + aux_sym_quoted_attribute_value_token2 = 14, + sym_text = 15, + sym__start_tag_name = 16, + sym__script_start_tag_name = 17, + sym__style_start_tag_name = 18, + sym__end_tag_name = 19, + sym_erroneous_end_tag_name = 20, + sym__implicit_end_tag = 21, + sym_raw_text = 22, + sym_comment = 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__end_tag_name] = "tag_name", - [sym_erroneous_end_tag_name] = "erroneous_end_tag_name", - [sym__implicit_end_tag] = "_implicit_end_tag", - [sym_raw_text] = "raw_text", - [sym_comment] = "comment", - [ts_builtin_sym_end] = "END", + [ts_builtin_sym_end] = "end", [anon_sym_LT_BANG] = "]+/", + [aux_sym_doctype_token1] = "doctype_token1", [anon_sym_GT] = ">", [sym__doctype] = "doctype", [anon_sym_LT] = "<", @@ -72,17 +68,27 @@ static const char *ts_symbol_names[] = { [sym_attribute_name] = "attribute_name", [sym_attribute_value] = "attribute_value", [anon_sym_SQUOTE] = "'", - [aux_sym_SLASH_LBRACK_CARET_SQUOTE_RBRACK_PLUS_SLASH] = "attribute_value", + [aux_sym_quoted_attribute_value_token1] = "attribute_value", [anon_sym_DQUOTE] = "\"", - [aux_sym_SLASH_LBRACK_CARET_DQUOTE_RBRACK_PLUS_SLASH] = "attribute_value", + [aux_sym_quoted_attribute_value_token2] = "attribute_value", [sym_text] = "text", + [sym__start_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", + [sym_raw_text] = "raw_text", + [sym_comment] = "comment", [sym_fragment] = "fragment", [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", @@ -93,34 +99,6 @@ static const char *ts_symbol_names[] = { }; static const TSSymbolMetadata ts_symbol_metadata[] = { - [sym__start_tag_name] = { - .visible = true, - .named = true, - }, - [sym__start_raw_tag_name] = { - .visible = true, - .named = true, - }, - [sym__end_tag_name] = { - .visible = true, - .named = true, - }, - [sym_erroneous_end_tag_name] = { - .visible = true, - .named = true, - }, - [sym__implicit_end_tag] = { - .visible = false, - .named = true, - }, - [sym_raw_text] = { - .visible = true, - .named = true, - }, - [sym_comment] = { - .visible = true, - .named = true, - }, [ts_builtin_sym_end] = { .visible = false, .named = true, @@ -129,7 +107,7 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = false, }, - [aux_sym_SLASH_LBRACK_CARET_GT_RBRACK_PLUS_SLASH] = { + [aux_sym_doctype_token1] = { .visible = false, .named = false, }, @@ -169,7 +147,7 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = false, }, - [aux_sym_SLASH_LBRACK_CARET_SQUOTE_RBRACK_PLUS_SLASH] = { + [aux_sym_quoted_attribute_value_token1] = { .visible = true, .named = true, }, @@ -177,7 +155,7 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = false, }, - [aux_sym_SLASH_LBRACK_CARET_DQUOTE_RBRACK_PLUS_SLASH] = { + [aux_sym_quoted_attribute_value_token2] = { .visible = true, .named = true, }, @@ -185,6 +163,38 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = true, }, + [sym__start_tag_name] = { + .visible = true, + .named = true, + }, + [sym__script_start_tag_name] = { + .visible = true, + .named = true, + }, + [sym__style_start_tag_name] = { + .visible = true, + .named = true, + }, + [sym__end_tag_name] = { + .visible = true, + .named = true, + }, + [sym_erroneous_end_tag_name] = { + .visible = true, + .named = true, + }, + [sym__implicit_end_tag] = { + .visible = false, + .named = true, + }, + [sym_raw_text] = { + .visible = true, + .named = true, + }, + [sym_comment] = { + .visible = true, + .named = true, + }, [sym_fragment] = { .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, }, @@ -249,21 +267,21 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { case 0: if (lookahead == 0) ADVANCE(1); - if (lookahead == '\"') + if (lookahead == '"') ADVANCE(2); if (lookahead == '\'') ADVANCE(3); if (lookahead == '/') ADVANCE(4); if (lookahead == '<') - ADVANCE(6); + ADVANCE(5); if (lookahead == '=') - ADVANCE(9); + ADVANCE(6); if (lookahead == '>') - ADVANCE(10); + ADVANCE(7); if (lookahead == 'D' || lookahead == 'd') - ADVANCE(11); + ADVANCE(8); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || @@ -281,35 +299,35 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { END_STATE(); case 4: if (lookahead == '>') - ADVANCE(5); + ADVANCE(9); END_STATE(); case 5: - ACCEPT_TOKEN(anon_sym_SLASH_GT); - END_STATE(); - case 6: ACCEPT_TOKEN(anon_sym_LT); if (lookahead == '!') - ADVANCE(7); + ADVANCE(10); if (lookahead == '/') - ADVANCE(8); + ADVANCE(11); END_STATE(); - case 7: - ACCEPT_TOKEN(anon_sym_LT_BANG); - END_STATE(); - case 8: - ACCEPT_TOKEN(anon_sym_LT_SLASH); - END_STATE(); - case 9: + case 6: ACCEPT_TOKEN(anon_sym_EQ); END_STATE(); - case 10: + case 7: ACCEPT_TOKEN(anon_sym_GT); END_STATE(); - case 11: + case 8: if (lookahead == 'O' || lookahead == 'o') ADVANCE(12); END_STATE(); + case 9: + ACCEPT_TOKEN(anon_sym_SLASH_GT); + END_STATE(); + case 10: + ACCEPT_TOKEN(anon_sym_LT_BANG); + END_STATE(); + case 11: + ACCEPT_TOKEN(anon_sym_LT_SLASH); + END_STATE(); case 12: if (lookahead == 'C' || lookahead == 'c') @@ -342,13 +360,14 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { if (lookahead == 0) ADVANCE(1); if (lookahead == '<') - ADVANCE(6); + ADVANCE(5); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') ADVANCE(19); - if (lookahead != '>') + if (lookahead != 0 && + lookahead != '>') ADVANCE(20); END_STATE(); case 19: @@ -373,7 +392,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { case 21: if (lookahead == 'D' || lookahead == 'd') - ADVANCE(11); + ADVANCE(8); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || @@ -381,8 +400,8 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { SKIP(21); END_STATE(); case 22: - if (lookahead == 0) - ADVANCE(1); + if (lookahead == '<') + ADVANCE(23); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || @@ -390,94 +409,69 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { SKIP(22); END_STATE(); case 23: - if (lookahead == '<') - ADVANCE(24); - if (lookahead == '\t' || - lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') - SKIP(23); + if (lookahead == '/') + ADVANCE(11); END_STATE(); case 24: if (lookahead == '/') - ADVANCE(8); + ADVANCE(4); + if (lookahead == '=') + ADVANCE(6); + if (lookahead == '>') + ADVANCE(7); + if (lookahead == '\t' || + lookahead == '\n' || + lookahead == '\r' || + lookahead == ' ') + SKIP(24); + if (lookahead != 0 && + lookahead != '"' && + lookahead != '\'' && + lookahead != '<') + ADVANCE(25); END_STATE(); case 25: - if (lookahead == '\t' || - lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') - ADVANCE(26); - if (lookahead != 0 && - lookahead != '>') - ADVANCE(27); - END_STATE(); - case 26: - ACCEPT_TOKEN(aux_sym_SLASH_LBRACK_CARET_GT_RBRACK_PLUS_SLASH); - if (lookahead == '\t' || - lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') - ADVANCE(26); - if (lookahead != 0 && - lookahead != '>') - ADVANCE(27); - END_STATE(); - case 27: - ACCEPT_TOKEN(aux_sym_SLASH_LBRACK_CARET_GT_RBRACK_PLUS_SLASH); - if (lookahead != 0 && - lookahead != '>') - ADVANCE(27); - END_STATE(); - case 28: - if (lookahead == '/') - ADVANCE(4); - if (lookahead == '>') - ADVANCE(10); - if (lookahead == '\t' || - lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') - SKIP(28); - if (lookahead != 0 && - lookahead != '\"' && - lookahead != '\'' && - (lookahead < '<' || lookahead > '>')) - ADVANCE(29); - END_STATE(); - case 29: ACCEPT_TOKEN(sym_attribute_name); if (lookahead != 0 && lookahead != '\t' && lookahead != '\n' && lookahead != '\r' && lookahead != ' ' && - lookahead != '\"' && + lookahead != '"' && lookahead != '\'' && lookahead != '/' && - (lookahead < '<' || lookahead > '>')) - ADVANCE(29); + (lookahead < '<' || '>' < lookahead)) + ADVANCE(25); END_STATE(); - case 30: - if (lookahead == '/') - ADVANCE(4); - if (lookahead == '=') - ADVANCE(9); - if (lookahead == '>') - ADVANCE(10); + case 26: if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') - SKIP(30); + ADVANCE(27); if (lookahead != 0 && - lookahead != '\"' && - lookahead != '\'' && - (lookahead < '<' || lookahead > '>')) - ADVANCE(29); + lookahead != '>') + ADVANCE(28); END_STATE(); - case 31: - if (lookahead == '\"') + case 27: + ACCEPT_TOKEN(aux_sym_doctype_token1); + if (lookahead == '\t' || + lookahead == '\n' || + lookahead == '\r' || + lookahead == ' ') + ADVANCE(27); + if (lookahead != 0 && + lookahead != '>') + ADVANCE(28); + END_STATE(); + case 28: + ACCEPT_TOKEN(aux_sym_doctype_token1); + if (lookahead != 0 && + lookahead != '>') + ADVANCE(28); + END_STATE(); + case 29: + if (lookahead == '"') ADVANCE(2); if (lookahead == '\'') ADVANCE(3); @@ -485,96 +479,78 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead == '\n' || lookahead == '\r' || lookahead == ' ') - SKIP(31); + SKIP(29); if (lookahead != 0 && - (lookahead < '<' || lookahead > '>')) - ADVANCE(32); + (lookahead < '<' || '>' < lookahead)) + ADVANCE(30); END_STATE(); - case 32: + case 30: ACCEPT_TOKEN(sym_attribute_value); if (lookahead != 0 && lookahead != '\t' && lookahead != '\n' && lookahead != '\r' && lookahead != ' ' && - lookahead != '\"' && + lookahead != '"' && lookahead != '\'' && - (lookahead < '<' || lookahead > '>')) + (lookahead < '<' || '>' < lookahead)) + ADVANCE(30); + END_STATE(); + case 31: + if (lookahead == '"') + ADVANCE(2); + if (lookahead == '\t' || + lookahead == '\n' || + lookahead == '\r' || + lookahead == ' ') ADVANCE(32); + if (lookahead != 0) + ADVANCE(33); + END_STATE(); + case 32: + ACCEPT_TOKEN(aux_sym_quoted_attribute_value_token2); + if (lookahead == '\t' || + lookahead == '\n' || + lookahead == '\r' || + lookahead == ' ') + ADVANCE(32); + if (lookahead != 0 && + lookahead != '"') + ADVANCE(33); END_STATE(); case 33: - if (lookahead == '\'') - ADVANCE(3); - if (lookahead == '\t' || - lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') - ADVANCE(34); - if (lookahead != 0) - ADVANCE(35); + ACCEPT_TOKEN(aux_sym_quoted_attribute_value_token2); + if (lookahead != 0 && + lookahead != '"') + ADVANCE(33); END_STATE(); case 34: - ACCEPT_TOKEN(aux_sym_SLASH_LBRACK_CARET_SQUOTE_RBRACK_PLUS_SLASH); - if (lookahead == '\t' || - lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') - ADVANCE(34); - if (lookahead != 0 && - lookahead != '\'') - ADVANCE(35); - END_STATE(); - case 35: - ACCEPT_TOKEN(aux_sym_SLASH_LBRACK_CARET_SQUOTE_RBRACK_PLUS_SLASH); - if (lookahead != 0 && - lookahead != '\'') - ADVANCE(35); - END_STATE(); - case 36: - if (lookahead == '\"') - ADVANCE(2); - if (lookahead == '\t' || - lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') - ADVANCE(37); - if (lookahead != 0) - ADVANCE(38); - END_STATE(); - case 37: - ACCEPT_TOKEN(aux_sym_SLASH_LBRACK_CARET_DQUOTE_RBRACK_PLUS_SLASH); - if (lookahead == '\t' || - lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') - ADVANCE(37); - if (lookahead != 0 && - lookahead != '\"') - ADVANCE(38); - END_STATE(); - case 38: - ACCEPT_TOKEN(aux_sym_SLASH_LBRACK_CARET_DQUOTE_RBRACK_PLUS_SLASH); - if (lookahead != 0 && - lookahead != '\"') - ADVANCE(38); - END_STATE(); - case 39: if (lookahead == '\'') ADVANCE(3); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') - SKIP(39); + ADVANCE(35); + if (lookahead != 0) + ADVANCE(36); END_STATE(); - case 40: - if (lookahead == '\"') - ADVANCE(2); + case 35: + ACCEPT_TOKEN(aux_sym_quoted_attribute_value_token1); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') - SKIP(40); + ADVANCE(35); + if (lookahead != 0 && + lookahead != '\'') + ADVANCE(36); + END_STATE(); + case 36: + ACCEPT_TOKEN(aux_sym_quoted_attribute_value_token1); + if (lookahead != 0 && + lookahead != '\'') + ADVANCE(36); END_STATE(); default: return false; @@ -584,102 +560,116 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { static TSLexMode ts_lex_modes[STATE_COUNT] = { [0] = {.lex_state = 0, .external_lex_state = 1}, [1] = {.lex_state = 18, .external_lex_state = 2}, - [2] = {.lex_state = 21, .external_lex_state = 2}, - [3] = {.lex_state = 22, .external_lex_state = 3}, - [4] = {.lex_state = 22, .external_lex_state = 4}, - [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}, - [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}, - [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}, - [20] = {.lex_state = 18, .external_lex_state = 5}, + [2] = {.lex_state = 0, .external_lex_state = 3}, + [3] = {.lex_state = 0, .external_lex_state = 4}, + [4] = {.lex_state = 21, .external_lex_state = 2}, + [5] = {.lex_state = 18, .external_lex_state = 2}, + [6] = {.lex_state = 18, .external_lex_state = 2}, + [7] = {.lex_state = 0, .external_lex_state = 2}, + [8] = {.lex_state = 18, .external_lex_state = 5}, + [9] = {.lex_state = 22, .external_lex_state = 6}, + [10] = {.lex_state = 22, .external_lex_state = 6}, + [11] = {.lex_state = 24, .external_lex_state = 7}, + [12] = {.lex_state = 24, .external_lex_state = 2}, + [13] = {.lex_state = 24, .external_lex_state = 2}, + [14] = {.lex_state = 24, .external_lex_state = 2}, + [15] = {.lex_state = 26, .external_lex_state = 2}, + [16] = {.lex_state = 18, .external_lex_state = 2}, + [17] = {.lex_state = 0, .external_lex_state = 3}, + [18] = {.lex_state = 0, .external_lex_state = 8}, + [19] = {.lex_state = 21, .external_lex_state = 2}, + [20] = {.lex_state = 18, .external_lex_state = 2}, [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}, + [22] = {.lex_state = 18, .external_lex_state = 5}, + [23] = {.lex_state = 18, .external_lex_state = 5}, + [24] = {.lex_state = 22, .external_lex_state = 6}, + [25] = {.lex_state = 22, .external_lex_state = 6}, + [26] = {.lex_state = 0, .external_lex_state = 9}, + [27] = {.lex_state = 22, .external_lex_state = 2}, [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}, - [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}, - [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}, + [29] = {.lex_state = 22, .external_lex_state = 2}, + [30] = {.lex_state = 18, .external_lex_state = 2}, + [31] = {.lex_state = 24, .external_lex_state = 7}, + [32] = {.lex_state = 18, .external_lex_state = 2}, + [33] = {.lex_state = 18, .external_lex_state = 5}, + [34] = {.lex_state = 24, .external_lex_state = 7}, + [35] = {.lex_state = 24, .external_lex_state = 2}, + [36] = {.lex_state = 22, .external_lex_state = 6}, + [37] = {.lex_state = 24, .external_lex_state = 2}, + [38] = {.lex_state = 22, .external_lex_state = 6}, + [39] = {.lex_state = 24, .external_lex_state = 2}, + [40] = {.lex_state = 18, .external_lex_state = 2}, + [41] = {.lex_state = 24, .external_lex_state = 2}, + [42] = {.lex_state = 24, .external_lex_state = 7}, + [43] = {.lex_state = 24, .external_lex_state = 2}, + [44] = {.lex_state = 24, .external_lex_state = 2}, + [45] = {.lex_state = 26, .external_lex_state = 2}, + [46] = {.lex_state = 18, .external_lex_state = 2}, + [47] = {.lex_state = 18, .external_lex_state = 5}, + [48] = {.lex_state = 0, .external_lex_state = 8}, + [49] = {.lex_state = 18, .external_lex_state = 5}, [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}, + [51] = {.lex_state = 0, .external_lex_state = 9}, + [52] = {.lex_state = 22, .external_lex_state = 2}, + [53] = {.lex_state = 18, .external_lex_state = 5}, + [54] = {.lex_state = 22, .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 = 29, .external_lex_state = 2}, [59] = {.lex_state = 18, .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}, - [71] = {.lex_state = 18, .external_lex_state = 5}, - [72] = {.lex_state = 18, .external_lex_state = 5}, - [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}, + [61] = {.lex_state = 24, .external_lex_state = 7}, + [62] = {.lex_state = 29, .external_lex_state = 2}, + [63] = {.lex_state = 22, .external_lex_state = 6}, + [64] = {.lex_state = 24, .external_lex_state = 2}, + [65] = {.lex_state = 22, .external_lex_state = 6}, + [66] = {.lex_state = 18, .external_lex_state = 2}, + [67] = {.lex_state = 18, .external_lex_state = 5}, + [68] = {.lex_state = 24, .external_lex_state = 7}, + [69] = {.lex_state = 18, .external_lex_state = 5}, + [70] = {.lex_state = 18, .external_lex_state = 2}, + [71] = {.lex_state = 24, .external_lex_state = 2}, + [72] = {.lex_state = 0, .external_lex_state = 4}, + [73] = {.lex_state = 24, .external_lex_state = 2}, + [74] = {.lex_state = 18, .external_lex_state = 5}, + [75] = {.lex_state = 18, .external_lex_state = 5}, + [76] = {.lex_state = 18, .external_lex_state = 5}, + [77] = {.lex_state = 31, .external_lex_state = 2}, + [78] = {.lex_state = 24, .external_lex_state = 7}, + [79] = {.lex_state = 34, .external_lex_state = 2}, + [80] = {.lex_state = 31, .external_lex_state = 2}, + [81] = {.lex_state = 24, .external_lex_state = 2}, + [82] = {.lex_state = 34, .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 = 24, .external_lex_state = 7}, + [87] = {.lex_state = 29, .external_lex_state = 2}, + [88] = {.lex_state = 29, .external_lex_state = 2}, + [89] = {.lex_state = 24, .external_lex_state = 2}, + [90] = {.lex_state = 29, .external_lex_state = 2}, + [91] = {.lex_state = 29, .external_lex_state = 2}, + [92] = {.lex_state = 24, .external_lex_state = 7}, + [93] = {.lex_state = 24, .external_lex_state = 2}, }; enum { - ts_external_token__start_tag_name, - ts_external_token__start_raw_tag_name, - ts_external_token__end_tag_name, - ts_external_token_erroneous_end_tag_name, - ts_external_token_SLASH_GT, - ts_external_token__implicit_end_tag, - ts_external_token_raw_text, - ts_external_token_comment, + ts_external_token__start_tag_name = 0, + ts_external_token__script_start_tag_name = 1, + ts_external_token__style_start_tag_name = 2, + ts_external_token__end_tag_name = 3, + ts_external_token_erroneous_end_tag_name = 4, + ts_external_token_SLASH_GT = 5, + ts_external_token__implicit_end_tag = 6, + ts_external_token_raw_text = 7, + ts_external_token_comment = 8, }; 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,770 +681,879 @@ 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__end_tag_name] = true, - [ts_external_token_erroneous_end_tag_name] = true, - [ts_external_token_SLASH_GT] = true, - [ts_external_token__implicit_end_tag] = true, [ts_external_token_raw_text] = true, + [ts_external_token_erroneous_end_tag_name] = true, + [ts_external_token__script_start_tag_name] = true, [ts_external_token_comment] = true, + [ts_external_token_SLASH_GT] = true, + [ts_external_token__style_start_tag_name] = true, + [ts_external_token__implicit_end_tag] = true, + [ts_external_token__end_tag_name] = true, }, [2] = { [ts_external_token_comment] = true, }, [3] = { [ts_external_token__start_tag_name] = true, - [ts_external_token__start_raw_tag_name] = true, [ts_external_token_comment] = true, + [ts_external_token__style_start_tag_name] = true, + [ts_external_token__script_start_tag_name] = true, }, [4] = { [ts_external_token_erroneous_end_tag_name] = true, [ts_external_token_comment] = true, }, [5] = { - [ts_external_token__implicit_end_tag] = true, [ts_external_token_comment] = true, + [ts_external_token__implicit_end_tag] = true, }, [6] = { - [ts_external_token_raw_text] = true, [ts_external_token_comment] = true, + [ts_external_token_raw_text] = true, }, [7] = { - [ts_external_token_SLASH_GT] = true, [ts_external_token_comment] = true, + [ts_external_token_SLASH_GT] = true, }, [8] = { - [ts_external_token__end_tag_name] = true, [ts_external_token_erroneous_end_tag_name] = true, [ts_external_token_comment] = true, + [ts_external_token__end_tag_name] = true, }, [9] = { - [ts_external_token__end_tag_name] = true, [ts_external_token_comment] = true, + [ts_external_token__end_tag_name] = true, }, }; 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__end_tag_name] = ACTIONS(1), - [sym_erroneous_end_tag_name] = ACTIONS(1), - [sym__implicit_end_tag] = ACTIONS(1), - [sym_raw_text] = ACTIONS(1), - [sym_comment] = ACTIONS(1), - [ts_builtin_sym_end] = ACTIONS(1), - [anon_sym_LT_BANG] = ACTIONS(1), - [anon_sym_GT] = ACTIONS(1), [sym__doctype] = ACTIONS(1), - [anon_sym_LT] = ACTIONS(3), + [anon_sym_LT_BANG] = ACTIONS(1), [anon_sym_SLASH_GT] = ACTIONS(1), - [anon_sym_LT_SLASH] = ACTIONS(1), + [sym_comment] = ACTIONS(3), + [sym__style_start_tag_name] = ACTIONS(1), + [anon_sym_GT] = ACTIONS(1), [anon_sym_EQ] = ACTIONS(1), + [anon_sym_LT] = ACTIONS(1), + [ts_builtin_sym_end] = ACTIONS(1), + [sym_raw_text] = ACTIONS(1), + [sym_erroneous_end_tag_name] = ACTIONS(1), + [sym__script_start_tag_name] = ACTIONS(1), [anon_sym_SQUOTE] = ACTIONS(1), [anon_sym_DQUOTE] = ACTIONS(1), + [anon_sym_LT_SLASH] = ACTIONS(1), + [sym__implicit_end_tag] = ACTIONS(1), + [sym__end_tag_name] = ACTIONS(1), }, [1] = { - [sym_fragment] = STATE(5), - [sym_doctype] = STATE(9), - [sym__node] = STATE(9), - [sym_element] = STATE(9), - [sym_raw_element] = STATE(9), - [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_comment] = ACTIONS(5), + [aux_sym_fragment_repeat1] = STATE(5), + [sym_element] = STATE(5), + [sym_script_element] = STATE(5), + [sym_self_closing_tag] = STATE(6), + [sym_fragment] = STATE(7), + [sym_style_element] = STATE(5), + [sym_start_tag] = STATE(8), + [sym_erroneous_end_tag] = STATE(5), + [sym_doctype] = STATE(5), + [sym__node] = STATE(5), + [sym_script_start_tag] = STATE(9), + [sym_style_start_tag] = STATE(10), + [anon_sym_LT] = ACTIONS(5), + [sym_comment] = ACTIONS(3), [ts_builtin_sym_end] = ACTIONS(7), - [anon_sym_LT_BANG] = ACTIONS(9), - [anon_sym_LT] = ACTIONS(11), - [anon_sym_LT_SLASH] = ACTIONS(13), - [sym_text] = ACTIONS(15), + [sym_text] = ACTIONS(9), + [anon_sym_LT_SLASH] = ACTIONS(11), + [anon_sym_LT_BANG] = ACTIONS(13), }, [2] = { - [sym_comment] = ACTIONS(5), - [sym__doctype] = ACTIONS(17), + [sym__start_tag_name] = ACTIONS(15), + [sym_comment] = ACTIONS(3), + [sym__style_start_tag_name] = ACTIONS(17), + [sym__script_start_tag_name] = ACTIONS(19), }, [3] = { - [sym__start_tag_name] = ACTIONS(19), - [sym__start_raw_tag_name] = ACTIONS(21), - [sym_comment] = ACTIONS(5), + [sym_erroneous_end_tag_name] = ACTIONS(21), + [sym_comment] = ACTIONS(3), }, [4] = { - [sym_erroneous_end_tag_name] = ACTIONS(23), - [sym_comment] = ACTIONS(5), + [sym_comment] = ACTIONS(3), + [sym__doctype] = ACTIONS(23), }, [5] = { - [sym_comment] = ACTIONS(5), + [aux_sym_fragment_repeat1] = STATE(16), + [sym_element] = STATE(16), + [sym_script_element] = STATE(16), + [sym_self_closing_tag] = STATE(6), + [sym_style_element] = STATE(16), + [sym_start_tag] = STATE(8), + [sym_erroneous_end_tag] = STATE(16), + [sym_doctype] = STATE(16), + [sym__node] = STATE(16), + [sym_script_start_tag] = STATE(9), + [sym_style_start_tag] = STATE(10), + [anon_sym_LT] = ACTIONS(5), + [sym_comment] = ACTIONS(3), [ts_builtin_sym_end] = ACTIONS(25), + [sym_text] = ACTIONS(27), + [anon_sym_LT_SLASH] = ACTIONS(11), + [anon_sym_LT_BANG] = ACTIONS(13), }, [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_comment] = ACTIONS(5), + [anon_sym_LT] = ACTIONS(29), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(29), + [sym_text] = ACTIONS(31), [anon_sym_LT_BANG] = ACTIONS(29), - [anon_sym_LT] = ACTIONS(31), - [anon_sym_LT_SLASH] = ACTIONS(33), - [sym_text] = ACTIONS(35), + [ts_builtin_sym_end] = ACTIONS(31), }, [7] = { - [sym_end_tag] = STATE(24), - [sym_raw_text] = ACTIONS(37), - [sym_comment] = ACTIONS(5), - [anon_sym_LT_SLASH] = ACTIONS(39), + [sym_comment] = ACTIONS(3), + [ts_builtin_sym_end] = ACTIONS(33), }, [8] = { - [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), + [aux_sym_fragment_repeat1] = STATE(21), + [sym_element] = STATE(21), + [sym_script_element] = STATE(21), + [sym_self_closing_tag] = STATE(22), + [sym_end_tag] = STATE(20), + [sym_style_element] = STATE(21), + [sym_start_tag] = STATE(23), + [sym_erroneous_end_tag] = STATE(21), + [sym_doctype] = STATE(21), + [sym__node] = STATE(21), + [sym_script_start_tag] = STATE(24), + [sym_style_start_tag] = STATE(25), + [anon_sym_LT] = ACTIONS(35), + [sym_comment] = ACTIONS(3), + [sym_text] = ACTIONS(37), + [anon_sym_LT_SLASH] = ACTIONS(39), + [anon_sym_LT_BANG] = ACTIONS(41), + [sym__implicit_end_tag] = ACTIONS(43), }, [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(9), - [anon_sym_LT] = ACTIONS(11), - [anon_sym_LT_SLASH] = ACTIONS(13), - [sym_text] = ACTIONS(47), + [sym_end_tag] = STATE(28), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(45), + [sym_raw_text] = ACTIONS(47), }, [10] = { - [sym_comment] = ACTIONS(5), - [aux_sym_SLASH_LBRACK_CARET_GT_RBRACK_PLUS_SLASH] = ACTIONS(49), + [sym_end_tag] = STATE(30), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(45), + [sym_raw_text] = ACTIONS(49), }, [11] = { - [sym_attribute] = STATE(30), - [aux_sym_start_tag_repeat1] = STATE(30), - [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(51), + [aux_sym_start_tag_repeat1] = STATE(34), + [sym_attribute] = STATE(34), + [sym_comment] = ACTIONS(3), + [sym_attribute_name] = ACTIONS(51), [anon_sym_SLASH_GT] = ACTIONS(53), - [sym_attribute_name] = ACTIONS(55), + [anon_sym_GT] = ACTIONS(55), }, [12] = { - [sym_attribute] = STATE(33), - [aux_sym_start_tag_repeat1] = STATE(33), - [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(57), - [sym_attribute_name] = ACTIONS(59), + [aux_sym_start_tag_repeat1] = STATE(37), + [sym_attribute] = STATE(37), + [sym_attribute_name] = ACTIONS(57), + [sym_comment] = ACTIONS(3), + [anon_sym_GT] = ACTIONS(59), }, [13] = { - [sym_comment] = ACTIONS(5), + [aux_sym_start_tag_repeat1] = STATE(39), + [sym_attribute] = STATE(39), + [sym_attribute_name] = ACTIONS(57), + [sym_comment] = ACTIONS(3), [anon_sym_GT] = ACTIONS(61), }, [14] = { - [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), + [sym_comment] = ACTIONS(3), + [anon_sym_GT] = ACTIONS(63), }, [15] = { - [sym_comment] = ACTIONS(5), - [sym__doctype] = ACTIONS(67), + [sym_comment] = ACTIONS(3), + [aux_sym_doctype_token1] = ACTIONS(65), }, [16] = { - [sym__start_tag_name] = ACTIONS(69), - [sym__start_raw_tag_name] = ACTIONS(21), - [sym_comment] = ACTIONS(5), + [aux_sym_fragment_repeat1] = STATE(16), + [sym_element] = STATE(16), + [sym_script_element] = STATE(16), + [sym_self_closing_tag] = STATE(6), + [sym_style_element] = STATE(16), + [sym_start_tag] = STATE(8), + [sym_erroneous_end_tag] = STATE(16), + [sym_doctype] = STATE(16), + [sym__node] = STATE(16), + [sym_script_start_tag] = STATE(9), + [sym_style_start_tag] = STATE(10), + [anon_sym_LT] = ACTIONS(67), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(70), + [sym_text] = ACTIONS(73), + [anon_sym_LT_BANG] = ACTIONS(76), + [ts_builtin_sym_end] = ACTIONS(79), }, [17] = { - [sym__end_tag_name] = ACTIONS(71), - [sym_erroneous_end_tag_name] = ACTIONS(73), - [sym_comment] = ACTIONS(5), + [sym__start_tag_name] = ACTIONS(81), + [sym_comment] = ACTIONS(3), + [sym__style_start_tag_name] = ACTIONS(17), + [sym__script_start_tag_name] = ACTIONS(19), }, [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_comment] = ACTIONS(5), - [anon_sym_LT_BANG] = ACTIONS(29), - [anon_sym_LT] = ACTIONS(31), - [anon_sym_LT_SLASH] = ACTIONS(77), - [sym_text] = ACTIONS(79), + [sym_erroneous_end_tag_name] = ACTIONS(83), + [sym_comment] = ACTIONS(3), + [sym__end_tag_name] = ACTIONS(85), }, [19] = { - [sym_end_tag] = STATE(44), - [sym_raw_text] = ACTIONS(81), - [sym_comment] = ACTIONS(5), - [anon_sym_LT_SLASH] = ACTIONS(83), + [sym_comment] = ACTIONS(3), + [sym__doctype] = ACTIONS(87), }, [20] = { - [sym__implicit_end_tag] = ACTIONS(41), - [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] = ACTIONS(89), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(89), + [sym_text] = ACTIONS(91), + [anon_sym_LT_BANG] = ACTIONS(89), + [ts_builtin_sym_end] = ACTIONS(91), }, [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_comment] = ACTIONS(5), - [anon_sym_LT_BANG] = ACTIONS(29), - [anon_sym_LT] = ACTIONS(31), - [anon_sym_LT_SLASH] = ACTIONS(33), - [sym_text] = ACTIONS(87), + [aux_sym_fragment_repeat1] = STATE(47), + [sym_element] = STATE(47), + [sym_script_element] = STATE(47), + [sym_self_closing_tag] = STATE(22), + [sym_end_tag] = STATE(46), + [sym_style_element] = STATE(47), + [sym_start_tag] = STATE(23), + [sym_erroneous_end_tag] = STATE(47), + [sym_doctype] = STATE(47), + [sym__node] = STATE(47), + [sym_script_start_tag] = STATE(24), + [sym_style_start_tag] = STATE(25), + [anon_sym_LT] = ACTIONS(35), + [sym_comment] = ACTIONS(3), + [sym_text] = ACTIONS(93), + [anon_sym_LT_SLASH] = ACTIONS(39), + [anon_sym_LT_BANG] = ACTIONS(41), + [sym__implicit_end_tag] = ACTIONS(95), }, [22] = { - [sym_end_tag] = STATE(47), - [sym_comment] = ACTIONS(5), - [anon_sym_LT_SLASH] = ACTIONS(39), + [anon_sym_LT] = ACTIONS(29), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(29), + [sym_text] = ACTIONS(31), + [anon_sym_LT_BANG] = ACTIONS(29), + [sym__implicit_end_tag] = ACTIONS(31), }, [23] = { - [sym__end_tag_name] = ACTIONS(71), - [sym_comment] = ACTIONS(5), + [aux_sym_fragment_repeat1] = STATE(50), + [sym_element] = STATE(50), + [sym_script_element] = STATE(50), + [sym_self_closing_tag] = STATE(22), + [sym_end_tag] = STATE(49), + [sym_style_element] = STATE(50), + [sym_start_tag] = STATE(23), + [sym_erroneous_end_tag] = STATE(50), + [sym_doctype] = STATE(50), + [sym__node] = STATE(50), + [sym_script_start_tag] = STATE(24), + [sym_style_start_tag] = STATE(25), + [anon_sym_LT] = ACTIONS(35), + [sym_comment] = ACTIONS(3), + [sym_text] = ACTIONS(97), + [anon_sym_LT_SLASH] = ACTIONS(99), + [anon_sym_LT_BANG] = ACTIONS(41), + [sym__implicit_end_tag] = ACTIONS(101), }, [24] = { - [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), + [sym_end_tag] = STATE(53), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(103), + [sym_raw_text] = ACTIONS(105), }, [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_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), + [sym_end_tag] = STATE(55), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(103), + [sym_raw_text] = ACTIONS(107), }, [26] = { - [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(107), + [sym_comment] = ACTIONS(3), + [sym__end_tag_name] = ACTIONS(85), }, [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), + [sym_end_tag] = STATE(56), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(45), }, [28] = { - [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] = ACTIONS(109), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(109), + [sym_text] = ACTIONS(111), + [anon_sym_LT_BANG] = ACTIONS(109), + [ts_builtin_sym_end] = ACTIONS(111), }, [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), + [sym_end_tag] = STATE(57), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(45), }, [30] = { - [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(123), - [sym_attribute_name] = ACTIONS(55), + [anon_sym_LT] = ACTIONS(113), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(113), + [sym_text] = ACTIONS(115), + [anon_sym_LT_BANG] = ACTIONS(113), + [ts_builtin_sym_end] = ACTIONS(115), }, [31] = { - [sym_raw_text] = ACTIONS(125), - [sym_comment] = ACTIONS(5), - [anon_sym_LT_SLASH] = ACTIONS(125), + [sym_comment] = ACTIONS(3), + [sym_attribute_name] = ACTIONS(117), + [anon_sym_SLASH_GT] = ACTIONS(117), + [anon_sym_GT] = ACTIONS(117), + [anon_sym_EQ] = ACTIONS(119), }, [32] = { - [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(117), - [anon_sym_EQ] = ACTIONS(127), - [sym_attribute_name] = ACTIONS(117), + [anon_sym_LT] = ACTIONS(121), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(121), + [sym_text] = ACTIONS(123), + [anon_sym_LT_BANG] = ACTIONS(121), + [ts_builtin_sym_end] = ACTIONS(123), }, [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), + [anon_sym_LT] = ACTIONS(125), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(125), + [sym_text] = ACTIONS(127), + [anon_sym_LT_BANG] = ACTIONS(125), + [sym__implicit_end_tag] = ACTIONS(127), }, [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), + [aux_sym_start_tag_repeat1] = STATE(61), + [sym_attribute] = STATE(61), + [sym_comment] = ACTIONS(3), + [sym_attribute_name] = ACTIONS(51), + [anon_sym_SLASH_GT] = ACTIONS(129), + [anon_sym_GT] = ACTIONS(131), }, [35] = { - [sym_comment] = ACTIONS(5), - [aux_sym_SLASH_LBRACK_CARET_GT_RBRACK_PLUS_SLASH] = ACTIONS(135), + [sym_comment] = ACTIONS(3), + [sym_attribute_name] = ACTIONS(117), + [anon_sym_GT] = ACTIONS(117), + [anon_sym_EQ] = ACTIONS(133), }, [36] = { - [sym_attribute] = STATE(58), - [aux_sym_start_tag_repeat1] = STATE(58), - [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(51), - [anon_sym_SLASH_GT] = ACTIONS(137), - [sym_attribute_name] = ACTIONS(55), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(135), + [sym_raw_text] = ACTIONS(135), }, [37] = { - [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(139), + [aux_sym_start_tag_repeat1] = STATE(64), + [sym_attribute] = STATE(64), + [sym_attribute_name] = ACTIONS(57), + [sym_comment] = ACTIONS(3), + [anon_sym_GT] = ACTIONS(137), }, [38] = { - [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(141), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(139), + [sym_raw_text] = ACTIONS(139), }, [39] = { - [sym__implicit_end_tag] = ACTIONS(63), - [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), + [aux_sym_start_tag_repeat1] = STATE(64), + [sym_attribute] = STATE(64), + [sym_attribute_name] = ACTIONS(57), + [sym_comment] = ACTIONS(3), + [anon_sym_GT] = ACTIONS(141), }, [40] = { - [sym__end_tag_name] = ACTIONS(143), - [sym_erroneous_end_tag_name] = ACTIONS(73), - [sym_comment] = ACTIONS(5), + [anon_sym_LT] = ACTIONS(143), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(143), + [sym_text] = ACTIONS(145), + [anon_sym_LT_BANG] = ACTIONS(143), + [ts_builtin_sym_end] = ACTIONS(145), }, [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), + [sym_comment] = ACTIONS(3), + [anon_sym_GT] = ACTIONS(147), }, [42] = { - [sym_end_tag] = STATE(63), - [sym_comment] = ACTIONS(5), - [anon_sym_LT_SLASH] = ACTIONS(83), + [aux_sym_start_tag_repeat1] = STATE(68), + [sym_attribute] = STATE(68), + [sym_comment] = ACTIONS(3), + [sym_attribute_name] = ACTIONS(51), + [anon_sym_SLASH_GT] = ACTIONS(149), + [anon_sym_GT] = ACTIONS(55), }, [43] = { - [sym__end_tag_name] = ACTIONS(143), - [sym_comment] = ACTIONS(5), + [sym_comment] = ACTIONS(3), + [anon_sym_GT] = ACTIONS(151), }, [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), + [sym_comment] = ACTIONS(3), + [anon_sym_GT] = ACTIONS(153), }, [45] = { - [sym_comment] = ACTIONS(5), - [ts_builtin_sym_end] = ACTIONS(147), - [anon_sym_LT_BANG] = ACTIONS(149), - [anon_sym_LT] = ACTIONS(149), - [anon_sym_LT_SLASH] = ACTIONS(149), - [sym_text] = ACTIONS(147), + [sym_comment] = ACTIONS(3), + [aux_sym_doctype_token1] = ACTIONS(155), }, [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), - [sym_comment] = ACTIONS(5), - [anon_sym_LT_BANG] = ACTIONS(151), - [anon_sym_LT] = ACTIONS(154), + [anon_sym_LT] = ACTIONS(157), + [sym_comment] = ACTIONS(3), [anon_sym_LT_SLASH] = ACTIONS(157), - [sym_text] = ACTIONS(160), + [sym_text] = ACTIONS(159), + [anon_sym_LT_BANG] = ACTIONS(157), + [ts_builtin_sym_end] = ACTIONS(159), }, [47] = { - [sym_comment] = ACTIONS(5), - [ts_builtin_sym_end] = ACTIONS(163), - [anon_sym_LT_BANG] = ACTIONS(165), - [anon_sym_LT] = ACTIONS(165), - [anon_sym_LT_SLASH] = ACTIONS(165), - [sym_text] = ACTIONS(163), + [aux_sym_fragment_repeat1] = STATE(47), + [sym_element] = STATE(47), + [sym_script_element] = STATE(47), + [sym_self_closing_tag] = STATE(22), + [sym_style_element] = STATE(47), + [sym_start_tag] = STATE(23), + [sym_erroneous_end_tag] = STATE(47), + [sym_doctype] = STATE(47), + [sym__node] = STATE(47), + [sym_script_start_tag] = STATE(24), + [sym_style_start_tag] = STATE(25), + [anon_sym_LT] = ACTIONS(161), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(164), + [sym_text] = ACTIONS(167), + [anon_sym_LT_BANG] = ACTIONS(170), + [sym__implicit_end_tag] = ACTIONS(79), }, [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), + [sym_erroneous_end_tag_name] = ACTIONS(83), + [sym_comment] = ACTIONS(3), + [sym__end_tag_name] = ACTIONS(173), }, [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), + [anon_sym_LT] = ACTIONS(89), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(89), + [sym_text] = ACTIONS(91), + [anon_sym_LT_BANG] = ACTIONS(89), + [sym__implicit_end_tag] = ACTIONS(91), }, [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), + [aux_sym_fragment_repeat1] = STATE(47), + [sym_element] = STATE(47), + [sym_script_element] = STATE(47), + [sym_self_closing_tag] = STATE(22), + [sym_end_tag] = STATE(74), + [sym_style_element] = STATE(47), + [sym_start_tag] = STATE(23), + [sym_erroneous_end_tag] = STATE(47), + [sym_doctype] = STATE(47), + [sym__node] = STATE(47), + [sym_script_start_tag] = STATE(24), + [sym_style_start_tag] = STATE(25), + [anon_sym_LT] = ACTIONS(35), + [sym_comment] = ACTIONS(3), + [sym_text] = ACTIONS(93), + [anon_sym_LT_SLASH] = ACTIONS(99), + [anon_sym_LT_BANG] = ACTIONS(41), + [sym__implicit_end_tag] = ACTIONS(175), }, [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), + [sym_comment] = ACTIONS(3), + [sym__end_tag_name] = ACTIONS(173), }, [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), + [sym_end_tag] = STATE(75), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(103), }, [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), + [anon_sym_LT] = ACTIONS(109), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(109), + [sym_text] = ACTIONS(111), + [anon_sym_LT_BANG] = ACTIONS(109), + [sym__implicit_end_tag] = ACTIONS(111), }, [54] = { - [sym_raw_text] = ACTIONS(196), - [sym_comment] = ACTIONS(5), - [anon_sym_LT_SLASH] = ACTIONS(196), + [sym_end_tag] = STATE(76), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(103), }, [55] = { - [sym_attribute] = STATE(55), - [aux_sym_start_tag_repeat1] = STATE(55), - [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(185), - [sym_attribute_name] = ACTIONS(198), + [anon_sym_LT] = ACTIONS(113), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(113), + [sym_text] = ACTIONS(115), + [anon_sym_LT_BANG] = ACTIONS(113), + [sym__implicit_end_tag] = ACTIONS(115), }, [56] = { - [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(201), + [anon_sym_LT] = ACTIONS(177), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(177), + [sym_text] = ACTIONS(179), + [anon_sym_LT_BANG] = ACTIONS(177), + [ts_builtin_sym_end] = 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), + [anon_sym_LT] = ACTIONS(181), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(181), + [sym_text] = ACTIONS(183), + [anon_sym_LT_BANG] = ACTIONS(181), + [ts_builtin_sym_end] = 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), + [sym_quoted_attribute_value] = STATE(78), + [anon_sym_DQUOTE] = ACTIONS(185), + [sym_attribute_value] = ACTIONS(187), + [sym_comment] = ACTIONS(3), + [anon_sym_SQUOTE] = ACTIONS(189), }, [59] = { - [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), + [anon_sym_LT] = ACTIONS(191), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(191), + [sym_text] = ACTIONS(193), + [anon_sym_LT_BANG] = ACTIONS(191), + [ts_builtin_sym_end] = ACTIONS(193), }, [60] = { - [sym__implicit_end_tag] = ACTIONS(131), - [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] = ACTIONS(195), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(195), + [sym_text] = ACTIONS(197), + [anon_sym_LT_BANG] = ACTIONS(195), + [sym__implicit_end_tag] = ACTIONS(197), }, [61] = { - [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(209), + [aux_sym_start_tag_repeat1] = STATE(61), + [sym_attribute] = STATE(61), + [sym_comment] = ACTIONS(3), + [sym_attribute_name] = ACTIONS(199), + [anon_sym_SLASH_GT] = ACTIONS(202), + [anon_sym_GT] = ACTIONS(202), }, [62] = { - [sym__implicit_end_tag] = ACTIONS(147), - [sym_comment] = ACTIONS(5), - [anon_sym_LT_BANG] = ACTIONS(149), - [anon_sym_LT] = ACTIONS(149), - [anon_sym_LT_SLASH] = ACTIONS(149), - [sym_text] = ACTIONS(147), + [sym_quoted_attribute_value] = STATE(81), + [anon_sym_DQUOTE] = ACTIONS(204), + [sym_attribute_value] = ACTIONS(206), + [sym_comment] = ACTIONS(3), + [anon_sym_SQUOTE] = ACTIONS(208), }, [63] = { - [sym__implicit_end_tag] = ACTIONS(163), - [sym_comment] = ACTIONS(5), - [anon_sym_LT_BANG] = ACTIONS(165), - [anon_sym_LT] = ACTIONS(165), - [anon_sym_LT_SLASH] = ACTIONS(165), - [sym_text] = ACTIONS(163), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(210), + [sym_raw_text] = ACTIONS(210), }, [64] = { - [sym_erroneous_end_tag_name] = ACTIONS(73), - [sym_comment] = ACTIONS(5), + [aux_sym_start_tag_repeat1] = STATE(64), + [sym_attribute] = STATE(64), + [sym_attribute_name] = ACTIONS(212), + [sym_comment] = ACTIONS(3), + [anon_sym_GT] = ACTIONS(202), }, [65] = { - [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(211), - [anon_sym_SLASH_GT] = ACTIONS(211), - [sym_attribute_name] = ACTIONS(211), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(215), + [sym_raw_text] = ACTIONS(215), }, [66] = { - [sym_comment] = ACTIONS(5), - [anon_sym_SQUOTE] = ACTIONS(213), - [aux_sym_SLASH_LBRACK_CARET_SQUOTE_RBRACK_PLUS_SLASH] = ACTIONS(215), + [anon_sym_LT] = ACTIONS(217), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(217), + [sym_text] = ACTIONS(219), + [anon_sym_LT_BANG] = ACTIONS(217), + [ts_builtin_sym_end] = ACTIONS(219), }, [67] = { - [sym_comment] = ACTIONS(5), - [anon_sym_DQUOTE] = ACTIONS(213), - [aux_sym_SLASH_LBRACK_CARET_DQUOTE_RBRACK_PLUS_SLASH] = ACTIONS(217), + [anon_sym_LT] = ACTIONS(121), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(121), + [sym_text] = ACTIONS(123), + [anon_sym_LT_BANG] = ACTIONS(121), + [sym__implicit_end_tag] = ACTIONS(123), }, [68] = { - [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(211), - [sym_attribute_name] = ACTIONS(211), + [aux_sym_start_tag_repeat1] = STATE(61), + [sym_attribute] = STATE(61), + [sym_comment] = ACTIONS(3), + [sym_attribute_name] = ACTIONS(51), + [anon_sym_SLASH_GT] = ACTIONS(221), + [anon_sym_GT] = ACTIONS(131), }, [69] = { - [sym_comment] = ACTIONS(5), - [anon_sym_SQUOTE] = ACTIONS(219), - [aux_sym_SLASH_LBRACK_CARET_SQUOTE_RBRACK_PLUS_SLASH] = ACTIONS(221), + [anon_sym_LT] = ACTIONS(143), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(143), + [sym_text] = ACTIONS(145), + [anon_sym_LT_BANG] = ACTIONS(143), + [sym__implicit_end_tag] = ACTIONS(145), }, [70] = { - [sym_comment] = ACTIONS(5), - [anon_sym_DQUOTE] = ACTIONS(219), - [aux_sym_SLASH_LBRACK_CARET_DQUOTE_RBRACK_PLUS_SLASH] = ACTIONS(223), + [anon_sym_LT] = ACTIONS(223), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(223), + [sym_text] = ACTIONS(225), + [anon_sym_LT_BANG] = ACTIONS(223), + [ts_builtin_sym_end] = ACTIONS(225), }, [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), + [sym_comment] = ACTIONS(3), + [anon_sym_GT] = ACTIONS(227), }, [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), + [sym_erroneous_end_tag_name] = ACTIONS(83), + [sym_comment] = ACTIONS(3), }, [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), + [sym_comment] = ACTIONS(3), + [anon_sym_GT] = ACTIONS(229), }, [74] = { - [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(225), - [anon_sym_SLASH_GT] = ACTIONS(225), - [sym_attribute_name] = ACTIONS(225), + [anon_sym_LT] = ACTIONS(157), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(157), + [sym_text] = ACTIONS(159), + [anon_sym_LT_BANG] = ACTIONS(157), + [sym__implicit_end_tag] = ACTIONS(159), }, [75] = { - [sym_comment] = ACTIONS(5), - [anon_sym_SQUOTE] = ACTIONS(227), + [anon_sym_LT] = ACTIONS(177), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(177), + [sym_text] = ACTIONS(179), + [anon_sym_LT_BANG] = ACTIONS(177), + [sym__implicit_end_tag] = ACTIONS(179), }, [76] = { - [sym_comment] = ACTIONS(5), - [anon_sym_DQUOTE] = ACTIONS(227), + [anon_sym_LT] = ACTIONS(181), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(181), + [sym_text] = ACTIONS(183), + [anon_sym_LT_BANG] = ACTIONS(181), + [sym__implicit_end_tag] = ACTIONS(183), }, [77] = { - [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(225), - [sym_attribute_name] = ACTIONS(225), + [anon_sym_DQUOTE] = ACTIONS(231), + [aux_sym_quoted_attribute_value_token2] = ACTIONS(233), + [sym_comment] = ACTIONS(3), }, [78] = { - [sym_comment] = ACTIONS(5), - [anon_sym_SQUOTE] = ACTIONS(229), + [sym_comment] = ACTIONS(3), + [sym_attribute_name] = ACTIONS(235), + [anon_sym_SLASH_GT] = ACTIONS(235), + [anon_sym_GT] = ACTIONS(235), }, [79] = { - [sym_comment] = ACTIONS(5), - [anon_sym_DQUOTE] = ACTIONS(229), + [sym_comment] = ACTIONS(3), + [anon_sym_SQUOTE] = ACTIONS(231), + [aux_sym_quoted_attribute_value_token1] = ACTIONS(237), }, [80] = { - [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(231), - [anon_sym_SLASH_GT] = ACTIONS(231), - [sym_attribute_name] = ACTIONS(231), + [anon_sym_DQUOTE] = ACTIONS(239), + [aux_sym_quoted_attribute_value_token2] = ACTIONS(241), + [sym_comment] = ACTIONS(3), }, [81] = { - [sym_comment] = ACTIONS(5), - [anon_sym_GT] = ACTIONS(231), - [sym_attribute_name] = ACTIONS(231), + [sym_attribute_name] = ACTIONS(235), + [sym_comment] = ACTIONS(3), + [anon_sym_GT] = ACTIONS(235), + }, + [82] = { + [sym_comment] = ACTIONS(3), + [anon_sym_SQUOTE] = ACTIONS(239), + [aux_sym_quoted_attribute_value_token1] = ACTIONS(243), + }, + [83] = { + [anon_sym_LT] = ACTIONS(191), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(191), + [sym_text] = ACTIONS(193), + [anon_sym_LT_BANG] = ACTIONS(191), + [sym__implicit_end_tag] = ACTIONS(193), + }, + [84] = { + [anon_sym_LT] = ACTIONS(217), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(217), + [sym_text] = ACTIONS(219), + [anon_sym_LT_BANG] = ACTIONS(217), + [sym__implicit_end_tag] = ACTIONS(219), + }, + [85] = { + [anon_sym_LT] = ACTIONS(223), + [sym_comment] = ACTIONS(3), + [anon_sym_LT_SLASH] = ACTIONS(223), + [sym_text] = ACTIONS(225), + [anon_sym_LT_BANG] = ACTIONS(223), + [sym__implicit_end_tag] = ACTIONS(225), + }, + [86] = { + [sym_comment] = ACTIONS(3), + [sym_attribute_name] = ACTIONS(245), + [anon_sym_SLASH_GT] = ACTIONS(245), + [anon_sym_GT] = ACTIONS(245), + }, + [87] = { + [anon_sym_DQUOTE] = ACTIONS(247), + [sym_comment] = ACTIONS(3), + }, + [88] = { + [sym_comment] = ACTIONS(3), + [anon_sym_SQUOTE] = ACTIONS(247), + }, + [89] = { + [sym_attribute_name] = ACTIONS(245), + [sym_comment] = ACTIONS(3), + [anon_sym_GT] = ACTIONS(245), + }, + [90] = { + [anon_sym_DQUOTE] = ACTIONS(249), + [sym_comment] = ACTIONS(3), + }, + [91] = { + [sym_comment] = ACTIONS(3), + [anon_sym_SQUOTE] = ACTIONS(249), + }, + [92] = { + [sym_comment] = ACTIONS(3), + [sym_attribute_name] = ACTIONS(251), + [anon_sym_SLASH_GT] = ACTIONS(251), + [anon_sym_GT] = ACTIONS(251), + }, + [93] = { + [sym_attribute_name] = ACTIONS(251), + [sym_comment] = ACTIONS(3), + [anon_sym_GT] = ACTIONS(251), }, }; static TSParseActionEntry ts_parse_actions[] = { [0] = {.count = 0, .reusable = false}, - [1] = {.count = 1, .reusable = true}, RECOVER(), - [3] = {.count = 1, .reusable = false}, RECOVER(), - [5] = {.count = 1, .reusable = true}, SHIFT_EXTRA(), + [1] = {.count = 1, .reusable = false}, RECOVER(), + [3] = {.count = 1, .reusable = true}, SHIFT_EXTRA(), + [5] = {.count = 1, .reusable = false}, SHIFT(2), [7] = {.count = 1, .reusable = true}, REDUCE(sym_fragment, 0), - [9] = {.count = 1, .reusable = false}, SHIFT(2), + [9] = {.count = 1, .reusable = true}, SHIFT(5), [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), + [15] = {.count = 1, .reusable = true}, SHIFT(11), + [17] = {.count = 1, .reusable = true}, SHIFT(13), + [19] = {.count = 1, .reusable = true}, SHIFT(12), + [21] = {.count = 1, .reusable = true}, SHIFT(14), + [23] = {.count = 1, .reusable = true}, SHIFT(15), + [25] = {.count = 1, .reusable = true}, REDUCE(sym_fragment, 1), + [27] = {.count = 1, .reusable = true}, SHIFT(16), + [29] = {.count = 1, .reusable = false}, REDUCE(sym_element, 1), + [31] = {.count = 1, .reusable = true}, REDUCE(sym_element, 1), + [33] = {.count = 1, .reusable = true}, ACCEPT_INPUT(), + [35] = {.count = 1, .reusable = false}, SHIFT(17), + [37] = {.count = 1, .reusable = true}, SHIFT(21), + [39] = {.count = 1, .reusable = false}, SHIFT(18), + [41] = {.count = 1, .reusable = false}, SHIFT(19), + [43] = {.count = 1, .reusable = true}, SHIFT(20), + [45] = {.count = 1, .reusable = true}, SHIFT(26), + [47] = {.count = 1, .reusable = true}, SHIFT(27), + [49] = {.count = 1, .reusable = true}, SHIFT(29), + [51] = {.count = 1, .reusable = true}, SHIFT(31), + [53] = {.count = 1, .reusable = true}, SHIFT(32), + [55] = {.count = 1, .reusable = true}, SHIFT(33), + [57] = {.count = 1, .reusable = true}, SHIFT(35), + [59] = {.count = 1, .reusable = true}, SHIFT(36), + [61] = {.count = 1, .reusable = true}, SHIFT(38), + [63] = {.count = 1, .reusable = true}, SHIFT(40), + [65] = {.count = 1, .reusable = true}, SHIFT(41), + [67] = {.count = 2, .reusable = false}, REDUCE(aux_sym_fragment_repeat1, 2), SHIFT_REPEAT(2), + [70] = {.count = 2, .reusable = false}, REDUCE(aux_sym_fragment_repeat1, 2), SHIFT_REPEAT(3), + [73] = {.count = 2, .reusable = true}, REDUCE(aux_sym_fragment_repeat1, 2), SHIFT_REPEAT(16), + [76] = {.count = 2, .reusable = false}, REDUCE(aux_sym_fragment_repeat1, 2), SHIFT_REPEAT(4), + [79] = {.count = 1, .reusable = true}, REDUCE(aux_sym_fragment_repeat1, 2), [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), + [85] = {.count = 1, .reusable = true}, SHIFT(44), + [87] = {.count = 1, .reusable = true}, SHIFT(45), + [89] = {.count = 1, .reusable = false}, REDUCE(sym_element, 2), + [91] = {.count = 1, .reusable = true}, REDUCE(sym_element, 2), + [93] = {.count = 1, .reusable = true}, SHIFT(47), + [95] = {.count = 1, .reusable = true}, SHIFT(46), + [97] = {.count = 1, .reusable = true}, SHIFT(50), + [99] = {.count = 1, .reusable = false}, SHIFT(48), + [101] = {.count = 1, .reusable = true}, SHIFT(49), + [103] = {.count = 1, .reusable = true}, SHIFT(51), + [105] = {.count = 1, .reusable = true}, SHIFT(52), + [107] = {.count = 1, .reusable = true}, SHIFT(54), + [109] = {.count = 1, .reusable = false}, REDUCE(sym_script_element, 2), + [111] = {.count = 1, .reusable = true}, REDUCE(sym_script_element, 2), + [113] = {.count = 1, .reusable = false}, REDUCE(sym_style_element, 2), + [115] = {.count = 1, .reusable = true}, REDUCE(sym_style_element, 2), [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), + [119] = {.count = 1, .reusable = true}, SHIFT(58), + [121] = {.count = 1, .reusable = false}, REDUCE(sym_self_closing_tag, 3), + [123] = {.count = 1, .reusable = true}, REDUCE(sym_self_closing_tag, 3), + [125] = {.count = 1, .reusable = false}, REDUCE(sym_start_tag, 3), + [127] = {.count = 1, .reusable = true}, REDUCE(sym_start_tag, 3), + [129] = {.count = 1, .reusable = true}, SHIFT(59), + [131] = {.count = 1, .reusable = true}, SHIFT(60), + [133] = {.count = 1, .reusable = true}, SHIFT(62), + [135] = {.count = 1, .reusable = true}, REDUCE(sym_script_start_tag, 3), + [137] = {.count = 1, .reusable = true}, SHIFT(63), + [139] = {.count = 1, .reusable = true}, REDUCE(sym_style_start_tag, 3), + [141] = {.count = 1, .reusable = true}, SHIFT(65), + [143] = {.count = 1, .reusable = false}, REDUCE(sym_erroneous_end_tag, 3), + [145] = {.count = 1, .reusable = true}, REDUCE(sym_erroneous_end_tag, 3), + [147] = {.count = 1, .reusable = true}, SHIFT(66), + [149] = {.count = 1, .reusable = true}, SHIFT(67), + [151] = {.count = 1, .reusable = true}, SHIFT(69), + [153] = {.count = 1, .reusable = true}, SHIFT(70), + [155] = {.count = 1, .reusable = true}, SHIFT(71), + [157] = {.count = 1, .reusable = false}, REDUCE(sym_element, 3), + [159] = {.count = 1, .reusable = true}, REDUCE(sym_element, 3), + [161] = {.count = 2, .reusable = false}, REDUCE(aux_sym_fragment_repeat1, 2), SHIFT_REPEAT(17), + [164] = {.count = 2, .reusable = false}, REDUCE(aux_sym_fragment_repeat1, 2), SHIFT_REPEAT(72), + [167] = {.count = 2, .reusable = true}, REDUCE(aux_sym_fragment_repeat1, 2), SHIFT_REPEAT(47), + [170] = {.count = 2, .reusable = false}, REDUCE(aux_sym_fragment_repeat1, 2), SHIFT_REPEAT(19), + [173] = {.count = 1, .reusable = true}, SHIFT(73), + [175] = {.count = 1, .reusable = true}, SHIFT(74), + [177] = {.count = 1, .reusable = false}, REDUCE(sym_script_element, 3), + [179] = {.count = 1, .reusable = true}, REDUCE(sym_script_element, 3), + [181] = {.count = 1, .reusable = false}, REDUCE(sym_style_element, 3), + [183] = {.count = 1, .reusable = true}, REDUCE(sym_style_element, 3), + [185] = {.count = 1, .reusable = true}, SHIFT(77), + [187] = {.count = 1, .reusable = true}, SHIFT(78), + [189] = {.count = 1, .reusable = true}, SHIFT(79), + [191] = {.count = 1, .reusable = false}, REDUCE(sym_self_closing_tag, 4), + [193] = {.count = 1, .reusable = true}, REDUCE(sym_self_closing_tag, 4), + [195] = {.count = 1, .reusable = false}, REDUCE(sym_start_tag, 4), + [197] = {.count = 1, .reusable = true}, REDUCE(sym_start_tag, 4), + [199] = {.count = 2, .reusable = true}, REDUCE(aux_sym_start_tag_repeat1, 2), SHIFT_REPEAT(31), + [202] = {.count = 1, .reusable = true}, REDUCE(aux_sym_start_tag_repeat1, 2), + [204] = {.count = 1, .reusable = true}, SHIFT(80), + [206] = {.count = 1, .reusable = true}, SHIFT(81), + [208] = {.count = 1, .reusable = true}, SHIFT(82), + [210] = {.count = 1, .reusable = true}, REDUCE(sym_script_start_tag, 4), + [212] = {.count = 2, .reusable = true}, REDUCE(aux_sym_start_tag_repeat1, 2), SHIFT_REPEAT(35), + [215] = {.count = 1, .reusable = true}, REDUCE(sym_style_start_tag, 4), + [217] = {.count = 1, .reusable = false}, REDUCE(sym_doctype, 4), + [219] = {.count = 1, .reusable = true}, REDUCE(sym_doctype, 4), + [221] = {.count = 1, .reusable = true}, SHIFT(83), + [223] = {.count = 1, .reusable = false}, REDUCE(sym_end_tag, 3), + [225] = {.count = 1, .reusable = true}, REDUCE(sym_end_tag, 3), + [227] = {.count = 1, .reusable = true}, SHIFT(84), + [229] = {.count = 1, .reusable = true}, SHIFT(85), + [231] = {.count = 1, .reusable = false}, SHIFT(86), + [233] = {.count = 1, .reusable = true}, SHIFT(87), + [235] = {.count = 1, .reusable = true}, REDUCE(sym_attribute, 3), + [237] = {.count = 1, .reusable = true}, SHIFT(88), + [239] = {.count = 1, .reusable = false}, SHIFT(89), + [241] = {.count = 1, .reusable = true}, SHIFT(90), + [243] = {.count = 1, .reusable = true}, SHIFT(91), + [245] = {.count = 1, .reusable = true}, REDUCE(sym_quoted_attribute_value, 2), + [247] = {.count = 1, .reusable = true}, SHIFT(92), + [249] = {.count = 1, .reusable = true}, SHIFT(93), + [251] = {.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; diff --git a/src/tree_sitter/parser.h b/src/tree_sitter/parser.h index a757eac..e503706 100644 --- a/src/tree_sitter/parser.h +++ b/src/tree_sitter/parser.h @@ -13,7 +13,7 @@ extern "C" { #define ts_builtin_sym_end 0 #define TREE_SITTER_SERIALIZATION_BUFFER_SIZE 1024 -#ifndef TREE_SITTER_RUNTIME_H_ +#ifndef TREE_SITTER_API_H_ typedef uint16_t TSSymbol; typedef struct TSLanguage TSLanguage; #endif