aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-09-14 18:10:53 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-09-14 18:10:53 +0200
commitcde4f74ed9dffa1415d9021c343eb599e8866b4d (patch)
tree68cd8ec7ed3458515736ef825abcf39979602338
parentc549d8b3bbbade9ccb8c208295b35f5afbc7913b (diff)
Update the grammar a bit
-rw-r--r--Cargo.toml2
-rw-r--r--bindings/go/binding_test.go4
-rw-r--r--bindings/go/go.mod5
-rw-r--r--bindings/python/tree_sitter_gsp/binding.c4
-rw-r--r--bindings/rust/lib.rs39
-rw-r--r--grammar.js17
-rw-r--r--package.json5
-rw-r--r--src/grammar.json94
-rw-r--r--src/node-types.json39
-rw-r--r--src/parser.c1392
-rw-r--r--src/tree_sitter/parser.h1
11 files changed, 1109 insertions, 493 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 7d7e3e8..73e8aa5 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -20,7 +20,7 @@ include = [
path = "bindings/rust/lib.rs"
[dependencies]
-tree-sitter = "~0.20.10"
+tree-sitter-language = "0.1.0"
[build-dependencies]
cc = "1.0"
diff --git a/bindings/go/binding_test.go b/bindings/go/binding_test.go
index c4efff1..6e7fa2e 100644
--- a/bindings/go/binding_test.go
+++ b/bindings/go/binding_test.go
@@ -3,8 +3,8 @@ package tree_sitter_gsp_test
import (
"testing"
- tree_sitter "github.com/smacker/go-tree-sitter"
- "github.com/tree-sitter/tree-sitter-gsp"
+ tree_sitter "github.com/tree-sitter/go-tree-sitter"
+ tree_sitter_gsp "github.com/tree-sitter/tree-sitter-gsp/bindings/go"
)
func TestCanLoadGrammar(t *testing.T) {
diff --git a/bindings/go/go.mod b/bindings/go/go.mod
deleted file mode 100644
index 38c34a6..0000000
--- a/bindings/go/go.mod
+++ /dev/null
@@ -1,5 +0,0 @@
-module github.com/tree-sitter/tree-sitter-gsp
-
-go 1.22
-
-require github.com/smacker/go-tree-sitter v0.0.0-20230720070738-0d0a9f78d8f8
diff --git a/bindings/python/tree_sitter_gsp/binding.c b/bindings/python/tree_sitter_gsp/binding.c
index 569c1dc..f645ec7 100644
--- a/bindings/python/tree_sitter_gsp/binding.c
+++ b/bindings/python/tree_sitter_gsp/binding.c
@@ -4,8 +4,8 @@ typedef struct TSLanguage TSLanguage;
TSLanguage *tree_sitter_gsp(void);
-static PyObject* _binding_language(PyObject *self, PyObject *args) {
- return PyLong_FromVoidPtr(tree_sitter_gsp());
+static PyObject* _binding_language(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(args)) {
+ return PyCapsule_New(tree_sitter_gsp(), "tree_sitter.Language", NULL);
}
static PyMethodDef methods[] = {
diff --git a/bindings/rust/lib.rs b/bindings/rust/lib.rs
index d058c81..d932d50 100644
--- a/bindings/rust/lib.rs
+++ b/bindings/rust/lib.rs
@@ -1,13 +1,18 @@
-//! This crate provides gsp language support for the [tree-sitter][] parsing library.
+//! This crate provides Gsp language support for the [tree-sitter][] parsing library.
//!
//! Typically, you will use the [language][language func] function to add this language to a
//! tree-sitter [Parser][], and then use the parser to parse some code:
//!
//! ```
-//! let code = "";
+//! let code = r#"
+//! "#;
//! let mut parser = tree_sitter::Parser::new();
-//! parser.set_language(tree_sitter_gsp::language()).expect("Error loading gsp grammar");
+//! let language = tree_sitter_gsp::LANGUAGE;
+//! parser
+//! .set_language(&language.into())
+//! .expect("Error loading Gsp parser");
//! let tree = parser.parse(code, None).unwrap();
+//! assert!(!tree.root_node().has_error());
//! ```
//!
//! [Language]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Language.html
@@ -15,30 +20,26 @@
//! [Parser]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Parser.html
//! [tree-sitter]: https://tree-sitter.github.io/
-use tree_sitter::Language;
+use tree_sitter_language::LanguageFn;
extern "C" {
- fn tree_sitter_gsp() -> Language;
+ fn tree_sitter_gsp() -> *const ();
}
-/// Get the tree-sitter [Language][] for this grammar.
-///
-/// [Language]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Language.html
-pub fn language() -> Language {
- unsafe { tree_sitter_gsp() }
-}
+/// The tree-sitter [`LanguageFn`] for this grammar.
+pub const LANGUAGE: LanguageFn = unsafe { LanguageFn::from_raw(tree_sitter_gsp) };
/// The content of the [`node-types.json`][] file for this grammar.
///
/// [`node-types.json`]: https://tree-sitter.github.io/tree-sitter/using-parsers#static-node-types
-pub const NODE_TYPES: &'static str = include_str!("../../src/node-types.json");
+pub const NODE_TYPES: &str = include_str!("../../src/node-types.json");
-// Uncomment these to include any queries that this grammar contains
+// NOTE: uncomment these to include any queries that this grammar contains:
-// pub const HIGHLIGHTS_QUERY: &'static str = include_str!("../../queries/highlights.scm");
-// pub const INJECTIONS_QUERY: &'static str = include_str!("../../queries/injections.scm");
-// pub const LOCALS_QUERY: &'static str = include_str!("../../queries/locals.scm");
-// pub const TAGS_QUERY: &'static str = include_str!("../../queries/tags.scm");
+// pub const HIGHLIGHTS_QUERY: &str = include_str!("../../queries/highlights.scm");
+// pub const INJECTIONS_QUERY: &str = include_str!("../../queries/injections.scm");
+// pub const LOCALS_QUERY: &str = include_str!("../../queries/locals.scm");
+// pub const TAGS_QUERY: &str = include_str!("../../queries/tags.scm");
#[cfg(test)]
mod tests {
@@ -46,7 +47,7 @@ mod tests {
fn test_can_load_grammar() {
let mut parser = tree_sitter::Parser::new();
parser
- .set_language(super::language())
- .expect("Error loading gsp language");
+ .set_language(&super::LANGUAGE.into())
+ .expect("Error loading Gsp parser");
}
}
diff --git a/grammar.js b/grammar.js
index f01e720..0f13c6b 100644
--- a/grammar.js
+++ b/grammar.js
@@ -2,7 +2,16 @@ module.exports = grammar({
name: 'gsp',
extras: $ => [$._S],
rules: {
- source_file: $ => repeat($.node),
+ source_file: $ => repeat(choice($.comment, $.node)),
+
+ comment: $ => seq(
+ '/',
+ optional($.node_name),
+ optional($.attribute_list),
+ '{',
+ optional($.node_body),
+ '}',
+ ),
node: $ => seq(
optional('>'),
@@ -14,16 +23,16 @@ module.exports = grammar({
),
node_body: $ => choice(
- repeat1($.node),
+ repeat1(choice($.comment, $.node)),
seq(choice('-', '='), optional($.text)),
),
- node_name: $ => /[\/a-zA-Z:_\u{000C0}-\u{000D6}\u{000D8}-\u{000F6}\u{000F8}-\u{002FF}\u{00370}-\u{0037D}\u{0037F}-\u{01FFF}\u{0200C}-\u{0200D}\u{02070}-\u{0218F}\u{02C00}-\u{02FEF}\u{03001}-\u{0D7FF}\u{0F900}-\u{0FDCF}\u{0FDF0}-\u{0FFFD}\u{10000}-\u{EFFFF}][a-zA-Z0-9:_\-.·\u{00300}-\u{0036F}\u{0203F}-\u{02040}\u{000C0}-\u{000D6}\u{000D8}-\u{000F6}\u{000F8}-\u{002FF}\u{00370}-\u{0037D}\u{0037F}-\u{01FFF}\u{0200C}-\u{0200D}\u{02070}-\u{0218F}\u{02C00}-\u{02FEF}\u{03001}-\u{0D7FF}\u{0F900}-\u{0FDCF}\u{0FDF0}-\u{0FFFD}\u{10000}-\u{EFFFF}]*/u,
+ node_name: $ => /[a-zA-Z:_\u{000C0}-\u{000D6}\u{000D8}-\u{000F6}\u{000F8}-\u{002FF}\u{00370}-\u{0037D}\u{0037F}-\u{01FFF}\u{0200C}-\u{0200D}\u{02070}-\u{0218F}\u{02C00}-\u{02FEF}\u{03001}-\u{0D7FF}\u{0F900}-\u{0FDCF}\u{0FDF0}-\u{0FFFD}\u{10000}-\u{EFFFF}][a-zA-Z0-9:_\-.·\u{00300}-\u{0036F}\u{0203F}-\u{02040}\u{000C0}-\u{000D6}\u{000D8}-\u{000F6}\u{000F8}-\u{002FF}\u{00370}-\u{0037D}\u{0037F}-\u{01FFF}\u{0200C}-\u{0200D}\u{02070}-\u{0218F}\u{02C00}-\u{02FEF}\u{03001}-\u{0D7FF}\u{0F900}-\u{0FDCF}\u{0FDF0}-\u{0FFFD}\u{10000}-\u{EFFFF}]*/u,
text: $ => repeat1(
choice(
$.literal_text,
- seq('@', $.node),
+ seq('@', choice($.comment, $.node)),
),
),
diff --git a/package.json b/package.json
index 09b9b1f..aedb861 100644
--- a/package.json
+++ b/package.json
@@ -5,9 +5,10 @@
"main": "bindings/node",
"types": "bindings/node",
"scripts": {
- "test": "echo \"Error: no test specified\" && exit 1",
"install": "node-gyp-build",
- "prebuildify": "prebuildify --napi --strip"
+ "prestart": "tree-sitter build --wasm",
+ "start": "tree-sitter playground",
+ "test": "node --test bindings/node/*_test.js"
},
"repository": {
"type": "git",
diff --git a/src/grammar.json b/src/grammar.json
index 7809ff6..ad8dfcb 100644
--- a/src/grammar.json
+++ b/src/grammar.json
@@ -4,10 +4,72 @@
"source_file": {
"type": "REPEAT",
"content": {
- "type": "SYMBOL",
- "name": "node"
+ "type": "CHOICE",
+ "members": [
+ {
+ "type": "SYMBOL",
+ "name": "comment"
+ },
+ {
+ "type": "SYMBOL",
+ "name": "node"
+ }
+ ]
}
},
+ "comment": {
+ "type": "SEQ",
+ "members": [
+ {
+ "type": "STRING",
+ "value": "/"
+ },
+ {
+ "type": "CHOICE",
+ "members": [
+ {
+ "type": "SYMBOL",
+ "name": "node_name"
+ },
+ {
+ "type": "BLANK"
+ }
+ ]
+ },
+ {
+ "type": "CHOICE",
+ "members": [
+ {
+ "type": "SYMBOL",
+ "name": "attribute_list"
+ },
+ {
+ "type": "BLANK"
+ }
+ ]
+ },
+ {
+ "type": "STRING",
+ "value": "{"
+ },
+ {
+ "type": "CHOICE",
+ "members": [
+ {
+ "type": "SYMBOL",
+ "name": "node_body"
+ },
+ {
+ "type": "BLANK"
+ }
+ ]
+ },
+ {
+ "type": "STRING",
+ "value": "}"
+ }
+ ]
+ },
"node": {
"type": "SEQ",
"members": [
@@ -67,8 +129,17 @@
{
"type": "REPEAT1",
"content": {
- "type": "SYMBOL",
- "name": "node"
+ "type": "CHOICE",
+ "members": [
+ {
+ "type": "SYMBOL",
+ "name": "comment"
+ },
+ {
+ "type": "SYMBOL",
+ "name": "node"
+ }
+ ]
}
},
{
@@ -105,7 +176,7 @@
},
"node_name": {
"type": "PATTERN",
- "value": "[\\/a-zA-Z:_\\u{000C0}-\\u{000D6}\\u{000D8}-\\u{000F6}\\u{000F8}-\\u{002FF}\\u{00370}-\\u{0037D}\\u{0037F}-\\u{01FFF}\\u{0200C}-\\u{0200D}\\u{02070}-\\u{0218F}\\u{02C00}-\\u{02FEF}\\u{03001}-\\u{0D7FF}\\u{0F900}-\\u{0FDCF}\\u{0FDF0}-\\u{0FFFD}\\u{10000}-\\u{EFFFF}][a-zA-Z0-9:_\\-.·\\u{00300}-\\u{0036F}\\u{0203F}-\\u{02040}\\u{000C0}-\\u{000D6}\\u{000D8}-\\u{000F6}\\u{000F8}-\\u{002FF}\\u{00370}-\\u{0037D}\\u{0037F}-\\u{01FFF}\\u{0200C}-\\u{0200D}\\u{02070}-\\u{0218F}\\u{02C00}-\\u{02FEF}\\u{03001}-\\u{0D7FF}\\u{0F900}-\\u{0FDCF}\\u{0FDF0}-\\u{0FFFD}\\u{10000}-\\u{EFFFF}]*",
+ "value": "[a-zA-Z:_\\u{000C0}-\\u{000D6}\\u{000D8}-\\u{000F6}\\u{000F8}-\\u{002FF}\\u{00370}-\\u{0037D}\\u{0037F}-\\u{01FFF}\\u{0200C}-\\u{0200D}\\u{02070}-\\u{0218F}\\u{02C00}-\\u{02FEF}\\u{03001}-\\u{0D7FF}\\u{0F900}-\\u{0FDCF}\\u{0FDF0}-\\u{0FFFD}\\u{10000}-\\u{EFFFF}][a-zA-Z0-9:_\\-.·\\u{00300}-\\u{0036F}\\u{0203F}-\\u{02040}\\u{000C0}-\\u{000D6}\\u{000D8}-\\u{000F6}\\u{000F8}-\\u{002FF}\\u{00370}-\\u{0037D}\\u{0037F}-\\u{01FFF}\\u{0200C}-\\u{0200D}\\u{02070}-\\u{0218F}\\u{02C00}-\\u{02FEF}\\u{03001}-\\u{0D7FF}\\u{0F900}-\\u{0FDCF}\\u{0FDF0}-\\u{0FFFD}\\u{10000}-\\u{EFFFF}]*",
"flags": "u"
},
"text": {
@@ -125,8 +196,17 @@
"value": "@"
},
{
- "type": "SYMBOL",
- "name": "node"
+ "type": "CHOICE",
+ "members": [
+ {
+ "type": "SYMBOL",
+ "name": "comment"
+ },
+ {
+ "type": "SYMBOL",
+ "name": "node"
+ }
+ ]
}
]
}
diff --git a/src/node-types.json b/src/node-types.json
index 3a77c7d..ebd7712 100644
--- a/src/node-types.json
+++ b/src/node-types.json
@@ -42,6 +42,29 @@
}
},
{
+ "type": "comment",
+ "named": true,
+ "fields": {},
+ "children": {
+ "multiple": true,
+ "required": false,
+ "types": [
+ {
+ "type": "attribute_list",
+ "named": true
+ },
+ {
+ "type": "node_body",
+ "named": true
+ },
+ {
+ "type": "node_name",
+ "named": true
+ }
+ ]
+ }
+ },
+ {
"type": "node",
"named": true,
"fields": {},
@@ -73,6 +96,10 @@
"required": false,
"types": [
{
+ "type": "comment",
+ "named": true
+ },
+ {
"type": "node",
"named": true
},
@@ -92,6 +119,10 @@
"required": false,
"types": [
{
+ "type": "comment",
+ "named": true
+ },
+ {
"type": "node",
"named": true
}
@@ -107,6 +138,10 @@
"required": true,
"types": [
{
+ "type": "comment",
+ "named": true
+ },
+ {
"type": "literal_text",
"named": true
},
@@ -122,6 +157,10 @@
"named": false
},
{
+ "type": "/",
+ "named": false
+ },
+ {
"type": "=",
"named": false
},
diff --git a/src/parser.c b/src/parser.c
index 47501ef..8de1730 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -5,46 +5,49 @@
#endif
#define LANGUAGE_VERSION 14
-#define STATE_COUNT 48
+#define STATE_COUNT 76
#define LARGE_STATE_COUNT 2
-#define SYMBOL_COUNT 23
+#define SYMBOL_COUNT 25
#define ALIAS_COUNT 0
-#define TOKEN_COUNT 14
+#define TOKEN_COUNT 15
#define EXTERNAL_TOKEN_COUNT 0
#define FIELD_COUNT 0
#define MAX_ALIAS_SEQUENCE_LENGTH 6
#define PRODUCTION_ID_COUNT 1
enum ts_symbol_identifiers {
- anon_sym_GT = 1,
+ anon_sym_SLASH = 1,
anon_sym_LBRACE = 2,
anon_sym_RBRACE = 3,
- anon_sym_DASH = 4,
- anon_sym_EQ = 5,
- sym_node_name = 6,
- anon_sym_AT = 7,
- sym_literal_text = 8,
- sym_class_shorthand = 9,
- sym_id_shorthand = 10,
- sym_attribute_name = 11,
- sym_attribute_value = 12,
- sym__S = 13,
- sym_source_file = 14,
- sym_node = 15,
- sym_node_body = 16,
- sym_text = 17,
- sym_attribute_list = 18,
- sym_attribute = 19,
- aux_sym_source_file_repeat1 = 20,
- aux_sym_text_repeat1 = 21,
- aux_sym_attribute_list_repeat1 = 22,
+ anon_sym_GT = 4,
+ anon_sym_DASH = 5,
+ anon_sym_EQ = 6,
+ sym_node_name = 7,
+ anon_sym_AT = 8,
+ sym_literal_text = 9,
+ sym_class_shorthand = 10,
+ sym_id_shorthand = 11,
+ sym_attribute_name = 12,
+ sym_attribute_value = 13,
+ sym__S = 14,
+ sym_source_file = 15,
+ sym_comment = 16,
+ sym_node = 17,
+ sym_node_body = 18,
+ sym_text = 19,
+ sym_attribute_list = 20,
+ sym_attribute = 21,
+ aux_sym_source_file_repeat1 = 22,
+ aux_sym_text_repeat1 = 23,
+ aux_sym_attribute_list_repeat1 = 24,
};
static const char * const ts_symbol_names[] = {
[ts_builtin_sym_end] = "end",
- [anon_sym_GT] = ">",
+ [anon_sym_SLASH] = "/",
[anon_sym_LBRACE] = "{",
[anon_sym_RBRACE] = "}",
+ [anon_sym_GT] = ">",
[anon_sym_DASH] = "-",
[anon_sym_EQ] = "=",
[sym_node_name] = "node_name",
@@ -56,6 +59,7 @@ static const char * const ts_symbol_names[] = {
[sym_attribute_value] = "attribute_value",
[sym__S] = "_S",
[sym_source_file] = "source_file",
+ [sym_comment] = "comment",
[sym_node] = "node",
[sym_node_body] = "node_body",
[sym_text] = "text",
@@ -68,9 +72,10 @@ static const char * const ts_symbol_names[] = {
static const TSSymbol ts_symbol_map[] = {
[ts_builtin_sym_end] = ts_builtin_sym_end,
- [anon_sym_GT] = anon_sym_GT,
+ [anon_sym_SLASH] = anon_sym_SLASH,
[anon_sym_LBRACE] = anon_sym_LBRACE,
[anon_sym_RBRACE] = anon_sym_RBRACE,
+ [anon_sym_GT] = anon_sym_GT,
[anon_sym_DASH] = anon_sym_DASH,
[anon_sym_EQ] = anon_sym_EQ,
[sym_node_name] = sym_node_name,
@@ -82,6 +87,7 @@ static const TSSymbol ts_symbol_map[] = {
[sym_attribute_value] = sym_attribute_value,
[sym__S] = sym__S,
[sym_source_file] = sym_source_file,
+ [sym_comment] = sym_comment,
[sym_node] = sym_node,
[sym_node_body] = sym_node_body,
[sym_text] = sym_text,
@@ -97,7 +103,7 @@ static const TSSymbolMetadata ts_symbol_metadata[] = {
.visible = false,
.named = true,
},
- [anon_sym_GT] = {
+ [anon_sym_SLASH] = {
.visible = true,
.named = false,
},
@@ -109,6 +115,10 @@ static const TSSymbolMetadata ts_symbol_metadata[] = {
.visible = true,
.named = false,
},
+ [anon_sym_GT] = {
+ .visible = true,
+ .named = false,
+ },
[anon_sym_DASH] = {
.visible = true,
.named = false,
@@ -153,6 +163,10 @@ static const TSSymbolMetadata ts_symbol_metadata[] = {
.visible = true,
.named = true,
},
+ [sym_comment] = {
+ .visible = true,
+ .named = true,
+ },
[sym_node] = {
.visible = true,
.named = true,
@@ -200,56 +214,83 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = {
[1] = 1,
[2] = 2,
[3] = 3,
- [4] = 4,
- [5] = 3,
- [6] = 4,
- [7] = 2,
+ [4] = 2,
+ [5] = 5,
+ [6] = 6,
+ [7] = 5,
[8] = 8,
[9] = 9,
- [10] = 9,
- [11] = 8,
- [12] = 12,
- [13] = 13,
+ [10] = 3,
+ [11] = 9,
+ [12] = 8,
+ [13] = 6,
[14] = 14,
- [15] = 15,
+ [15] = 14,
[16] = 16,
[17] = 17,
[18] = 18,
- [19] = 19,
+ [19] = 18,
[20] = 20,
[21] = 21,
[22] = 22,
- [23] = 23,
- [24] = 24,
+ [23] = 22,
+ [24] = 21,
[25] = 25,
[26] = 26,
[27] = 27,
[28] = 28,
- [29] = 20,
- [30] = 22,
- [31] = 19,
- [32] = 21,
+ [29] = 29,
+ [30] = 30,
+ [31] = 31,
+ [32] = 32,
[33] = 33,
[34] = 34,
[35] = 35,
[36] = 36,
[37] = 37,
[38] = 38,
- [39] = 38,
- [40] = 36,
+ [39] = 39,
+ [40] = 40,
[41] = 41,
- [42] = 34,
- [43] = 43,
+ [42] = 35,
+ [43] = 37,
[44] = 44,
- [45] = 43,
- [46] = 41,
- [47] = 35,
+ [45] = 36,
+ [46] = 28,
+ [47] = 32,
+ [48] = 34,
+ [49] = 31,
+ [50] = 33,
+ [51] = 51,
+ [52] = 52,
+ [53] = 53,
+ [54] = 54,
+ [55] = 55,
+ [56] = 56,
+ [57] = 51,
+ [58] = 58,
+ [59] = 59,
+ [60] = 60,
+ [61] = 61,
+ [62] = 62,
+ [63] = 62,
+ [64] = 60,
+ [65] = 53,
+ [66] = 54,
+ [67] = 67,
+ [68] = 61,
+ [69] = 69,
+ [70] = 67,
+ [71] = 71,
+ [72] = 52,
+ [73] = 58,
+ [74] = 55,
+ [75] = 59,
};
static TSCharacterRange sym_node_name_character_set_1[] = {
- {'/', '/'}, {':', ':'}, {'A', 'Z'}, {'_', '_'}, {'a', 'z'}, {0xc0, 0xd6}, {0xd8, 0xf6}, {0xf8, 0x2ff},
- {0x370, 0x37d}, {0x37f, 0x1fff}, {0x200c, 0x200d}, {0x2070, 0x218f}, {0x2c00, 0x2fef}, {0x3001, 0xd7ff}, {0xf900, 0xfdcf}, {0xfdf0, 0xfffd},
- {0x10000, 0xeffff},
+ {':', ':'}, {'A', 'Z'}, {'_', '_'}, {'a', 'z'}, {0xc0, 0xd6}, {0xd8, 0xf6}, {0xf8, 0x2ff}, {0x370, 0x37d},
+ {0x37f, 0x1fff}, {0x200c, 0x200d}, {0x2070, 0x218f}, {0x2c00, 0x2fef}, {0x3001, 0xd7ff}, {0xf900, 0xfdcf}, {0xfdf0, 0xfffd}, {0x10000, 0xeffff},
};
static TSCharacterRange sym_node_name_character_set_2[] = {
@@ -273,132 +314,158 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
eof = lexer->eof(lexer);
switch (state) {
case 0:
- if (eof) ADVANCE(8);
+ if (eof) ADVANCE(9);
ADVANCE_MAP(
'"', 1,
- '#', 4,
- '-', 12,
- '.', 5,
- '=', 13,
- '>', 9,
- '@', 16,
- '{', 10,
- '}', 11,
- 0x1680, 14,
+ '#', 5,
+ '-', 14,
+ '.', 6,
+ '/', 10,
+ '=', 15,
+ '>', 13,
+ '@', 19,
+ '{', 11,
+ '}', 12,
+ 0x1680, 16,
);
- if (set_contains(sym__S_character_set_1, 10, lookahead)) ADVANCE(23);
- if (set_contains(sym_node_name_character_set_1, 17, lookahead)) ADVANCE(15);
+ if (set_contains(sym__S_character_set_1, 10, lookahead)) ADVANCE(26);
+ if (set_contains(sym_node_name_character_set_1, 16, lookahead)) ADVANCE(18);
END_STATE();
case 1:
- if (lookahead == '"') ADVANCE(22);
- if (lookahead == '\\') ADVANCE(6);
+ if (lookahead == '"') ADVANCE(25);
+ if (lookahead == '\\') ADVANCE(7);
if (lookahead != 0) ADVANCE(1);
END_STATE();
case 2:
- if (lookahead == '@') ADVANCE(16);
- if (lookahead == '\\') ADVANCE(3);
- if (lookahead == '}') ADVANCE(11);
- if (set_contains(sym__S_character_set_1, 10, lookahead)) ADVANCE(17);
- if (lookahead != 0) ADVANCE(18);
+ if (lookahead == '#') ADVANCE(5);
+ if (lookahead == '.') ADVANCE(6);
+ if (lookahead == '{') ADVANCE(11);
+ if (lookahead == 0x1680) ADVANCE(16);
+ if (lookahead == '-' ||
+ ('0' <= lookahead && lookahead <= '9')) ADVANCE(24);
+ if (set_contains(sym__S_character_set_1, 10, lookahead)) ADVANCE(26);
+ if (('A' <= lookahead && lookahead <= 'Z') ||
+ lookahead == '_' ||
+ ('a' <= lookahead && lookahead <= 'z')) ADVANCE(17);
+ if (set_contains(sym_node_name_character_set_1, 16, lookahead)) ADVANCE(18);
END_STATE();
case 3:
- if (lookahead == '@' ||
- lookahead == '\\' ||
- lookahead == '}') ADVANCE(18);
+ if (lookahead == '@') ADVANCE(19);
+ if (lookahead == '\\') ADVANCE(4);
+ if (lookahead == '}') ADVANCE(12);
+ if (set_contains(sym__S_character_set_1, 10, lookahead)) ADVANCE(20);
+ if (lookahead != 0) ADVANCE(21);
END_STATE();
case 4:
- if ((!eof && set_contains(sym_class_shorthand_character_set_1, 11, lookahead))) ADVANCE(20);
+ if (lookahead == '@' ||
+ lookahead == '\\' ||
+ lookahead == '}') ADVANCE(21);
END_STATE();
case 5:
- if ((!eof && set_contains(sym_class_shorthand_character_set_1, 11, lookahead))) ADVANCE(19);
+ if ((!eof && set_contains(sym_class_shorthand_character_set_1, 11, lookahead))) ADVANCE(23);
END_STATE();
case 6:
+ if ((!eof && set_contains(sym_class_shorthand_character_set_1, 11, lookahead))) ADVANCE(22);
+ END_STATE();
+ case 7:
if (lookahead != 0 &&
lookahead != '\n') ADVANCE(1);
END_STATE();
- case 7:
- if (eof) ADVANCE(8);
+ case 8:
+ if (eof) ADVANCE(9);
if (lookahead == '"') ADVANCE(1);
- if (lookahead == '#') ADVANCE(4);
- if (lookahead == '.') ADVANCE(5);
- if (lookahead == '=') ADVANCE(13);
- if (lookahead == '{') ADVANCE(10);
- if (lookahead == '}') ADVANCE(11);
- if (set_contains(sym__S_character_set_1, 10, lookahead)) ADVANCE(23);
+ if (lookahead == '#') ADVANCE(5);
+ if (lookahead == '.') ADVANCE(6);
+ if (lookahead == '=') ADVANCE(15);
+ if (lookahead == '{') ADVANCE(11);
+ if (lookahead == '}') ADVANCE(12);
+ if (set_contains(sym__S_character_set_1, 10, lookahead)) ADVANCE(26);
if (lookahead == '-' ||
('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' ||
- ('a' <= lookahead && lookahead <= 'z')) ADVANCE(21);
- END_STATE();
- case 8:
- ACCEPT_TOKEN(ts_builtin_sym_end);
+ ('a' <= lookahead && lookahead <= 'z')) ADVANCE(24);
END_STATE();
case 9:
- ACCEPT_TOKEN(anon_sym_GT);
+ ACCEPT_TOKEN(ts_builtin_sym_end);
END_STATE();
case 10:
- ACCEPT_TOKEN(anon_sym_LBRACE);
+ ACCEPT_TOKEN(anon_sym_SLASH);
END_STATE();
case 11:
- ACCEPT_TOKEN(anon_sym_RBRACE);
+ ACCEPT_TOKEN(anon_sym_LBRACE);
END_STATE();
case 12:
- ACCEPT_TOKEN(anon_sym_DASH);
+ ACCEPT_TOKEN(anon_sym_RBRACE);
END_STATE();
case 13:
- ACCEPT_TOKEN(anon_sym_EQ);
+ ACCEPT_TOKEN(anon_sym_GT);
END_STATE();
case 14:
- ACCEPT_TOKEN(sym_node_name);
- if (lookahead == 0x1680) ADVANCE(14);
- if (set_contains(sym__S_character_set_1, 10, lookahead)) ADVANCE(23);
- if (set_contains(sym_node_name_character_set_2, 18, lookahead)) ADVANCE(15);
+ ACCEPT_TOKEN(anon_sym_DASH);
END_STATE();
case 15:
- ACCEPT_TOKEN(sym_node_name);
- if (set_contains(sym_node_name_character_set_2, 18, lookahead)) ADVANCE(15);
+ ACCEPT_TOKEN(anon_sym_EQ);
END_STATE();
case 16:
- ACCEPT_TOKEN(anon_sym_AT);
+ ACCEPT_TOKEN(sym_node_name);
+ if (lookahead == 0x1680) ADVANCE(16);
+ if (set_contains(sym__S_character_set_1, 10, lookahead)) ADVANCE(26);
+ if (set_contains(sym_node_name_character_set_2, 18, lookahead)) ADVANCE(18);
END_STATE();
case 17:
+ ACCEPT_TOKEN(sym_node_name);
+ if (lookahead == '-' ||
+ ('0' <= lookahead && lookahead <= '9') ||
+ ('A' <= lookahead && lookahead <= 'Z') ||
+ lookahead == '_' ||
+ ('a' <= lookahead && lookahead <= 'z')) ADVANCE(17);
+ if (set_contains(sym_node_name_character_set_2, 18, lookahead)) ADVANCE(18);
+ END_STATE();
+ case 18:
+ ACCEPT_TOKEN(sym_node_name);
+ if (set_contains(sym_node_name_character_set_2, 18, lookahead)) ADVANCE(18);
+ END_STATE();
+ case 19:
+ ACCEPT_TOKEN(anon_sym_AT);
+ END_STATE();
+ case 20:
ACCEPT_TOKEN(sym_literal_text);
- if (lookahead == '\\') ADVANCE(3);
- if (set_contains(sym__S_character_set_1, 10, lookahead)) ADVANCE(17);
+ if (lookahead == '\\') ADVANCE(4);
+ if (set_contains(sym__S_character_set_1, 10, lookahead)) ADVANCE(20);
if (lookahead != 0 &&
lookahead != '@' &&
- lookahead != '}') ADVANCE(18);
+ lookahead != '}') ADVANCE(21);
END_STATE();
- case 18:
+ case 21:
ACCEPT_TOKEN(sym_literal_text);
- if (lookahead == '\\') ADVANCE(3);
+ if (lookahead == '\\') ADVANCE(4);
if (lookahead != 0 &&
lookahead != '@' &&
- lookahead != '}') ADVANCE(18);
+ lookahead != '}') ADVANCE(21);
END_STATE();
- case 19:
+ case 22:
ACCEPT_TOKEN(sym_class_shorthand);
- if ((!eof && set_contains(sym_class_shorthand_character_set_1, 11, lookahead))) ADVANCE(19);
+ if ((!eof && set_contains(sym_class_shorthand_character_set_1, 11, lookahead))) ADVANCE(22);
END_STATE();
- case 20:
+ case 23:
ACCEPT_TOKEN(sym_id_shorthand);
- if ((!eof && set_contains(sym_class_shorthand_character_set_1, 11, lookahead))) ADVANCE(20);
+ if ((!eof && set_contains(sym_class_shorthand_character_set_1, 11, lookahead))) ADVANCE(23);
END_STATE();
- case 21:
+ case 24:
ACCEPT_TOKEN(sym_attribute_name);
if (lookahead == '-' ||
('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' ||
- ('a' <= lookahead && lookahead <= 'z')) ADVANCE(21);
+ ('a' <= lookahead && lookahead <= 'z')) ADVANCE(24);
END_STATE();
- case 22:
+ case 25:
ACCEPT_TOKEN(sym_attribute_value);
END_STATE();
- case 23:
+ case 26:
ACCEPT_TOKEN(sym__S);
- if (set_contains(sym__S_character_set_1, 10, lookahead)) ADVANCE(23);
+ if (set_contains(sym__S_character_set_1, 10, lookahead)) ADVANCE(26);
END_STATE();
default:
return false;
@@ -414,54 +481,83 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = {
[5] = {.lex_state = 0},
[6] = {.lex_state = 0},
[7] = {.lex_state = 0},
- [8] = {.lex_state = 7},
- [9] = {.lex_state = 7},
- [10] = {.lex_state = 7},
- [11] = {.lex_state = 7},
+ [8] = {.lex_state = 0},
+ [9] = {.lex_state = 0},
+ [10] = {.lex_state = 0},
+ [11] = {.lex_state = 0},
[12] = {.lex_state = 0},
- [13] = {.lex_state = 7},
- [14] = {.lex_state = 7},
+ [13] = {.lex_state = 0},
+ [14] = {.lex_state = 2},
[15] = {.lex_state = 2},
[16] = {.lex_state = 0},
[17] = {.lex_state = 0},
- [18] = {.lex_state = 7},
- [19] = {.lex_state = 0},
+ [18] = {.lex_state = 8},
+ [19] = {.lex_state = 8},
[20] = {.lex_state = 0},
- [21] = {.lex_state = 0},
- [22] = {.lex_state = 0},
- [23] = {.lex_state = 2},
- [24] = {.lex_state = 7},
- [25] = {.lex_state = 2},
- [26] = {.lex_state = 7},
- [27] = {.lex_state = 0},
- [28] = {.lex_state = 2},
- [29] = {.lex_state = 2},
- [30] = {.lex_state = 2},
- [31] = {.lex_state = 2},
- [32] = {.lex_state = 2},
- [33] = {.lex_state = 7},
- [34] = {.lex_state = 7},
+ [21] = {.lex_state = 8},
+ [22] = {.lex_state = 8},
+ [23] = {.lex_state = 8},
+ [24] = {.lex_state = 8},
+ [25] = {.lex_state = 8},
+ [26] = {.lex_state = 8},
+ [27] = {.lex_state = 3},
+ [28] = {.lex_state = 0},
+ [29] = {.lex_state = 0},
+ [30] = {.lex_state = 8},
+ [31] = {.lex_state = 0},
+ [32] = {.lex_state = 0},
+ [33] = {.lex_state = 0},
+ [34] = {.lex_state = 0},
[35] = {.lex_state = 0},
- [36] = {.lex_state = 7},
- [37] = {.lex_state = 7},
- [38] = {.lex_state = 7},
- [39] = {.lex_state = 7},
- [40] = {.lex_state = 7},
- [41] = {.lex_state = 7},
- [42] = {.lex_state = 7},
- [43] = {.lex_state = 7},
- [44] = {.lex_state = 7},
- [45] = {.lex_state = 7},
- [46] = {.lex_state = 7},
- [47] = {.lex_state = 0},
+ [36] = {.lex_state = 0},
+ [37] = {.lex_state = 0},
+ [38] = {.lex_state = 8},
+ [39] = {.lex_state = 3},
+ [40] = {.lex_state = 8},
+ [41] = {.lex_state = 3},
+ [42] = {.lex_state = 3},
+ [43] = {.lex_state = 3},
+ [44] = {.lex_state = 3},
+ [45] = {.lex_state = 3},
+ [46] = {.lex_state = 3},
+ [47] = {.lex_state = 3},
+ [48] = {.lex_state = 3},
+ [49] = {.lex_state = 3},
+ [50] = {.lex_state = 3},
+ [51] = {.lex_state = 8},
+ [52] = {.lex_state = 8},
+ [53] = {.lex_state = 8},
+ [54] = {.lex_state = 8},
+ [55] = {.lex_state = 8},
+ [56] = {.lex_state = 8},
+ [57] = {.lex_state = 8},
+ [58] = {.lex_state = 8},
+ [59] = {.lex_state = 0},
+ [60] = {.lex_state = 8},
+ [61] = {.lex_state = 8},
+ [62] = {.lex_state = 8},
+ [63] = {.lex_state = 8},
+ [64] = {.lex_state = 8},
+ [65] = {.lex_state = 8},
+ [66] = {.lex_state = 8},
+ [67] = {.lex_state = 8},
+ [68] = {.lex_state = 8},
+ [69] = {.lex_state = 8},
+ [70] = {.lex_state = 8},
+ [71] = {.lex_state = 8},
+ [72] = {.lex_state = 8},
+ [73] = {.lex_state = 8},
+ [74] = {.lex_state = 8},
+ [75] = {.lex_state = 0},
};
static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = {
[0] = {
[ts_builtin_sym_end] = ACTIONS(1),
- [anon_sym_GT] = ACTIONS(1),
+ [anon_sym_SLASH] = ACTIONS(1),
[anon_sym_LBRACE] = ACTIONS(1),
[anon_sym_RBRACE] = ACTIONS(1),
+ [anon_sym_GT] = ACTIONS(1),
[anon_sym_DASH] = ACTIONS(1),
[anon_sym_EQ] = ACTIONS(1),
[sym_node_name] = ACTIONS(1),
@@ -472,507 +568,873 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = {
[sym__S] = ACTIONS(3),
},
[1] = {
- [sym_source_file] = STATE(44),
- [sym_node] = STATE(16),
- [aux_sym_source_file_repeat1] = STATE(16),
+ [sym_source_file] = STATE(71),
+ [sym_comment] = STATE(17),
+ [sym_node] = STATE(17),
+ [aux_sym_source_file_repeat1] = STATE(17),
[ts_builtin_sym_end] = ACTIONS(5),
- [anon_sym_GT] = ACTIONS(7),
- [sym_node_name] = ACTIONS(9),
+ [anon_sym_SLASH] = ACTIONS(7),
+ [anon_sym_GT] = ACTIONS(9),
+ [sym_node_name] = ACTIONS(11),
[sym__S] = ACTIONS(3),
},
};
static const uint16_t ts_small_parse_table[] = {
- [0] = 7,
+ [0] = 8,
ACTIONS(3), 1,
sym__S,
ACTIONS(7), 1,
- anon_sym_GT,
+ anon_sym_SLASH,
ACTIONS(9), 1,
+ anon_sym_GT,
+ ACTIONS(11), 1,
sym_node_name,
+ ACTIONS(13), 1,
+ anon_sym_RBRACE,
+ STATE(63), 1,
+ sym_node_body,
+ ACTIONS(15), 2,
+ anon_sym_DASH,
+ anon_sym_EQ,
+ STATE(20), 3,
+ sym_comment,
+ sym_node,
+ aux_sym_source_file_repeat1,
+ [28] = 8,
+ ACTIONS(3), 1,
+ sym__S,
+ ACTIONS(7), 1,
+ anon_sym_SLASH,
+ ACTIONS(9), 1,
+ anon_sym_GT,
ACTIONS(11), 1,
+ sym_node_name,
+ ACTIONS(17), 1,
anon_sym_RBRACE,
- STATE(40), 1,
+ STATE(54), 1,
sym_node_body,
- ACTIONS(13), 2,
+ ACTIONS(15), 2,
anon_sym_DASH,
anon_sym_EQ,
- STATE(17), 2,
+ STATE(20), 3,
+ sym_comment,
sym_node,
aux_sym_source_file_repeat1,
- [24] = 7,
+ [56] = 8,
ACTIONS(3), 1,
sym__S,
ACTIONS(7), 1,
+ anon_sym_SLASH,
+ ACTIONS(9), 1,
anon_sym_GT,
+ ACTIONS(11), 1,
+ sym_node_name,
+ ACTIONS(19), 1,
+ anon_sym_RBRACE,
+ STATE(62), 1,
+ sym_node_body,
+ ACTIONS(15), 2,
+ anon_sym_DASH,
+ anon_sym_EQ,
+ STATE(20), 3,
+ sym_comment,
+ sym_node,
+ aux_sym_source_file_repeat1,
+ [84] = 8,
+ ACTIONS(3), 1,
+ sym__S,
+ ACTIONS(7), 1,
+ anon_sym_SLASH,
ACTIONS(9), 1,
+ anon_sym_GT,
+ ACTIONS(11), 1,
sym_node_name,
- ACTIONS(15), 1,
+ ACTIONS(21), 1,
anon_sym_RBRACE,
- STATE(38), 1,
+ STATE(57), 1,
sym_node_body,
- ACTIONS(13), 2,
+ ACTIONS(15), 2,
anon_sym_DASH,
anon_sym_EQ,
- STATE(17), 2,
+ STATE(20), 3,
+ sym_comment,
sym_node,
aux_sym_source_file_repeat1,
- [48] = 7,
+ [112] = 8,
ACTIONS(3), 1,
sym__S,
ACTIONS(7), 1,
+ anon_sym_SLASH,
+ ACTIONS(9), 1,
anon_sym_GT,
+ ACTIONS(11), 1,
+ sym_node_name,
+ ACTIONS(23), 1,
+ anon_sym_RBRACE,
+ STATE(53), 1,
+ sym_node_body,
+ ACTIONS(15), 2,
+ anon_sym_DASH,
+ anon_sym_EQ,
+ STATE(20), 3,
+ sym_comment,
+ sym_node,
+ aux_sym_source_file_repeat1,
+ [140] = 8,
+ ACTIONS(3), 1,
+ sym__S,
+ ACTIONS(7), 1,
+ anon_sym_SLASH,
ACTIONS(9), 1,
+ anon_sym_GT,
+ ACTIONS(11), 1,
sym_node_name,
- ACTIONS(17), 1,
+ ACTIONS(25), 1,
anon_sym_RBRACE,
- STATE(34), 1,
+ STATE(51), 1,
sym_node_body,
- ACTIONS(13), 2,
+ ACTIONS(15), 2,
anon_sym_DASH,
anon_sym_EQ,
- STATE(17), 2,
+ STATE(20), 3,
+ sym_comment,
sym_node,
aux_sym_source_file_repeat1,
- [72] = 7,
+ [168] = 8,
ACTIONS(3), 1,
sym__S,
ACTIONS(7), 1,
+ anon_sym_SLASH,
+ ACTIONS(9), 1,
anon_sym_GT,
+ ACTIONS(11), 1,
+ sym_node_name,
+ ACTIONS(27), 1,
+ anon_sym_RBRACE,
+ STATE(60), 1,
+ sym_node_body,
+ ACTIONS(15), 2,
+ anon_sym_DASH,
+ anon_sym_EQ,
+ STATE(20), 3,
+ sym_comment,
+ sym_node,
+ aux_sym_source_file_repeat1,
+ [196] = 8,
+ ACTIONS(3), 1,
+ sym__S,
+ ACTIONS(7), 1,
+ anon_sym_SLASH,
ACTIONS(9), 1,
+ anon_sym_GT,
+ ACTIONS(11), 1,
sym_node_name,
- ACTIONS(19), 1,
+ ACTIONS(29), 1,
anon_sym_RBRACE,
- STATE(39), 1,
+ STATE(68), 1,
sym_node_body,
- ACTIONS(13), 2,
+ ACTIONS(15), 2,
anon_sym_DASH,
anon_sym_EQ,
- STATE(17), 2,
+ STATE(20), 3,
+ sym_comment,
sym_node,
aux_sym_source_file_repeat1,
- [96] = 7,
+ [224] = 8,
ACTIONS(3), 1,
sym__S,
ACTIONS(7), 1,
+ anon_sym_SLASH,
+ ACTIONS(9), 1,
anon_sym_GT,
+ ACTIONS(11), 1,
+ sym_node_name,
+ ACTIONS(31), 1,
+ anon_sym_RBRACE,
+ STATE(66), 1,
+ sym_node_body,
+ ACTIONS(15), 2,
+ anon_sym_DASH,
+ anon_sym_EQ,
+ STATE(20), 3,
+ sym_comment,
+ sym_node,
+ aux_sym_source_file_repeat1,
+ [252] = 8,
+ ACTIONS(3), 1,
+ sym__S,
+ ACTIONS(7), 1,
+ anon_sym_SLASH,
ACTIONS(9), 1,
+ anon_sym_GT,
+ ACTIONS(11), 1,
sym_node_name,
- ACTIONS(21), 1,
+ ACTIONS(33), 1,
anon_sym_RBRACE,
- STATE(42), 1,
+ STATE(61), 1,
sym_node_body,
- ACTIONS(13), 2,
+ ACTIONS(15), 2,
anon_sym_DASH,
anon_sym_EQ,
- STATE(17), 2,
+ STATE(20), 3,
+ sym_comment,
sym_node,
aux_sym_source_file_repeat1,
- [120] = 7,
+ [280] = 8,
ACTIONS(3), 1,
sym__S,
ACTIONS(7), 1,
+ anon_sym_SLASH,
+ ACTIONS(9), 1,
anon_sym_GT,
+ ACTIONS(11), 1,
+ sym_node_name,
+ ACTIONS(35), 1,
+ anon_sym_RBRACE,
+ STATE(64), 1,
+ sym_node_body,
+ ACTIONS(15), 2,
+ anon_sym_DASH,
+ anon_sym_EQ,
+ STATE(20), 3,
+ sym_comment,
+ sym_node,
+ aux_sym_source_file_repeat1,
+ [308] = 8,
+ ACTIONS(3), 1,
+ sym__S,
+ ACTIONS(7), 1,
+ anon_sym_SLASH,
ACTIONS(9), 1,
+ anon_sym_GT,
+ ACTIONS(11), 1,
sym_node_name,
- ACTIONS(23), 1,
+ ACTIONS(37), 1,
anon_sym_RBRACE,
- STATE(36), 1,
+ STATE(65), 1,
sym_node_body,
- ACTIONS(13), 2,
+ ACTIONS(15), 2,
anon_sym_DASH,
anon_sym_EQ,
- STATE(17), 2,
+ STATE(20), 3,
+ sym_comment,
sym_node,
aux_sym_source_file_repeat1,
- [144] = 6,
- ACTIONS(25), 1,
+ [336] = 7,
+ ACTIONS(3), 1,
+ sym__S,
+ ACTIONS(39), 1,
anon_sym_LBRACE,
- ACTIONS(29), 1,
+ ACTIONS(41), 1,
+ sym_node_name,
+ ACTIONS(45), 1,
sym_attribute_name,
- ACTIONS(31), 1,
- sym__S,
- STATE(46), 1,
+ STATE(67), 1,
sym_attribute_list,
- ACTIONS(27), 2,
+ ACTIONS(43), 2,
sym_class_shorthand,
sym_id_shorthand,
- STATE(13), 2,
+ STATE(25), 2,
sym_attribute,
aux_sym_attribute_list_repeat1,
- [165] = 6,
- ACTIONS(29), 1,
- sym_attribute_name,
- ACTIONS(31), 1,
+ [360] = 7,
+ ACTIONS(3), 1,
sym__S,
- ACTIONS(33), 1,
+ ACTIONS(45), 1,
+ sym_attribute_name,
+ ACTIONS(47), 1,
anon_sym_LBRACE,
- STATE(43), 1,
+ ACTIONS(49), 1,
+ sym_node_name,
+ STATE(70), 1,
sym_attribute_list,
- ACTIONS(27), 2,
+ ACTIONS(43), 2,
sym_class_shorthand,
sym_id_shorthand,
- STATE(13), 2,
+ STATE(25), 2,
sym_attribute,
aux_sym_attribute_list_repeat1,
- [186] = 6,
- ACTIONS(29), 1,
- sym_attribute_name,
- ACTIONS(31), 1,
+ [384] = 6,
+ ACTIONS(3), 1,
sym__S,
- ACTIONS(35), 1,
+ ACTIONS(53), 1,
+ anon_sym_SLASH,
+ ACTIONS(56), 1,
+ anon_sym_GT,
+ ACTIONS(59), 1,
+ sym_node_name,
+ ACTIONS(51), 2,
+ ts_builtin_sym_end,
+ anon_sym_RBRACE,
+ STATE(16), 3,
+ sym_comment,
+ sym_node,
+ aux_sym_source_file_repeat1,
+ [406] = 6,
+ ACTIONS(3), 1,
+ sym__S,
+ ACTIONS(7), 1,
+ anon_sym_SLASH,
+ ACTIONS(9), 1,
+ anon_sym_GT,
+ ACTIONS(11), 1,
+ sym_node_name,
+ ACTIONS(62), 1,
+ ts_builtin_sym_end,
+ STATE(16), 3,
+ sym_comment,
+ sym_node,
+ aux_sym_source_file_repeat1,
+ [427] = 6,
+ ACTIONS(64), 1,
anon_sym_LBRACE,
- STATE(45), 1,
+ ACTIONS(66), 1,
+ sym_attribute_name,
+ ACTIONS(68), 1,
+ sym__S,
+ STATE(74), 1,
sym_attribute_list,
- ACTIONS(27), 2,
+ ACTIONS(43), 2,
sym_class_shorthand,
sym_id_shorthand,
- STATE(13), 2,
+ STATE(25), 2,
sym_attribute,
aux_sym_attribute_list_repeat1,
- [207] = 6,
- ACTIONS(29), 1,
+ [448] = 6,
+ ACTIONS(66), 1,
sym_attribute_name,
- ACTIONS(31), 1,
+ ACTIONS(68), 1,
sym__S,
- ACTIONS(37), 1,
+ ACTIONS(70), 1,
anon_sym_LBRACE,
- STATE(41), 1,
+ STATE(55), 1,
sym_attribute_list,
- ACTIONS(27), 2,
+ ACTIONS(43), 2,
sym_class_shorthand,
sym_id_shorthand,
- STATE(13), 2,
+ STATE(25), 2,
sym_attribute,
aux_sym_attribute_list_repeat1,
- [228] = 5,
+ [469] = 6,
ACTIONS(3), 1,
sym__S,
- ACTIONS(41), 1,
+ ACTIONS(7), 1,
+ anon_sym_SLASH,
+ ACTIONS(9), 1,
anon_sym_GT,
- ACTIONS(44), 1,
+ ACTIONS(11), 1,
sym_node_name,
- ACTIONS(39), 2,
- ts_builtin_sym_end,
+ ACTIONS(72), 1,
anon_sym_RBRACE,
- STATE(12), 2,
+ STATE(16), 3,
+ sym_comment,
sym_node,
aux_sym_source_file_repeat1,
- [246] = 5,
- ACTIONS(29), 1,
+ [490] = 6,
+ ACTIONS(66), 1,
sym_attribute_name,
- ACTIONS(31), 1,
+ ACTIONS(68), 1,
sym__S,
- ACTIONS(47), 1,
+ ACTIONS(74), 1,
anon_sym_LBRACE,
- ACTIONS(27), 2,
+ STATE(72), 1,
+ sym_attribute_list,
+ ACTIONS(43), 2,
sym_class_shorthand,
sym_id_shorthand,
- STATE(14), 2,
+ STATE(25), 2,
sym_attribute,
aux_sym_attribute_list_repeat1,
- [264] = 5,
- ACTIONS(31), 1,
+ [511] = 6,
+ ACTIONS(66), 1,
+ sym_attribute_name,
+ ACTIONS(68), 1,
sym__S,
- ACTIONS(49), 1,
+ ACTIONS(76), 1,
anon_sym_LBRACE,
- ACTIONS(54), 1,
+ STATE(58), 1,
+ sym_attribute_list,
+ ACTIONS(43), 2,
+ sym_class_shorthand,
+ sym_id_shorthand,
+ STATE(25), 2,
+ sym_attribute,
+ aux_sym_attribute_list_repeat1,
+ [532] = 6,
+ ACTIONS(66), 1,
sym_attribute_name,
- ACTIONS(51), 2,
+ ACTIONS(68), 1,
+ sym__S,
+ ACTIONS(78), 1,
+ anon_sym_LBRACE,
+ STATE(73), 1,
+ sym_attribute_list,
+ ACTIONS(43), 2,
+ sym_class_shorthand,
+ sym_id_shorthand,
+ STATE(25), 2,
+ sym_attribute,
+ aux_sym_attribute_list_repeat1,
+ [553] = 6,
+ ACTIONS(66), 1,
+ sym_attribute_name,
+ ACTIONS(68), 1,
+ sym__S,
+ ACTIONS(80), 1,
+ anon_sym_LBRACE,
+ STATE(52), 1,
+ sym_attribute_list,
+ ACTIONS(43), 2,
+ sym_class_shorthand,
+ sym_id_shorthand,
+ STATE(25), 2,
+ sym_attribute,
+ aux_sym_attribute_list_repeat1,
+ [574] = 5,
+ ACTIONS(66), 1,
+ sym_attribute_name,
+ ACTIONS(68), 1,
+ sym__S,
+ ACTIONS(82), 1,
+ anon_sym_LBRACE,
+ ACTIONS(43), 2,
+ sym_class_shorthand,
+ sym_id_shorthand,
+ STATE(26), 2,
+ sym_attribute,
+ aux_sym_attribute_list_repeat1,
+ [592] = 5,
+ ACTIONS(68), 1,
+ sym__S,
+ ACTIONS(84), 1,
+ anon_sym_LBRACE,
+ ACTIONS(89), 1,
+ sym_attribute_name,
+ ACTIONS(86), 2,
sym_class_shorthand,
sym_id_shorthand,
- STATE(14), 2,
+ STATE(26), 2,
sym_attribute,
aux_sym_attribute_list_repeat1,
- [282] = 6,
+ [610] = 6,
ACTIONS(3), 1,
sym__S,
- ACTIONS(57), 1,
+ ACTIONS(72), 1,
anon_sym_RBRACE,
- ACTIONS(59), 1,
+ ACTIONS(92), 1,
anon_sym_AT,
- ACTIONS(61), 1,
+ ACTIONS(94), 1,
sym_literal_text,
- STATE(25), 1,
+ STATE(39), 1,
aux_sym_text_repeat1,
- STATE(33), 1,
+ STATE(69), 1,
sym_text,
- [301] = 5,
+ [629] = 3,
ACTIONS(3), 1,
sym__S,
- ACTIONS(7), 1,
- anon_sym_GT,
- ACTIONS(9), 1,
+ ACTIONS(98), 1,
sym_node_name,
- ACTIONS(63), 1,
+ ACTIONS(96), 4,
ts_builtin_sym_end,
- STATE(12), 2,
- sym_node,
- aux_sym_source_file_repeat1,
- [318] = 5,
+ anon_sym_SLASH,
+ anon_sym_RBRACE,
+ anon_sym_GT,
+ [642] = 5,
ACTIONS(3), 1,
sym__S,
- ACTIONS(7), 1,
+ ACTIONS(100), 1,
+ anon_sym_SLASH,
+ ACTIONS(102), 1,
anon_sym_GT,
- ACTIONS(9), 1,
+ ACTIONS(104), 1,
sym_node_name,
- ACTIONS(57), 1,
- anon_sym_RBRACE,
- STATE(12), 2,
+ STATE(44), 2,
+ sym_comment,
sym_node,
- aux_sym_source_file_repeat1,
- [335] = 3,
- ACTIONS(31), 1,
+ [659] = 3,
+ ACTIONS(68), 1,
sym__S,
- ACTIONS(67), 1,
+ ACTIONS(108), 1,
anon_sym_EQ,
- ACTIONS(65), 4,
+ ACTIONS(106), 4,
anon_sym_LBRACE,
sym_class_shorthand,
sym_id_shorthand,
sym_attribute_name,
- [348] = 3,
+ [672] = 3,
ACTIONS(3), 1,
sym__S,
- ACTIONS(71), 1,
+ ACTIONS(112), 1,
sym_node_name,
- ACTIONS(69), 3,
+ ACTIONS(110), 4,
ts_builtin_sym_end,
- anon_sym_GT,
+ anon_sym_SLASH,
anon_sym_RBRACE,
- [360] = 3,
+ anon_sym_GT,
+ [685] = 3,
ACTIONS(3), 1,
sym__S,
- ACTIONS(75), 1,
+ ACTIONS(116), 1,
sym_node_name,
- ACTIONS(73), 3,
+ ACTIONS(114), 4,
ts_builtin_sym_end,
- anon_sym_GT,
+ anon_sym_SLASH,
anon_sym_RBRACE,
- [372] = 3,
+ anon_sym_GT,
+ [698] = 3,
ACTIONS(3), 1,
sym__S,
- ACTIONS(79), 1,
+ ACTIONS(120), 1,
sym_node_name,
- ACTIONS(77), 3,
+ ACTIONS(118), 4,
ts_builtin_sym_end,
+ anon_sym_SLASH,
+ anon_sym_RBRACE,
anon_sym_GT,
+ [711] = 3,
+ ACTIONS(3), 1,
+ sym__S,
+ ACTIONS(124), 1,
+ sym_node_name,
+ ACTIONS(122), 4,
+ ts_builtin_sym_end,
+ anon_sym_SLASH,
anon_sym_RBRACE,
- [384] = 3,
+ anon_sym_GT,
+ [724] = 3,
ACTIONS(3), 1,
sym__S,
- ACTIONS(83), 1,
+ ACTIONS(128), 1,
sym_node_name,
- ACTIONS(81), 3,
+ ACTIONS(126), 4,
ts_builtin_sym_end,
+ anon_sym_SLASH,
+ anon_sym_RBRACE,
anon_sym_GT,
+ [737] = 3,
+ ACTIONS(3), 1,
+ sym__S,
+ ACTIONS(132), 1,
+ sym_node_name,
+ ACTIONS(130), 4,
+ ts_builtin_sym_end,
+ anon_sym_SLASH,
anon_sym_RBRACE,
- [396] = 5,
+ anon_sym_GT,
+ [750] = 3,
ACTIONS(3), 1,
sym__S,
- ACTIONS(85), 1,
+ ACTIONS(136), 1,
+ sym_node_name,
+ ACTIONS(134), 4,
+ ts_builtin_sym_end,
+ anon_sym_SLASH,
anon_sym_RBRACE,
- ACTIONS(87), 1,
- anon_sym_AT,
- ACTIONS(90), 1,
- sym_literal_text,
- STATE(23), 1,
- aux_sym_text_repeat1,
- [412] = 2,
- ACTIONS(31), 1,
+ anon_sym_GT,
+ [763] = 2,
+ ACTIONS(68), 1,
sym__S,
- ACTIONS(65), 4,
+ ACTIONS(106), 4,
anon_sym_LBRACE,
sym_class_shorthand,
sym_id_shorthand,
sym_attribute_name,
- [422] = 5,
+ [773] = 5,
ACTIONS(3), 1,
sym__S,
- ACTIONS(59), 1,
+ ACTIONS(92), 1,
anon_sym_AT,
- ACTIONS(93), 1,
+ ACTIONS(138), 1,
anon_sym_RBRACE,
- ACTIONS(95), 1,
+ ACTIONS(140), 1,
sym_literal_text,
- STATE(23), 1,
+ STATE(41), 1,
aux_sym_text_repeat1,
- [438] = 2,
- ACTIONS(31), 1,
+ [789] = 2,
+ ACTIONS(68), 1,
sym__S,
- ACTIONS(97), 4,
+ ACTIONS(142), 4,
anon_sym_LBRACE,
sym_class_shorthand,
sym_id_shorthand,
sym_attribute_name,
- [448] = 4,
+ [799] = 5,
ACTIONS(3), 1,
sym__S,
- ACTIONS(99), 1,
- anon_sym_GT,
- ACTIONS(101), 1,
- sym_node_name,
- STATE(28), 1,
- sym_node,
- [461] = 2,
+ ACTIONS(144), 1,
+ anon_sym_RBRACE,
+ ACTIONS(146), 1,
+ anon_sym_AT,
+ ACTIONS(149), 1,
+ sym_literal_text,
+ STATE(41), 1,
+ aux_sym_text_repeat1,
+ [815] = 2,
ACTIONS(3), 1,
sym__S,
- ACTIONS(85), 3,
+ ACTIONS(126), 3,
anon_sym_RBRACE,
anon_sym_AT,
sym_literal_text,
- [470] = 2,
+ [824] = 2,
ACTIONS(3), 1,
sym__S,
- ACTIONS(73), 3,
+ ACTIONS(134), 3,
anon_sym_RBRACE,
anon_sym_AT,
sym_literal_text,
- [479] = 2,
+ [833] = 2,
ACTIONS(3), 1,
sym__S,
- ACTIONS(81), 3,
+ ACTIONS(144), 3,
anon_sym_RBRACE,
anon_sym_AT,
sym_literal_text,
- [488] = 2,
+ [842] = 2,
ACTIONS(3), 1,
sym__S,
- ACTIONS(69), 3,
+ ACTIONS(130), 3,
anon_sym_RBRACE,
anon_sym_AT,
sym_literal_text,
- [497] = 2,
+ [851] = 2,
ACTIONS(3), 1,
sym__S,
- ACTIONS(77), 3,
+ ACTIONS(96), 3,
anon_sym_RBRACE,
anon_sym_AT,
sym_literal_text,
- [506] = 2,
- ACTIONS(31), 1,
+ [860] = 2,
+ ACTIONS(3), 1,
sym__S,
- ACTIONS(103), 1,
+ ACTIONS(114), 3,
anon_sym_RBRACE,
- [513] = 2,
- ACTIONS(31), 1,
+ anon_sym_AT,
+ sym_literal_text,
+ [869] = 2,
+ ACTIONS(3), 1,
sym__S,
- ACTIONS(105), 1,
+ ACTIONS(122), 3,
anon_sym_RBRACE,
- [520] = 2,
+ anon_sym_AT,
+ sym_literal_text,
+ [878] = 2,
ACTIONS(3), 1,
sym__S,
- ACTIONS(107), 1,
- sym_node_name,
- [527] = 2,
- ACTIONS(17), 1,
+ ACTIONS(110), 3,
anon_sym_RBRACE,
- ACTIONS(31), 1,
+ anon_sym_AT,
+ sym_literal_text,
+ [887] = 2,
+ ACTIONS(3), 1,
sym__S,
- [534] = 2,
- ACTIONS(31), 1,
+ ACTIONS(118), 3,
+ anon_sym_RBRACE,
+ anon_sym_AT,
+ sym_literal_text,
+ [896] = 2,
+ ACTIONS(29), 1,
+ anon_sym_RBRACE,
+ ACTIONS(68), 1,
+ sym__S,
+ [903] = 2,
+ ACTIONS(68), 1,
sym__S,
- ACTIONS(109), 1,
+ ACTIONS(70), 1,
+ anon_sym_LBRACE,
+ [910] = 2,
+ ACTIONS(68), 1,
+ sym__S,
+ ACTIONS(152), 1,
+ anon_sym_RBRACE,
+ [917] = 2,
+ ACTIONS(68), 1,
+ sym__S,
+ ACTIONS(154), 1,
+ anon_sym_RBRACE,
+ [924] = 2,
+ ACTIONS(68), 1,
+ sym__S,
+ ACTIONS(156), 1,
+ anon_sym_LBRACE,
+ [931] = 2,
+ ACTIONS(68), 1,
+ sym__S,
+ ACTIONS(158), 1,
sym_attribute_value,
- [541] = 2,
- ACTIONS(23), 1,
+ [938] = 2,
+ ACTIONS(33), 1,
anon_sym_RBRACE,
- ACTIONS(31), 1,
+ ACTIONS(68), 1,
sym__S,
- [548] = 2,
- ACTIONS(11), 1,
+ [945] = 2,
+ ACTIONS(68), 1,
+ sym__S,
+ ACTIONS(160), 1,
+ anon_sym_LBRACE,
+ [952] = 2,
+ ACTIONS(3), 1,
+ sym__S,
+ ACTIONS(162), 1,
+ sym_node_name,
+ [959] = 2,
+ ACTIONS(13), 1,
anon_sym_RBRACE,
- ACTIONS(31), 1,
+ ACTIONS(68), 1,
sym__S,
- [555] = 2,
- ACTIONS(21), 1,
+ [966] = 2,
+ ACTIONS(37), 1,
anon_sym_RBRACE,
- ACTIONS(31), 1,
+ ACTIONS(68), 1,
sym__S,
- [562] = 2,
+ [973] = 2,
+ ACTIONS(17), 1,
+ anon_sym_RBRACE,
+ ACTIONS(68), 1,
+ sym__S,
+ [980] = 2,
ACTIONS(31), 1,
+ anon_sym_RBRACE,
+ ACTIONS(68), 1,
+ sym__S,
+ [987] = 2,
+ ACTIONS(19), 1,
+ anon_sym_RBRACE,
+ ACTIONS(68), 1,
+ sym__S,
+ [994] = 2,
+ ACTIONS(68), 1,
sym__S,
- ACTIONS(111), 1,
+ ACTIONS(164), 1,
+ anon_sym_RBRACE,
+ [1001] = 2,
+ ACTIONS(68), 1,
+ sym__S,
+ ACTIONS(166), 1,
+ anon_sym_RBRACE,
+ [1008] = 2,
+ ACTIONS(68), 1,
+ sym__S,
+ ACTIONS(76), 1,
anon_sym_LBRACE,
- [569] = 2,
- ACTIONS(31), 1,
+ [1015] = 2,
+ ACTIONS(23), 1,
+ anon_sym_RBRACE,
+ ACTIONS(68), 1,
+ sym__S,
+ [1022] = 2,
+ ACTIONS(68), 1,
sym__S,
- ACTIONS(113), 1,
+ ACTIONS(168), 1,
anon_sym_RBRACE,
- [576] = 2,
- ACTIONS(31), 1,
+ [1029] = 2,
+ ACTIONS(68), 1,
sym__S,
- ACTIONS(37), 1,
+ ACTIONS(78), 1,
anon_sym_LBRACE,
- [583] = 2,
- ACTIONS(31), 1,
+ [1036] = 2,
+ ACTIONS(68), 1,
sym__S,
- ACTIONS(115), 1,
+ ACTIONS(170), 1,
ts_builtin_sym_end,
- [590] = 2,
- ACTIONS(25), 1,
+ [1043] = 2,
+ ACTIONS(64), 1,
anon_sym_LBRACE,
- ACTIONS(31), 1,
+ ACTIONS(68), 1,
sym__S,
- [597] = 2,
- ACTIONS(31), 1,
+ [1050] = 2,
+ ACTIONS(68), 1,
+ sym__S,
+ ACTIONS(172), 1,
+ anon_sym_LBRACE,
+ [1057] = 2,
+ ACTIONS(68), 1,
sym__S,
- ACTIONS(117), 1,
+ ACTIONS(174), 1,
anon_sym_LBRACE,
- [604] = 2,
+ [1064] = 2,
ACTIONS(3), 1,
sym__S,
- ACTIONS(119), 1,
+ ACTIONS(176), 1,
sym_node_name,
};
static const uint32_t ts_small_parse_table_map[] = {
[SMALL_STATE(2)] = 0,
- [SMALL_STATE(3)] = 24,
- [SMALL_STATE(4)] = 48,
- [SMALL_STATE(5)] = 72,
- [SMALL_STATE(6)] = 96,
- [SMALL_STATE(7)] = 120,
- [SMALL_STATE(8)] = 144,
- [SMALL_STATE(9)] = 165,
- [SMALL_STATE(10)] = 186,
- [SMALL_STATE(11)] = 207,
- [SMALL_STATE(12)] = 228,
- [SMALL_STATE(13)] = 246,
- [SMALL_STATE(14)] = 264,
- [SMALL_STATE(15)] = 282,
- [SMALL_STATE(16)] = 301,
- [SMALL_STATE(17)] = 318,
- [SMALL_STATE(18)] = 335,
- [SMALL_STATE(19)] = 348,
- [SMALL_STATE(20)] = 360,
- [SMALL_STATE(21)] = 372,
- [SMALL_STATE(22)] = 384,
- [SMALL_STATE(23)] = 396,
- [SMALL_STATE(24)] = 412,
- [SMALL_STATE(25)] = 422,
- [SMALL_STATE(26)] = 438,
- [SMALL_STATE(27)] = 448,
- [SMALL_STATE(28)] = 461,
- [SMALL_STATE(29)] = 470,
- [SMALL_STATE(30)] = 479,
- [SMALL_STATE(31)] = 488,
- [SMALL_STATE(32)] = 497,
- [SMALL_STATE(33)] = 506,
- [SMALL_STATE(34)] = 513,
- [SMALL_STATE(35)] = 520,
- [SMALL_STATE(36)] = 527,
- [SMALL_STATE(37)] = 534,
- [SMALL_STATE(38)] = 541,
- [SMALL_STATE(39)] = 548,
- [SMALL_STATE(40)] = 555,
- [SMALL_STATE(41)] = 562,
- [SMALL_STATE(42)] = 569,
- [SMALL_STATE(43)] = 576,
- [SMALL_STATE(44)] = 583,
- [SMALL_STATE(45)] = 590,
- [SMALL_STATE(46)] = 597,
- [SMALL_STATE(47)] = 604,
+ [SMALL_STATE(3)] = 28,
+ [SMALL_STATE(4)] = 56,
+ [SMALL_STATE(5)] = 84,
+ [SMALL_STATE(6)] = 112,
+ [SMALL_STATE(7)] = 140,
+ [SMALL_STATE(8)] = 168,
+ [SMALL_STATE(9)] = 196,
+ [SMALL_STATE(10)] = 224,
+ [SMALL_STATE(11)] = 252,
+ [SMALL_STATE(12)] = 280,
+ [SMALL_STATE(13)] = 308,
+ [SMALL_STATE(14)] = 336,
+ [SMALL_STATE(15)] = 360,
+ [SMALL_STATE(16)] = 384,
+ [SMALL_STATE(17)] = 406,
+ [SMALL_STATE(18)] = 427,
+ [SMALL_STATE(19)] = 448,
+ [SMALL_STATE(20)] = 469,
+ [SMALL_STATE(21)] = 490,
+ [SMALL_STATE(22)] = 511,
+ [SMALL_STATE(23)] = 532,
+ [SMALL_STATE(24)] = 553,
+ [SMALL_STATE(25)] = 574,
+ [SMALL_STATE(26)] = 592,
+ [SMALL_STATE(27)] = 610,
+ [SMALL_STATE(28)] = 629,
+ [SMALL_STATE(29)] = 642,
+ [SMALL_STATE(30)] = 659,
+ [SMALL_STATE(31)] = 672,
+ [SMALL_STATE(32)] = 685,
+ [SMALL_STATE(33)] = 698,
+ [SMALL_STATE(34)] = 711,
+ [SMALL_STATE(35)] = 724,
+ [SMALL_STATE(36)] = 737,
+ [SMALL_STATE(37)] = 750,
+ [SMALL_STATE(38)] = 763,
+ [SMALL_STATE(39)] = 773,
+ [SMALL_STATE(40)] = 789,
+ [SMALL_STATE(41)] = 799,
+ [SMALL_STATE(42)] = 815,
+ [SMALL_STATE(43)] = 824,
+ [SMALL_STATE(44)] = 833,
+ [SMALL_STATE(45)] = 842,
+ [SMALL_STATE(46)] = 851,
+ [SMALL_STATE(47)] = 860,
+ [SMALL_STATE(48)] = 869,
+ [SMALL_STATE(49)] = 878,
+ [SMALL_STATE(50)] = 887,
+ [SMALL_STATE(51)] = 896,
+ [SMALL_STATE(52)] = 903,
+ [SMALL_STATE(53)] = 910,
+ [SMALL_STATE(54)] = 917,
+ [SMALL_STATE(55)] = 924,
+ [SMALL_STATE(56)] = 931,
+ [SMALL_STATE(57)] = 938,
+ [SMALL_STATE(58)] = 945,
+ [SMALL_STATE(59)] = 952,
+ [SMALL_STATE(60)] = 959,
+ [SMALL_STATE(61)] = 966,
+ [SMALL_STATE(62)] = 973,
+ [SMALL_STATE(63)] = 980,
+ [SMALL_STATE(64)] = 987,
+ [SMALL_STATE(65)] = 994,
+ [SMALL_STATE(66)] = 1001,
+ [SMALL_STATE(67)] = 1008,
+ [SMALL_STATE(68)] = 1015,
+ [SMALL_STATE(69)] = 1022,
+ [SMALL_STATE(70)] = 1029,
+ [SMALL_STATE(71)] = 1036,
+ [SMALL_STATE(72)] = 1043,
+ [SMALL_STATE(73)] = 1050,
+ [SMALL_STATE(74)] = 1057,
+ [SMALL_STATE(75)] = 1064,
};
static const TSParseActionEntry ts_parse_actions[] = {
@@ -980,60 +1442,88 @@ static const TSParseActionEntry ts_parse_actions[] = {
[1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(),
[3] = {.entry = {.count = 1, .reusable = false}}, SHIFT_EXTRA(),
[5] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 0, 0, 0),
- [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(35),
- [9] = {.entry = {.count = 1, .reusable = false}}, SHIFT(9),
- [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(30),
- [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15),
- [15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20),
- [17] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19),
- [19] = {.entry = {.count = 1, .reusable = true}}, SHIFT(29),
- [21] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31),
- [23] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22),
- [25] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2),
- [27] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24),
- [29] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18),
- [31] = {.entry = {.count = 1, .reusable = true}}, SHIFT_EXTRA(),
- [33] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3),
- [35] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5),
- [37] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7),
- [39] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0),
- [41] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(35),
- [44] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(9),
- [47] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute_list, 1, 0, 0),
- [49] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_attribute_list_repeat1, 2, 0, 0),
- [51] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_attribute_list_repeat1, 2, 0, 0), SHIFT_REPEAT(24),
- [54] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_attribute_list_repeat1, 2, 0, 0), SHIFT_REPEAT(18),
- [57] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_node_body, 1, 0, 0),
- [59] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27),
- [61] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25),
- [63] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1, 0, 0),
- [65] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute, 1, 0, 0),
- [67] = {.entry = {.count = 1, .reusable = true}}, SHIFT(37),
- [69] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_node, 5, 0, 0),
- [71] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_node, 5, 0, 0),
- [73] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_node, 3, 0, 0),
- [75] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_node, 3, 0, 0),
- [77] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_node, 6, 0, 0),
- [79] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_node, 6, 0, 0),
- [81] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_node, 4, 0, 0),
- [83] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_node, 4, 0, 0),
- [85] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_text_repeat1, 2, 0, 0),
- [87] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_text_repeat1, 2, 0, 0), SHIFT_REPEAT(27),
- [90] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_text_repeat1, 2, 0, 0), SHIFT_REPEAT(23),
- [93] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_text, 1, 0, 0),
- [95] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23),
- [97] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute, 3, 0, 0),
- [99] = {.entry = {.count = 1, .reusable = true}}, SHIFT(47),
- [101] = {.entry = {.count = 1, .reusable = false}}, SHIFT(10),
- [103] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_node_body, 2, 0, 0),
- [105] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21),
- [107] = {.entry = {.count = 1, .reusable = false}}, SHIFT(11),
- [109] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26),
- [111] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4),
- [113] = {.entry = {.count = 1, .reusable = true}}, SHIFT(32),
- [115] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(),
- [117] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6),
- [119] = {.entry = {.count = 1, .reusable = false}}, SHIFT(8),
+ [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14),
+ [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(59),
+ [11] = {.entry = {.count = 1, .reusable = false}}, SHIFT(24),
+ [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(50),
+ [15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27),
+ [17] = {.entry = {.count = 1, .reusable = true}}, SHIFT(35),
+ [19] = {.entry = {.count = 1, .reusable = true}}, SHIFT(33),
+ [21] = {.entry = {.count = 1, .reusable = true}}, SHIFT(47),
+ [23] = {.entry = {.count = 1, .reusable = true}}, SHIFT(37),
+ [25] = {.entry = {.count = 1, .reusable = true}}, SHIFT(32),
+ [27] = {.entry = {.count = 1, .reusable = true}}, SHIFT(48),
+ [29] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31),
+ [31] = {.entry = {.count = 1, .reusable = true}}, SHIFT(42),
+ [33] = {.entry = {.count = 1, .reusable = true}}, SHIFT(49),
+ [35] = {.entry = {.count = 1, .reusable = true}}, SHIFT(34),
+ [37] = {.entry = {.count = 1, .reusable = true}}, SHIFT(43),
+ [39] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7),
+ [41] = {.entry = {.count = 1, .reusable = false}}, SHIFT(22),
+ [43] = {.entry = {.count = 1, .reusable = true}}, SHIFT(38),
+ [45] = {.entry = {.count = 1, .reusable = false}}, SHIFT(30),
+ [47] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5),
+ [49] = {.entry = {.count = 1, .reusable = false}}, SHIFT(23),
+ [51] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0),
+ [53] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(14),
+ [56] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(59),
+ [59] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(24),
+ [62] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1, 0, 0),
+ [64] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2),
+ [66] = {.entry = {.count = 1, .reusable = true}}, SHIFT(30),
+ [68] = {.entry = {.count = 1, .reusable = true}}, SHIFT_EXTRA(),
+ [70] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4),
+ [72] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_node_body, 1, 0, 0),
+ [74] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8),
+ [76] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9),
+ [78] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11),
+ [80] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12),
+ [82] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute_list, 1, 0, 0),
+ [84] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_attribute_list_repeat1, 2, 0, 0),
+ [86] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_attribute_list_repeat1, 2, 0, 0), SHIFT_REPEAT(38),
+ [89] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_attribute_list_repeat1, 2, 0, 0), SHIFT_REPEAT(30),
+ [92] = {.entry = {.count = 1, .reusable = true}}, SHIFT(29),
+ [94] = {.entry = {.count = 1, .reusable = true}}, SHIFT(39),
+ [96] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_comment, 6, 0, 0),
+ [98] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_comment, 6, 0, 0),
+ [100] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15),
+ [102] = {.entry = {.count = 1, .reusable = true}}, SHIFT(75),
+ [104] = {.entry = {.count = 1, .reusable = false}}, SHIFT(21),
+ [106] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute, 1, 0, 0),
+ [108] = {.entry = {.count = 1, .reusable = true}}, SHIFT(56),
+ [110] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_comment, 4, 0, 0),
+ [112] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_comment, 4, 0, 0),
+ [114] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_comment, 3, 0, 0),
+ [116] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_comment, 3, 0, 0),
+ [118] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_node, 4, 0, 0),
+ [120] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_node, 4, 0, 0),
+ [122] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_node, 3, 0, 0),
+ [124] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_node, 3, 0, 0),
+ [126] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_node, 5, 0, 0),
+ [128] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_node, 5, 0, 0),
+ [130] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_node, 6, 0, 0),
+ [132] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_node, 6, 0, 0),
+ [134] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_comment, 5, 0, 0),
+ [136] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_comment, 5, 0, 0),
+ [138] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_text, 1, 0, 0),
+ [140] = {.entry = {.count = 1, .reusable = true}}, SHIFT(41),
+ [142] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute, 3, 0, 0),
+ [144] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_text_repeat1, 2, 0, 0),
+ [146] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_text_repeat1, 2, 0, 0), SHIFT_REPEAT(29),
+ [149] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_text_repeat1, 2, 0, 0), SHIFT_REPEAT(41),
+ [152] = {.entry = {.count = 1, .reusable = true}}, SHIFT(28),
+ [154] = {.entry = {.count = 1, .reusable = true}}, SHIFT(36),
+ [156] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3),
+ [158] = {.entry = {.count = 1, .reusable = true}}, SHIFT(40),
+ [160] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6),
+ [162] = {.entry = {.count = 1, .reusable = false}}, SHIFT(19),
+ [164] = {.entry = {.count = 1, .reusable = true}}, SHIFT(46),
+ [166] = {.entry = {.count = 1, .reusable = true}}, SHIFT(45),
+ [168] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_node_body, 2, 0, 0),
+ [170] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(),
+ [172] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13),
+ [174] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10),
+ [176] = {.entry = {.count = 1, .reusable = false}}, SHIFT(18),
};
#ifdef __cplusplus
diff --git a/src/tree_sitter/parser.h b/src/tree_sitter/parser.h
index 17f0e94..799f599 100644
--- a/src/tree_sitter/parser.h
+++ b/src/tree_sitter/parser.h
@@ -47,6 +47,7 @@ struct TSLexer {
uint32_t (*get_column)(TSLexer *);
bool (*is_at_included_range_start)(const TSLexer *);
bool (*eof)(const TSLexer *);
+ void (*log)(const TSLexer *, const char *, ...);
};
typedef enum {