⬆️ tree-sitter
This commit is contained in:
parent
1a2f4c0d39
commit
aeb2f456b8
@ -16,7 +16,7 @@
|
|||||||
"nan": "^2.10.0"
|
"nan": "^2.10.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"tree-sitter-cli": "^0.15.3"
|
"tree-sitter-cli": "^0.15.6"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tree-sitter generate && node-gyp build",
|
"build": "tree-sitter generate && node-gyp build",
|
||||||
|
@ -50,330 +50,43 @@
|
|||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"property_set_id": 1,
|
"property_set_id": 1,
|
||||||
"transitions": [
|
"transitions": [],
|
||||||
{
|
|
||||||
"type": "comment",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "attribute_value",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "attribute_name",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 3
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "doctype",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "erroneous_end_tag_name",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "tag_name",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "style_element",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 6
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "script_element",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 7
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"default_next_state_id": 0
|
"default_next_state_id": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 2,
|
"id": 2,
|
||||||
"property_set_id": 2,
|
"property_set_id": 2,
|
||||||
"transitions": [
|
"transitions": [],
|
||||||
{
|
|
||||||
"type": "comment",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "attribute_value",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "attribute_name",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 3
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "doctype",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "erroneous_end_tag_name",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "tag_name",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "style_element",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 6
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "script_element",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 7
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"default_next_state_id": 0
|
"default_next_state_id": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 3,
|
"id": 3,
|
||||||
"property_set_id": 3,
|
"property_set_id": 3,
|
||||||
"transitions": [
|
"transitions": [],
|
||||||
{
|
|
||||||
"type": "comment",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "attribute_value",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "attribute_name",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 3
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "doctype",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "erroneous_end_tag_name",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "tag_name",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "style_element",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 6
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "script_element",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 7
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"default_next_state_id": 0
|
"default_next_state_id": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 4,
|
"id": 4,
|
||||||
"property_set_id": 4,
|
"property_set_id": 4,
|
||||||
"transitions": [
|
"transitions": [],
|
||||||
{
|
|
||||||
"type": "comment",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "attribute_value",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "attribute_name",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 3
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "doctype",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "erroneous_end_tag_name",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "tag_name",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "style_element",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 6
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "script_element",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 7
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"default_next_state_id": 0
|
"default_next_state_id": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 5,
|
"id": 5,
|
||||||
"property_set_id": 5,
|
"property_set_id": 5,
|
||||||
"transitions": [
|
"transitions": [],
|
||||||
{
|
|
||||||
"type": "comment",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "attribute_value",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "attribute_name",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 3
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "doctype",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "erroneous_end_tag_name",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "tag_name",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "style_element",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 6
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "script_element",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 7
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"default_next_state_id": 0
|
"default_next_state_id": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 6,
|
"id": 6,
|
||||||
"property_set_id": 6,
|
"property_set_id": 6,
|
||||||
"transitions": [
|
"transitions": [],
|
||||||
{
|
|
||||||
"type": "comment",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "attribute_value",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "attribute_name",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 3
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "doctype",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "erroneous_end_tag_name",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "tag_name",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "style_element",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 6
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "script_element",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 7
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"default_next_state_id": 0
|
"default_next_state_id": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 7,
|
"id": 7,
|
||||||
"property_set_id": 7,
|
"property_set_id": 7,
|
||||||
"transitions": [
|
"transitions": [],
|
||||||
{
|
|
||||||
"type": "comment",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "attribute_value",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "attribute_name",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 3
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "doctype",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "erroneous_end_tag_name",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "tag_name",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "style_element",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 6
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "script_element",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 7
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"default_next_state_id": 0
|
"default_next_state_id": 0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -20,35 +20,13 @@
|
|||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"property_set_id": 1,
|
"property_set_id": 1,
|
||||||
"transitions": [
|
"transitions": [],
|
||||||
{
|
|
||||||
"type": "style_element",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "script_element",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 2
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"default_next_state_id": 0
|
"default_next_state_id": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 2,
|
"id": 2,
|
||||||
"property_set_id": 2,
|
"property_set_id": 2,
|
||||||
"transitions": [
|
"transitions": [],
|
||||||
{
|
|
||||||
"type": "style_element",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "script_element",
|
|
||||||
"named": true,
|
|
||||||
"state_id": 2
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"default_next_state_id": 0
|
"default_next_state_id": 0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -2,7 +2,25 @@
|
|||||||
{
|
{
|
||||||
"type": "attribute",
|
"type": "attribute",
|
||||||
"named": true,
|
"named": true,
|
||||||
"fields": {}
|
"fields": {},
|
||||||
|
"children": {
|
||||||
|
"multiple": true,
|
||||||
|
"required": false,
|
||||||
|
"types": [
|
||||||
|
{
|
||||||
|
"type": "attribute_name",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "attribute_value",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "quoted_attribute_value",
|
||||||
|
"named": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "doctype",
|
"type": "doctype",
|
||||||
@ -12,7 +30,49 @@
|
|||||||
{
|
{
|
||||||
"type": "element",
|
"type": "element",
|
||||||
"named": true,
|
"named": true,
|
||||||
"fields": {}
|
"fields": {},
|
||||||
|
"children": {
|
||||||
|
"multiple": true,
|
||||||
|
"required": false,
|
||||||
|
"types": [
|
||||||
|
{
|
||||||
|
"type": "doctype",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "element",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "end_tag",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "erroneous_end_tag",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "script_element",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "self_closing_tag",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "start_tag",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "style_element",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"named": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "end_tag",
|
"type": "end_tag",
|
||||||
@ -22,12 +82,52 @@
|
|||||||
{
|
{
|
||||||
"type": "erroneous_end_tag",
|
"type": "erroneous_end_tag",
|
||||||
"named": true,
|
"named": true,
|
||||||
"fields": {}
|
"fields": {},
|
||||||
|
"children": {
|
||||||
|
"multiple": true,
|
||||||
|
"required": false,
|
||||||
|
"types": [
|
||||||
|
{
|
||||||
|
"type": "erroneous_end_tag_name",
|
||||||
|
"named": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "fragment",
|
"type": "fragment",
|
||||||
"named": true,
|
"named": true,
|
||||||
"fields": {}
|
"fields": {},
|
||||||
|
"children": {
|
||||||
|
"multiple": true,
|
||||||
|
"required": false,
|
||||||
|
"types": [
|
||||||
|
{
|
||||||
|
"type": "doctype",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "element",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "erroneous_end_tag",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "script_element",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "style_element",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"named": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "quoted_attribute_value",
|
"type": "quoted_attribute_value",
|
||||||
@ -37,22 +137,78 @@
|
|||||||
{
|
{
|
||||||
"type": "script_element",
|
"type": "script_element",
|
||||||
"named": true,
|
"named": true,
|
||||||
"fields": {}
|
"fields": {},
|
||||||
|
"children": {
|
||||||
|
"multiple": true,
|
||||||
|
"required": false,
|
||||||
|
"types": [
|
||||||
|
{
|
||||||
|
"type": "end_tag",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "raw_text",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "start_tag",
|
||||||
|
"named": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "self_closing_tag",
|
"type": "self_closing_tag",
|
||||||
"named": true,
|
"named": true,
|
||||||
"fields": {}
|
"fields": {},
|
||||||
|
"children": {
|
||||||
|
"multiple": true,
|
||||||
|
"required": false,
|
||||||
|
"types": [
|
||||||
|
{
|
||||||
|
"type": "attribute",
|
||||||
|
"named": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "start_tag",
|
"type": "start_tag",
|
||||||
"named": true,
|
"named": true,
|
||||||
"fields": {}
|
"fields": {},
|
||||||
|
"children": {
|
||||||
|
"multiple": true,
|
||||||
|
"required": false,
|
||||||
|
"types": [
|
||||||
|
{
|
||||||
|
"type": "attribute",
|
||||||
|
"named": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "style_element",
|
"type": "style_element",
|
||||||
"named": true,
|
"named": true,
|
||||||
"fields": {}
|
"fields": {},
|
||||||
|
"children": {
|
||||||
|
"multiple": true,
|
||||||
|
"required": false,
|
||||||
|
"types": [
|
||||||
|
{
|
||||||
|
"type": "end_tag",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "raw_text",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "start_tag",
|
||||||
|
"named": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "<!",
|
"type": "<!",
|
||||||
|
564
src/parser.c
vendored
564
src/parser.c
vendored
@ -266,172 +266,145 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
|
|||||||
START_LEXER();
|
START_LEXER();
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case 0:
|
case 0:
|
||||||
if (lookahead == 0)
|
if (lookahead == 0) ADVANCE(14);
|
||||||
ADVANCE(1);
|
if (lookahead == '"') ADVANCE(29);
|
||||||
if (lookahead == '"')
|
if (lookahead == '\'') ADVANCE(26);
|
||||||
ADVANCE(2);
|
if (lookahead == '/') ADVANCE(6);
|
||||||
if (lookahead == '\'')
|
if (lookahead == '<') ADVANCE(20);
|
||||||
ADVANCE(3);
|
if (lookahead == '=') ADVANCE(23);
|
||||||
if (lookahead == '/')
|
if (lookahead == '>') ADVANCE(18);
|
||||||
ADVANCE(4);
|
|
||||||
if (lookahead == '<')
|
|
||||||
ADVANCE(5);
|
|
||||||
if (lookahead == '=')
|
|
||||||
ADVANCE(6);
|
|
||||||
if (lookahead == '>')
|
|
||||||
ADVANCE(7);
|
|
||||||
if (lookahead == 'D' ||
|
if (lookahead == 'D' ||
|
||||||
lookahead == 'd')
|
lookahead == 'd') ADVANCE(9);
|
||||||
ADVANCE(8);
|
|
||||||
if (lookahead == '\t' ||
|
if (lookahead == '\t' ||
|
||||||
lookahead == '\n' ||
|
lookahead == '\n' ||
|
||||||
lookahead == '\r' ||
|
lookahead == '\r' ||
|
||||||
lookahead == ' ')
|
lookahead == ' ') SKIP(0)
|
||||||
SKIP(0);
|
|
||||||
END_STATE();
|
END_STATE();
|
||||||
case 1:
|
case 1:
|
||||||
ACCEPT_TOKEN(ts_builtin_sym_end);
|
if (lookahead == 0) ADVANCE(14);
|
||||||
|
if (lookahead == '<') ADVANCE(20);
|
||||||
|
if (lookahead == '\t' ||
|
||||||
|
lookahead == '\n' ||
|
||||||
|
lookahead == '\r' ||
|
||||||
|
lookahead == ' ') ADVANCE(32);
|
||||||
|
if (lookahead != 0 &&
|
||||||
|
lookahead != '>') ADVANCE(33);
|
||||||
END_STATE();
|
END_STATE();
|
||||||
case 2:
|
case 2:
|
||||||
ACCEPT_TOKEN(anon_sym_DQUOTE);
|
if (lookahead == '"') ADVANCE(29);
|
||||||
|
if (lookahead == '\'') ADVANCE(26);
|
||||||
|
if (lookahead == '\t' ||
|
||||||
|
lookahead == '\n' ||
|
||||||
|
lookahead == '\r' ||
|
||||||
|
lookahead == ' ') SKIP(2)
|
||||||
|
if (lookahead != 0 &&
|
||||||
|
(lookahead < '<' || '>' < lookahead)) ADVANCE(25);
|
||||||
END_STATE();
|
END_STATE();
|
||||||
case 3:
|
case 3:
|
||||||
ACCEPT_TOKEN(anon_sym_SQUOTE);
|
if (lookahead == '"') ADVANCE(29);
|
||||||
|
if (lookahead == '\t' ||
|
||||||
|
lookahead == '\n' ||
|
||||||
|
lookahead == '\r' ||
|
||||||
|
lookahead == ' ') ADVANCE(30);
|
||||||
|
if (lookahead != 0) ADVANCE(31);
|
||||||
END_STATE();
|
END_STATE();
|
||||||
case 4:
|
case 4:
|
||||||
if (lookahead == '>')
|
if (lookahead == '\'') ADVANCE(26);
|
||||||
ADVANCE(9);
|
if (lookahead == '\t' ||
|
||||||
|
lookahead == '\n' ||
|
||||||
|
lookahead == '\r' ||
|
||||||
|
lookahead == ' ') ADVANCE(27);
|
||||||
|
if (lookahead != 0) ADVANCE(28);
|
||||||
END_STATE();
|
END_STATE();
|
||||||
case 5:
|
case 5:
|
||||||
ACCEPT_TOKEN(anon_sym_LT);
|
if (lookahead == '/') ADVANCE(6);
|
||||||
if (lookahead == '!')
|
if (lookahead == '=') ADVANCE(23);
|
||||||
ADVANCE(10);
|
if (lookahead == '>') ADVANCE(18);
|
||||||
if (lookahead == '/')
|
|
||||||
ADVANCE(11);
|
|
||||||
END_STATE();
|
|
||||||
case 6:
|
|
||||||
ACCEPT_TOKEN(anon_sym_EQ);
|
|
||||||
END_STATE();
|
|
||||||
case 7:
|
|
||||||
ACCEPT_TOKEN(anon_sym_GT);
|
|
||||||
END_STATE();
|
|
||||||
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')
|
|
||||||
ADVANCE(13);
|
|
||||||
END_STATE();
|
|
||||||
case 13:
|
|
||||||
if (lookahead == 'T' ||
|
|
||||||
lookahead == 't')
|
|
||||||
ADVANCE(14);
|
|
||||||
END_STATE();
|
|
||||||
case 14:
|
|
||||||
if (lookahead == 'Y' ||
|
|
||||||
lookahead == 'y')
|
|
||||||
ADVANCE(15);
|
|
||||||
END_STATE();
|
|
||||||
case 15:
|
|
||||||
if (lookahead == 'P' ||
|
|
||||||
lookahead == 'p')
|
|
||||||
ADVANCE(16);
|
|
||||||
END_STATE();
|
|
||||||
case 16:
|
|
||||||
if (lookahead == 'E' ||
|
|
||||||
lookahead == 'e')
|
|
||||||
ADVANCE(17);
|
|
||||||
END_STATE();
|
|
||||||
case 17:
|
|
||||||
ACCEPT_TOKEN(sym__doctype);
|
|
||||||
END_STATE();
|
|
||||||
case 18:
|
|
||||||
if (lookahead == 0)
|
|
||||||
ADVANCE(1);
|
|
||||||
if (lookahead == '<')
|
|
||||||
ADVANCE(5);
|
|
||||||
if (lookahead == '\t' ||
|
if (lookahead == '\t' ||
|
||||||
lookahead == '\n' ||
|
lookahead == '\n' ||
|
||||||
lookahead == '\r' ||
|
lookahead == '\r' ||
|
||||||
lookahead == ' ')
|
lookahead == ' ') SKIP(5)
|
||||||
ADVANCE(19);
|
|
||||||
if (lookahead != 0 &&
|
|
||||||
lookahead != '>')
|
|
||||||
ADVANCE(20);
|
|
||||||
END_STATE();
|
|
||||||
case 19:
|
|
||||||
ACCEPT_TOKEN(sym_text);
|
|
||||||
if (lookahead == '\t' ||
|
|
||||||
lookahead == '\n' ||
|
|
||||||
lookahead == '\r' ||
|
|
||||||
lookahead == ' ')
|
|
||||||
ADVANCE(19);
|
|
||||||
if (lookahead != 0 &&
|
|
||||||
lookahead != '<' &&
|
|
||||||
lookahead != '>')
|
|
||||||
ADVANCE(20);
|
|
||||||
END_STATE();
|
|
||||||
case 20:
|
|
||||||
ACCEPT_TOKEN(sym_text);
|
|
||||||
if (lookahead != 0 &&
|
|
||||||
lookahead != '<' &&
|
|
||||||
lookahead != '>')
|
|
||||||
ADVANCE(20);
|
|
||||||
END_STATE();
|
|
||||||
case 21:
|
|
||||||
if (lookahead == 'D' ||
|
|
||||||
lookahead == 'd')
|
|
||||||
ADVANCE(8);
|
|
||||||
if (lookahead == '\t' ||
|
|
||||||
lookahead == '\n' ||
|
|
||||||
lookahead == '\r' ||
|
|
||||||
lookahead == ' ')
|
|
||||||
SKIP(21);
|
|
||||||
END_STATE();
|
|
||||||
case 22:
|
|
||||||
if (lookahead == '<')
|
|
||||||
ADVANCE(23);
|
|
||||||
if (lookahead == '\t' ||
|
|
||||||
lookahead == '\n' ||
|
|
||||||
lookahead == '\r' ||
|
|
||||||
lookahead == ' ')
|
|
||||||
SKIP(22);
|
|
||||||
END_STATE();
|
|
||||||
case 23:
|
|
||||||
if (lookahead == '/')
|
|
||||||
ADVANCE(11);
|
|
||||||
END_STATE();
|
|
||||||
case 24:
|
|
||||||
if (lookahead == '/')
|
|
||||||
ADVANCE(4);
|
|
||||||
if (lookahead == '=')
|
|
||||||
ADVANCE(6);
|
|
||||||
if (lookahead == '>')
|
|
||||||
ADVANCE(7);
|
|
||||||
if (lookahead == '\t' ||
|
|
||||||
lookahead == '\n' ||
|
|
||||||
lookahead == '\r' ||
|
|
||||||
lookahead == ' ')
|
|
||||||
SKIP(24);
|
|
||||||
if (lookahead != 0 &&
|
if (lookahead != 0 &&
|
||||||
lookahead != '"' &&
|
lookahead != '"' &&
|
||||||
lookahead != '\'' &&
|
lookahead != '\'' &&
|
||||||
lookahead != '<')
|
lookahead != '<') ADVANCE(24);
|
||||||
ADVANCE(25);
|
|
||||||
END_STATE();
|
END_STATE();
|
||||||
case 25:
|
case 6:
|
||||||
|
if (lookahead == '>') ADVANCE(21);
|
||||||
|
END_STATE();
|
||||||
|
case 7:
|
||||||
|
if (lookahead == 'C' ||
|
||||||
|
lookahead == 'c') ADVANCE(11);
|
||||||
|
END_STATE();
|
||||||
|
case 8:
|
||||||
|
if (lookahead == 'E' ||
|
||||||
|
lookahead == 'e') ADVANCE(19);
|
||||||
|
END_STATE();
|
||||||
|
case 9:
|
||||||
|
if (lookahead == 'O' ||
|
||||||
|
lookahead == 'o') ADVANCE(7);
|
||||||
|
END_STATE();
|
||||||
|
case 10:
|
||||||
|
if (lookahead == 'P' ||
|
||||||
|
lookahead == 'p') ADVANCE(8);
|
||||||
|
END_STATE();
|
||||||
|
case 11:
|
||||||
|
if (lookahead == 'T' ||
|
||||||
|
lookahead == 't') ADVANCE(12);
|
||||||
|
END_STATE();
|
||||||
|
case 12:
|
||||||
|
if (lookahead == 'Y' ||
|
||||||
|
lookahead == 'y') ADVANCE(10);
|
||||||
|
END_STATE();
|
||||||
|
case 13:
|
||||||
|
if (lookahead == '\t' ||
|
||||||
|
lookahead == '\n' ||
|
||||||
|
lookahead == '\r' ||
|
||||||
|
lookahead == ' ') ADVANCE(16);
|
||||||
|
if (lookahead != 0 &&
|
||||||
|
lookahead != '>') ADVANCE(17);
|
||||||
|
END_STATE();
|
||||||
|
case 14:
|
||||||
|
ACCEPT_TOKEN(ts_builtin_sym_end);
|
||||||
|
END_STATE();
|
||||||
|
case 15:
|
||||||
|
ACCEPT_TOKEN(anon_sym_LT_BANG);
|
||||||
|
END_STATE();
|
||||||
|
case 16:
|
||||||
|
ACCEPT_TOKEN(aux_sym_doctype_token1);
|
||||||
|
if (lookahead == '\t' ||
|
||||||
|
lookahead == '\n' ||
|
||||||
|
lookahead == '\r' ||
|
||||||
|
lookahead == ' ') ADVANCE(16);
|
||||||
|
if (lookahead != 0 &&
|
||||||
|
lookahead != '>') ADVANCE(17);
|
||||||
|
END_STATE();
|
||||||
|
case 17:
|
||||||
|
ACCEPT_TOKEN(aux_sym_doctype_token1);
|
||||||
|
if (lookahead != 0 &&
|
||||||
|
lookahead != '>') ADVANCE(17);
|
||||||
|
END_STATE();
|
||||||
|
case 18:
|
||||||
|
ACCEPT_TOKEN(anon_sym_GT);
|
||||||
|
END_STATE();
|
||||||
|
case 19:
|
||||||
|
ACCEPT_TOKEN(sym__doctype);
|
||||||
|
END_STATE();
|
||||||
|
case 20:
|
||||||
|
ACCEPT_TOKEN(anon_sym_LT);
|
||||||
|
if (lookahead == '!') ADVANCE(15);
|
||||||
|
if (lookahead == '/') ADVANCE(22);
|
||||||
|
END_STATE();
|
||||||
|
case 21:
|
||||||
|
ACCEPT_TOKEN(anon_sym_SLASH_GT);
|
||||||
|
END_STATE();
|
||||||
|
case 22:
|
||||||
|
ACCEPT_TOKEN(anon_sym_LT_SLASH);
|
||||||
|
END_STATE();
|
||||||
|
case 23:
|
||||||
|
ACCEPT_TOKEN(anon_sym_EQ);
|
||||||
|
END_STATE();
|
||||||
|
case 24:
|
||||||
ACCEPT_TOKEN(sym_attribute_name);
|
ACCEPT_TOKEN(sym_attribute_name);
|
||||||
if (lookahead != 0 &&
|
if (lookahead != 0 &&
|
||||||
lookahead != '\t' &&
|
lookahead != '\t' &&
|
||||||
@ -441,51 +414,9 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
|
|||||||
lookahead != '"' &&
|
lookahead != '"' &&
|
||||||
lookahead != '\'' &&
|
lookahead != '\'' &&
|
||||||
lookahead != '/' &&
|
lookahead != '/' &&
|
||||||
(lookahead < '<' || '>' < lookahead))
|
(lookahead < '<' || '>' < lookahead)) ADVANCE(24);
|
||||||
ADVANCE(25);
|
|
||||||
END_STATE();
|
END_STATE();
|
||||||
case 26:
|
case 25:
|
||||||
if (lookahead == '\t' ||
|
|
||||||
lookahead == '\n' ||
|
|
||||||
lookahead == '\r' ||
|
|
||||||
lookahead == ' ')
|
|
||||||
ADVANCE(27);
|
|
||||||
if (lookahead != 0 &&
|
|
||||||
lookahead != '>')
|
|
||||||
ADVANCE(28);
|
|
||||||
END_STATE();
|
|
||||||
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);
|
|
||||||
if (lookahead == '\t' ||
|
|
||||||
lookahead == '\n' ||
|
|
||||||
lookahead == '\r' ||
|
|
||||||
lookahead == ' ')
|
|
||||||
SKIP(29);
|
|
||||||
if (lookahead != 0 &&
|
|
||||||
(lookahead < '<' || '>' < lookahead))
|
|
||||||
ADVANCE(30);
|
|
||||||
END_STATE();
|
|
||||||
case 30:
|
|
||||||
ACCEPT_TOKEN(sym_attribute_value);
|
ACCEPT_TOKEN(sym_attribute_value);
|
||||||
if (lookahead != 0 &&
|
if (lookahead != 0 &&
|
||||||
lookahead != '\t' &&
|
lookahead != '\t' &&
|
||||||
@ -494,64 +425,57 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
|
|||||||
lookahead != ' ' &&
|
lookahead != ' ' &&
|
||||||
lookahead != '"' &&
|
lookahead != '"' &&
|
||||||
lookahead != '\'' &&
|
lookahead != '\'' &&
|
||||||
(lookahead < '<' || '>' < lookahead))
|
(lookahead < '<' || '>' < lookahead)) ADVANCE(25);
|
||||||
ADVANCE(30);
|
END_STATE();
|
||||||
|
case 26:
|
||||||
|
ACCEPT_TOKEN(anon_sym_SQUOTE);
|
||||||
|
END_STATE();
|
||||||
|
case 27:
|
||||||
|
ACCEPT_TOKEN(aux_sym_quoted_attribute_value_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_quoted_attribute_value_token1);
|
||||||
|
if (lookahead != 0 &&
|
||||||
|
lookahead != '\'') ADVANCE(28);
|
||||||
|
END_STATE();
|
||||||
|
case 29:
|
||||||
|
ACCEPT_TOKEN(anon_sym_DQUOTE);
|
||||||
|
END_STATE();
|
||||||
|
case 30:
|
||||||
|
ACCEPT_TOKEN(aux_sym_quoted_attribute_value_token2);
|
||||||
|
if (lookahead == '\t' ||
|
||||||
|
lookahead == '\n' ||
|
||||||
|
lookahead == '\r' ||
|
||||||
|
lookahead == ' ') ADVANCE(30);
|
||||||
|
if (lookahead != 0 &&
|
||||||
|
lookahead != '"') ADVANCE(31);
|
||||||
END_STATE();
|
END_STATE();
|
||||||
case 31:
|
case 31:
|
||||||
if (lookahead == '"')
|
ACCEPT_TOKEN(aux_sym_quoted_attribute_value_token2);
|
||||||
ADVANCE(2);
|
if (lookahead != 0 &&
|
||||||
if (lookahead == '\t' ||
|
lookahead != '"') ADVANCE(31);
|
||||||
lookahead == '\n' ||
|
|
||||||
lookahead == '\r' ||
|
|
||||||
lookahead == ' ')
|
|
||||||
ADVANCE(32);
|
|
||||||
if (lookahead != 0)
|
|
||||||
ADVANCE(33);
|
|
||||||
END_STATE();
|
END_STATE();
|
||||||
case 32:
|
case 32:
|
||||||
ACCEPT_TOKEN(aux_sym_quoted_attribute_value_token2);
|
ACCEPT_TOKEN(sym_text);
|
||||||
if (lookahead == '\t' ||
|
if (lookahead == '\t' ||
|
||||||
lookahead == '\n' ||
|
lookahead == '\n' ||
|
||||||
lookahead == '\r' ||
|
lookahead == '\r' ||
|
||||||
lookahead == ' ')
|
lookahead == ' ') ADVANCE(32);
|
||||||
ADVANCE(32);
|
|
||||||
if (lookahead != 0 &&
|
if (lookahead != 0 &&
|
||||||
lookahead != '"')
|
lookahead != '<' &&
|
||||||
ADVANCE(33);
|
lookahead != '>') ADVANCE(33);
|
||||||
END_STATE();
|
END_STATE();
|
||||||
case 33:
|
case 33:
|
||||||
ACCEPT_TOKEN(aux_sym_quoted_attribute_value_token2);
|
ACCEPT_TOKEN(sym_text);
|
||||||
if (lookahead != 0 &&
|
if (lookahead != 0 &&
|
||||||
lookahead != '"')
|
lookahead != '<' &&
|
||||||
ADVANCE(33);
|
lookahead != '>') ADVANCE(33);
|
||||||
END_STATE();
|
|
||||||
case 34:
|
|
||||||
if (lookahead == '\'')
|
|
||||||
ADVANCE(3);
|
|
||||||
if (lookahead == '\t' ||
|
|
||||||
lookahead == '\n' ||
|
|
||||||
lookahead == '\r' ||
|
|
||||||
lookahead == ' ')
|
|
||||||
ADVANCE(35);
|
|
||||||
if (lookahead != 0)
|
|
||||||
ADVANCE(36);
|
|
||||||
END_STATE();
|
|
||||||
case 35:
|
|
||||||
ACCEPT_TOKEN(aux_sym_quoted_attribute_value_token1);
|
|
||||||
if (lookahead == '\t' ||
|
|
||||||
lookahead == '\n' ||
|
|
||||||
lookahead == '\r' ||
|
|
||||||
lookahead == ' ')
|
|
||||||
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();
|
END_STATE();
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
@ -560,99 +484,99 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
|
|||||||
|
|
||||||
static TSLexMode ts_lex_modes[STATE_COUNT] = {
|
static TSLexMode ts_lex_modes[STATE_COUNT] = {
|
||||||
[0] = {.lex_state = 0, .external_lex_state = 1},
|
[0] = {.lex_state = 0, .external_lex_state = 1},
|
||||||
[1] = {.lex_state = 18, .external_lex_state = 2},
|
[1] = {.lex_state = 1, .external_lex_state = 2},
|
||||||
[2] = {.lex_state = 0, .external_lex_state = 3},
|
[2] = {.lex_state = 0, .external_lex_state = 3},
|
||||||
[3] = {.lex_state = 0, .external_lex_state = 4},
|
[3] = {.lex_state = 0, .external_lex_state = 4},
|
||||||
[4] = {.lex_state = 21, .external_lex_state = 2},
|
[4] = {.lex_state = 0, .external_lex_state = 2},
|
||||||
[5] = {.lex_state = 18, .external_lex_state = 2},
|
[5] = {.lex_state = 1, .external_lex_state = 2},
|
||||||
[6] = {.lex_state = 18, .external_lex_state = 2},
|
[6] = {.lex_state = 1, .external_lex_state = 2},
|
||||||
[7] = {.lex_state = 0, .external_lex_state = 2},
|
[7] = {.lex_state = 0, .external_lex_state = 2},
|
||||||
[8] = {.lex_state = 18, .external_lex_state = 5},
|
[8] = {.lex_state = 1, .external_lex_state = 5},
|
||||||
[9] = {.lex_state = 22, .external_lex_state = 6},
|
[9] = {.lex_state = 0, .external_lex_state = 6},
|
||||||
[10] = {.lex_state = 22, .external_lex_state = 6},
|
[10] = {.lex_state = 0, .external_lex_state = 6},
|
||||||
[11] = {.lex_state = 24, .external_lex_state = 7},
|
[11] = {.lex_state = 5, .external_lex_state = 7},
|
||||||
[12] = {.lex_state = 24, .external_lex_state = 2},
|
[12] = {.lex_state = 5, .external_lex_state = 2},
|
||||||
[13] = {.lex_state = 24, .external_lex_state = 2},
|
[13] = {.lex_state = 5, .external_lex_state = 2},
|
||||||
[14] = {.lex_state = 24, .external_lex_state = 2},
|
[14] = {.lex_state = 0, .external_lex_state = 2},
|
||||||
[15] = {.lex_state = 26, .external_lex_state = 2},
|
[15] = {.lex_state = 13, .external_lex_state = 2},
|
||||||
[16] = {.lex_state = 18, .external_lex_state = 2},
|
[16] = {.lex_state = 1, .external_lex_state = 2},
|
||||||
[17] = {.lex_state = 0, .external_lex_state = 8},
|
[17] = {.lex_state = 0, .external_lex_state = 8},
|
||||||
[18] = {.lex_state = 18, .external_lex_state = 2},
|
[18] = {.lex_state = 1, .external_lex_state = 2},
|
||||||
[19] = {.lex_state = 18, .external_lex_state = 5},
|
[19] = {.lex_state = 1, .external_lex_state = 5},
|
||||||
[20] = {.lex_state = 0, .external_lex_state = 9},
|
[20] = {.lex_state = 0, .external_lex_state = 9},
|
||||||
[21] = {.lex_state = 22, .external_lex_state = 2},
|
[21] = {.lex_state = 0, .external_lex_state = 2},
|
||||||
[22] = {.lex_state = 18, .external_lex_state = 2},
|
[22] = {.lex_state = 1, .external_lex_state = 2},
|
||||||
[23] = {.lex_state = 22, .external_lex_state = 2},
|
[23] = {.lex_state = 0, .external_lex_state = 2},
|
||||||
[24] = {.lex_state = 18, .external_lex_state = 2},
|
[24] = {.lex_state = 1, .external_lex_state = 2},
|
||||||
[25] = {.lex_state = 24, .external_lex_state = 7},
|
[25] = {.lex_state = 5, .external_lex_state = 7},
|
||||||
[26] = {.lex_state = 18, .external_lex_state = 2},
|
[26] = {.lex_state = 1, .external_lex_state = 2},
|
||||||
[27] = {.lex_state = 18, .external_lex_state = 5},
|
[27] = {.lex_state = 1, .external_lex_state = 5},
|
||||||
[28] = {.lex_state = 24, .external_lex_state = 7},
|
[28] = {.lex_state = 5, .external_lex_state = 7},
|
||||||
[29] = {.lex_state = 22, .external_lex_state = 6},
|
[29] = {.lex_state = 0, .external_lex_state = 6},
|
||||||
[30] = {.lex_state = 24, .external_lex_state = 2},
|
[30] = {.lex_state = 5, .external_lex_state = 2},
|
||||||
[31] = {.lex_state = 22, .external_lex_state = 6},
|
[31] = {.lex_state = 0, .external_lex_state = 6},
|
||||||
[32] = {.lex_state = 24, .external_lex_state = 2},
|
[32] = {.lex_state = 5, .external_lex_state = 2},
|
||||||
[33] = {.lex_state = 18, .external_lex_state = 2},
|
[33] = {.lex_state = 1, .external_lex_state = 2},
|
||||||
[34] = {.lex_state = 24, .external_lex_state = 2},
|
[34] = {.lex_state = 0, .external_lex_state = 2},
|
||||||
[35] = {.lex_state = 24, .external_lex_state = 2},
|
[35] = {.lex_state = 0, .external_lex_state = 2},
|
||||||
[36] = {.lex_state = 18, .external_lex_state = 2},
|
[36] = {.lex_state = 1, .external_lex_state = 2},
|
||||||
[37] = {.lex_state = 18, .external_lex_state = 2},
|
[37] = {.lex_state = 1, .external_lex_state = 2},
|
||||||
[38] = {.lex_state = 18, .external_lex_state = 2},
|
[38] = {.lex_state = 1, .external_lex_state = 2},
|
||||||
[39] = {.lex_state = 29, .external_lex_state = 2},
|
[39] = {.lex_state = 2, .external_lex_state = 2},
|
||||||
[40] = {.lex_state = 18, .external_lex_state = 2},
|
[40] = {.lex_state = 1, .external_lex_state = 2},
|
||||||
[41] = {.lex_state = 18, .external_lex_state = 5},
|
[41] = {.lex_state = 1, .external_lex_state = 5},
|
||||||
[42] = {.lex_state = 24, .external_lex_state = 7},
|
[42] = {.lex_state = 5, .external_lex_state = 7},
|
||||||
[43] = {.lex_state = 22, .external_lex_state = 6},
|
[43] = {.lex_state = 0, .external_lex_state = 6},
|
||||||
[44] = {.lex_state = 22, .external_lex_state = 6},
|
[44] = {.lex_state = 0, .external_lex_state = 6},
|
||||||
[45] = {.lex_state = 18, .external_lex_state = 2},
|
[45] = {.lex_state = 1, .external_lex_state = 2},
|
||||||
[46] = {.lex_state = 18, .external_lex_state = 2},
|
[46] = {.lex_state = 1, .external_lex_state = 2},
|
||||||
[47] = {.lex_state = 31, .external_lex_state = 2},
|
[47] = {.lex_state = 3, .external_lex_state = 2},
|
||||||
[48] = {.lex_state = 24, .external_lex_state = 7},
|
[48] = {.lex_state = 5, .external_lex_state = 7},
|
||||||
[49] = {.lex_state = 34, .external_lex_state = 2},
|
[49] = {.lex_state = 4, .external_lex_state = 2},
|
||||||
[50] = {.lex_state = 24, .external_lex_state = 7},
|
[50] = {.lex_state = 5, .external_lex_state = 7},
|
||||||
[51] = {.lex_state = 29, .external_lex_state = 2},
|
[51] = {.lex_state = 0, .external_lex_state = 2},
|
||||||
[52] = {.lex_state = 29, .external_lex_state = 2},
|
[52] = {.lex_state = 0, .external_lex_state = 2},
|
||||||
[53] = {.lex_state = 24, .external_lex_state = 7},
|
[53] = {.lex_state = 5, .external_lex_state = 7},
|
||||||
[54] = {.lex_state = 18, .external_lex_state = 5},
|
[54] = {.lex_state = 1, .external_lex_state = 5},
|
||||||
[55] = {.lex_state = 18, .external_lex_state = 5},
|
[55] = {.lex_state = 1, .external_lex_state = 5},
|
||||||
[56] = {.lex_state = 18, .external_lex_state = 5},
|
[56] = {.lex_state = 1, .external_lex_state = 5},
|
||||||
[57] = {.lex_state = 18, .external_lex_state = 5},
|
[57] = {.lex_state = 1, .external_lex_state = 5},
|
||||||
[58] = {.lex_state = 18, .external_lex_state = 5},
|
[58] = {.lex_state = 1, .external_lex_state = 5},
|
||||||
[59] = {.lex_state = 24, .external_lex_state = 2},
|
[59] = {.lex_state = 5, .external_lex_state = 2},
|
||||||
[60] = {.lex_state = 18, .external_lex_state = 5},
|
[60] = {.lex_state = 1, .external_lex_state = 5},
|
||||||
[61] = {.lex_state = 18, .external_lex_state = 5},
|
[61] = {.lex_state = 1, .external_lex_state = 5},
|
||||||
[62] = {.lex_state = 18, .external_lex_state = 5},
|
[62] = {.lex_state = 1, .external_lex_state = 5},
|
||||||
[63] = {.lex_state = 18, .external_lex_state = 5},
|
[63] = {.lex_state = 1, .external_lex_state = 5},
|
||||||
[64] = {.lex_state = 18, .external_lex_state = 5},
|
[64] = {.lex_state = 1, .external_lex_state = 5},
|
||||||
[65] = {.lex_state = 18, .external_lex_state = 5},
|
[65] = {.lex_state = 1, .external_lex_state = 5},
|
||||||
[66] = {.lex_state = 24, .external_lex_state = 2},
|
[66] = {.lex_state = 5, .external_lex_state = 2},
|
||||||
[67] = {.lex_state = 18, .external_lex_state = 5},
|
[67] = {.lex_state = 1, .external_lex_state = 5},
|
||||||
[68] = {.lex_state = 18, .external_lex_state = 5},
|
[68] = {.lex_state = 1, .external_lex_state = 5},
|
||||||
[69] = {.lex_state = 24, .external_lex_state = 2},
|
[69] = {.lex_state = 5, .external_lex_state = 2},
|
||||||
[70] = {.lex_state = 24, .external_lex_state = 2},
|
[70] = {.lex_state = 5, .external_lex_state = 2},
|
||||||
[71] = {.lex_state = 24, .external_lex_state = 2},
|
[71] = {.lex_state = 5, .external_lex_state = 2},
|
||||||
[72] = {.lex_state = 18, .external_lex_state = 5},
|
[72] = {.lex_state = 1, .external_lex_state = 5},
|
||||||
[73] = {.lex_state = 22, .external_lex_state = 6},
|
[73] = {.lex_state = 0, .external_lex_state = 6},
|
||||||
[74] = {.lex_state = 22, .external_lex_state = 6},
|
[74] = {.lex_state = 0, .external_lex_state = 6},
|
||||||
[75] = {.lex_state = 24, .external_lex_state = 7},
|
[75] = {.lex_state = 5, .external_lex_state = 7},
|
||||||
[76] = {.lex_state = 24, .external_lex_state = 2},
|
[76] = {.lex_state = 0, .external_lex_state = 2},
|
||||||
[77] = {.lex_state = 18, .external_lex_state = 5},
|
[77] = {.lex_state = 1, .external_lex_state = 5},
|
||||||
[78] = {.lex_state = 22, .external_lex_state = 2},
|
[78] = {.lex_state = 0, .external_lex_state = 2},
|
||||||
[79] = {.lex_state = 22, .external_lex_state = 2},
|
[79] = {.lex_state = 0, .external_lex_state = 2},
|
||||||
[80] = {.lex_state = 24, .external_lex_state = 7},
|
[80] = {.lex_state = 5, .external_lex_state = 7},
|
||||||
[81] = {.lex_state = 24, .external_lex_state = 2},
|
[81] = {.lex_state = 0, .external_lex_state = 2},
|
||||||
[82] = {.lex_state = 24, .external_lex_state = 2},
|
[82] = {.lex_state = 0, .external_lex_state = 2},
|
||||||
[83] = {.lex_state = 29, .external_lex_state = 2},
|
[83] = {.lex_state = 2, .external_lex_state = 2},
|
||||||
[84] = {.lex_state = 31, .external_lex_state = 2},
|
[84] = {.lex_state = 3, .external_lex_state = 2},
|
||||||
[85] = {.lex_state = 34, .external_lex_state = 2},
|
[85] = {.lex_state = 4, .external_lex_state = 2},
|
||||||
[86] = {.lex_state = 29, .external_lex_state = 2},
|
[86] = {.lex_state = 0, .external_lex_state = 2},
|
||||||
[87] = {.lex_state = 29, .external_lex_state = 2},
|
[87] = {.lex_state = 0, .external_lex_state = 2},
|
||||||
[88] = {.lex_state = 0, .external_lex_state = 3},
|
[88] = {.lex_state = 0, .external_lex_state = 3},
|
||||||
[89] = {.lex_state = 0, .external_lex_state = 4},
|
[89] = {.lex_state = 0, .external_lex_state = 4},
|
||||||
[90] = {.lex_state = 26, .external_lex_state = 2},
|
[90] = {.lex_state = 13, .external_lex_state = 2},
|
||||||
[91] = {.lex_state = 0, .external_lex_state = 8},
|
[91] = {.lex_state = 0, .external_lex_state = 8},
|
||||||
[92] = {.lex_state = 0, .external_lex_state = 9},
|
[92] = {.lex_state = 0, .external_lex_state = 9},
|
||||||
[93] = {.lex_state = 21, .external_lex_state = 2},
|
[93] = {.lex_state = 0, .external_lex_state = 2},
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
@ -122,20 +122,24 @@ struct TSLanguage {
|
|||||||
|
|
||||||
#define START_LEXER() \
|
#define START_LEXER() \
|
||||||
bool result = false; \
|
bool result = false; \
|
||||||
|
bool skip = false; \
|
||||||
int32_t lookahead; \
|
int32_t lookahead; \
|
||||||
|
goto start; \
|
||||||
next_state: \
|
next_state: \
|
||||||
|
lexer->advance(lexer, skip); \
|
||||||
|
start: \
|
||||||
|
skip = false; \
|
||||||
lookahead = lexer->lookahead;
|
lookahead = lexer->lookahead;
|
||||||
|
|
||||||
#define ADVANCE(state_value) \
|
#define ADVANCE(state_value) \
|
||||||
{ \
|
{ \
|
||||||
lexer->advance(lexer, false); \
|
|
||||||
state = state_value; \
|
state = state_value; \
|
||||||
goto next_state; \
|
goto next_state; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SKIP(state_value) \
|
#define SKIP(state_value) \
|
||||||
{ \
|
{ \
|
||||||
lexer->advance(lexer, true); \
|
skip = true; \
|
||||||
state = state_value; \
|
state = state_value; \
|
||||||
goto next_state; \
|
goto next_state; \
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user