Bump tree-sitter-cli to 0.19

This commit is contained in:
Max Brunsfeld 2021-03-04 14:44:19 -08:00
parent e882c98b5e
commit f13775ea60
14 changed files with 337 additions and 367 deletions

2
.gitignore vendored
View File

@ -1,4 +1,6 @@
node_modules node_modules
build build
target
*.log *.log
package-lock.json package-lock.json
Cargo.lock

3
.npmignore Normal file
View File

@ -0,0 +1,3 @@
build
target
Cargo.lock

26
Cargo.toml Normal file
View File

@ -0,0 +1,26 @@
[package]
name = "tree-sitter-css"
description = "css grammar for the tree-sitter parsing library"
version = "0.0.1"
keywords = ["incremental", "parsing", "css"]
categories = ["parsing", "text-editors"]
repository = "https://github.com/tree-sitter/tree-sitter-javascript"
edition = "2018"
license = "MIT"
build = "bindings/rust/build.rs"
include = [
"bindings/rust/*",
"grammar.js",
"queries/*",
"src/*",
]
[lib]
path = "bindings/rust/lib.rs"
[dependencies]
tree-sitter = "0.17"
[build-dependencies]
cc = "1.0"

View File

@ -9,7 +9,7 @@
"sources": [ "sources": [
"src/parser.c", "src/parser.c",
"src/scanner.c", "src/scanner.c",
"src/binding.cc" "bindings/node/binding.cc"
], ],
"cflags_c": [ "cflags_c": [
"-std=c99", "-std=c99",

19
bindings/node/index.js Normal file
View File

@ -0,0 +1,19 @@
try {
module.exports = require("../../build/Release/tree_sitter_css_binding");
} catch (error1) {
if (error1.code !== 'MODULE_NOT_FOUND') {
throw error1;
}
try {
module.exports = require("../../build/Debug/tree_sitter_css_binding");
} catch (error2) {
if (error2.code !== 'MODULE_NOT_FOUND') {
throw error2;
}
throw error1
}
}
try {
module.exports.nodeTypeInfo = require("../../src/node-types.json");
} catch (_) {}

16
bindings/rust/build.rs Normal file
View File

@ -0,0 +1,16 @@
fn main() {
let src_dir = std::path::Path::new("src");
let mut c_config = cc::Build::new();
c_config.include(&src_dir);
c_config
.flag_if_supported("-Wno-unused-parameter")
.flag_if_supported("-Wno-unused-but-set-variable")
.flag_if_supported("-Wno-trigraphs");
let parser_path = src_dir.join("parser.c");
let scanner_path = src_dir.join("scanner.c");
c_config.file(&parser_path);
c_config.file(&scanner_path);
println!("cargo:rerun-if-changed={}", scanner_path.to_str().unwrap());
println!("cargo:rerun-if-changed={}", parser_path.to_str().unwrap());
c_config.compile("parser");
}

47
bindings/rust/lib.rs Normal file
View File

@ -0,0 +1,47 @@
//! This crate provides css 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 mut parser = tree_sitter::Parser::new();
//! parser.set_language(tree_sitter_css::language()).expect("Error loading css grammar");
//! let tree = parser.parse(code, None).unwrap();
//! ```
//!
//! [Language]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Language.html
//! [language func]: fn.language.html
//! [Parser]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Parser.html
//! [tree-sitter]: https://tree-sitter.github.io/
use tree_sitter::Language;
extern "C" {
fn tree_sitter_css() -> Language;
}
/// 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_css() }
}
/// 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 HIGHLIGHTS_QUERY: &'static str = include_str!("../../queries/highlights.scm");
#[cfg(test)]
mod tests {
#[test]
fn test_can_load_grammar() {
let mut parser = tree_sitter::Parser::new();
parser
.set_language(super::language())
.expect("Error loading css language");
}
}

View File

@ -1,13 +0,0 @@
try {
module.exports = require("./build/Release/tree_sitter_css_binding");
} catch (error) {
try {
module.exports = require("./build/Debug/tree_sitter_css_binding");
} catch (_) {
throw error
}
}
try {
module.exports.nodeTypeInfo = require("./src/node-types.json");
} catch (_) {}

View File

@ -2,7 +2,7 @@
"name": "tree-sitter-css", "name": "tree-sitter-css",
"version": "0.16.0", "version": "0.16.0",
"description": "CSS grammar for tree-sitter", "description": "CSS grammar for tree-sitter",
"main": "index.js", "main": "bindings/node",
"keywords": [ "keywords": [
"parser", "parser",
"lexer" "lexer"
@ -10,10 +10,10 @@
"author": "Max Brunsfeld", "author": "Max Brunsfeld",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"nan": "^2.11.1" "nan": "^2.14.1"
}, },
"devDependencies": { "devDependencies": {
"tree-sitter-cli": "^0.16.7" "tree-sitter-cli": "^0.19.1"
}, },
"scripts": { "scripts": {
"test": "tree-sitter test && tree-sitter parse examples/*.css --quiet --time", "test": "tree-sitter test && tree-sitter parse examples/*.css --quiet --time",

5
src/grammar.json vendored
View File

@ -1659,7 +1659,7 @@
}, },
{ {
"type": "PATTERN", "type": "PATTERN",
"value": "[^*]*\\*+([^\\/*][^*]*\\*+)*" "value": "[^*]*\\*+([^/*][^*]*\\*+)*"
}, },
{ {
"type": "STRING", "type": "STRING",
@ -1700,7 +1700,7 @@
"members": [ "members": [
{ {
"type": "PATTERN", "type": "PATTERN",
"value": "[^\\/\\s,;!{}()\\[\\]]" "value": "[^/\\s,;!{}()\\[\\]]"
}, },
{ {
"type": "PATTERN", "type": "PATTERN",
@ -1729,6 +1729,7 @@
"declaration" "declaration"
] ]
], ],
"precedences": [],
"externals": [ "externals": [
{ {
"type": "SYMBOL", "type": "SYMBOL",

4
src/node-types.json vendored
View File

@ -1727,6 +1727,10 @@
"type": "class_name", "type": "class_name",
"named": true "named": true
}, },
{
"type": "comment",
"named": true
},
{ {
"type": "feature_name", "type": "feature_name",
"named": true "named": true

403
src/parser.c vendored
View File

@ -5,15 +5,16 @@
#pragma GCC diagnostic ignored "-Wmissing-field-initializers" #pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#endif #endif
#define LANGUAGE_VERSION 11 #define LANGUAGE_VERSION 13
#define STATE_COUNT 278 #define STATE_COUNT 278
#define LARGE_STATE_COUNT 2 #define LARGE_STATE_COUNT 2
#define SYMBOL_COUNT 102 #define SYMBOL_COUNT 102
#define ALIAS_COUNT 10 #define ALIAS_COUNT 9
#define TOKEN_COUNT 52 #define TOKEN_COUNT 52
#define EXTERNAL_TOKEN_COUNT 1 #define EXTERNAL_TOKEN_COUNT 1
#define FIELD_COUNT 0 #define FIELD_COUNT 0
#define MAX_ALIAS_SEQUENCE_LENGTH 6 #define MAX_ALIAS_SEQUENCE_LENGTH 6
#define PRODUCTION_ID_COUNT 15
enum { enum {
anon_sym_ATimport = 1, anon_sym_ATimport = 1,
@ -117,16 +118,15 @@ enum {
aux_sym_pseudo_class_arguments_repeat2 = 99, aux_sym_pseudo_class_arguments_repeat2 = 99,
aux_sym_declaration_repeat1 = 100, aux_sym_declaration_repeat1 = 100,
aux_sym_arguments_repeat1 = 101, aux_sym_arguments_repeat1 = 101,
alias_sym_attribute_name = 102, alias_sym_class_name = 102,
alias_sym_class_name = 103, alias_sym_feature_name = 103,
alias_sym_feature_name = 104, alias_sym_function_name = 104,
alias_sym_function_name = 105, alias_sym_id_name = 105,
alias_sym_id_name = 106, alias_sym_keyframes_name = 106,
alias_sym_keyframes_name = 107, alias_sym_keyword_query = 107,
alias_sym_keyword_query = 108, alias_sym_namespace_name = 108,
alias_sym_namespace_name = 109, alias_sym_property_name = 109,
alias_sym_property_name = 110, alias_sym_tag_name = 110,
alias_sym_tag_name = 111,
}; };
static const char *ts_symbol_names[] = { static const char *ts_symbol_names[] = {
@ -177,7 +177,7 @@ static const char *ts_symbol_names[] = {
[sym_unit] = "unit", [sym_unit] = "unit",
[anon_sym_DASH] = "-", [anon_sym_DASH] = "-",
[anon_sym_SLASH] = "/", [anon_sym_SLASH] = "/",
[sym_identifier] = "identifier", [sym_identifier] = "attribute_name",
[sym_at_keyword] = "at_keyword", [sym_at_keyword] = "at_keyword",
[sym_comment] = "comment", [sym_comment] = "comment",
[sym_plain_value] = "plain_value", [sym_plain_value] = "plain_value",
@ -232,7 +232,6 @@ static const char *ts_symbol_names[] = {
[aux_sym_pseudo_class_arguments_repeat2] = "pseudo_class_arguments_repeat2", [aux_sym_pseudo_class_arguments_repeat2] = "pseudo_class_arguments_repeat2",
[aux_sym_declaration_repeat1] = "declaration_repeat1", [aux_sym_declaration_repeat1] = "declaration_repeat1",
[aux_sym_arguments_repeat1] = "arguments_repeat1", [aux_sym_arguments_repeat1] = "arguments_repeat1",
[alias_sym_attribute_name] = "attribute_name",
[alias_sym_class_name] = "class_name", [alias_sym_class_name] = "class_name",
[alias_sym_feature_name] = "feature_name", [alias_sym_feature_name] = "feature_name",
[alias_sym_function_name] = "function_name", [alias_sym_function_name] = "function_name",
@ -347,7 +346,6 @@ static TSSymbol ts_symbol_map[] = {
[aux_sym_pseudo_class_arguments_repeat2] = aux_sym_pseudo_class_arguments_repeat2, [aux_sym_pseudo_class_arguments_repeat2] = aux_sym_pseudo_class_arguments_repeat2,
[aux_sym_declaration_repeat1] = aux_sym_declaration_repeat1, [aux_sym_declaration_repeat1] = aux_sym_declaration_repeat1,
[aux_sym_arguments_repeat1] = aux_sym_arguments_repeat1, [aux_sym_arguments_repeat1] = aux_sym_arguments_repeat1,
[alias_sym_attribute_name] = alias_sym_attribute_name,
[alias_sym_class_name] = alias_sym_class_name, [alias_sym_class_name] = alias_sym_class_name,
[alias_sym_feature_name] = alias_sym_feature_name, [alias_sym_feature_name] = alias_sym_feature_name,
[alias_sym_function_name] = alias_sym_function_name, [alias_sym_function_name] = alias_sym_function_name,
@ -768,10 +766,6 @@ static const TSSymbolMetadata ts_symbol_metadata[] = {
.visible = false, .visible = false,
.named = false, .named = false,
}, },
[alias_sym_attribute_name] = {
.visible = true,
.named = true,
},
[alias_sym_class_name] = { [alias_sym_class_name] = {
.visible = true, .visible = true,
.named = true, .named = true,
@ -810,7 +804,7 @@ static const TSSymbolMetadata ts_symbol_metadata[] = {
}, },
}; };
static TSSymbol ts_alias_sequences[17][MAX_ALIAS_SEQUENCE_LENGTH] = { static TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE_LENGTH] = {
[0] = {0}, [0] = {0},
[1] = { [1] = {
[0] = alias_sym_tag_name, [0] = alias_sym_tag_name,
@ -837,31 +831,65 @@ static TSSymbol ts_alias_sequences[17][MAX_ALIAS_SEQUENCE_LENGTH] = {
[1] = alias_sym_keyframes_name, [1] = alias_sym_keyframes_name,
}, },
[9] = { [9] = {
[1] = alias_sym_attribute_name,
},
[10] = {
[2] = alias_sym_class_name, [2] = alias_sym_class_name,
}, },
[11] = { [10] = {
[2] = alias_sym_tag_name, [2] = alias_sym_tag_name,
}, },
[12] = { [11] = {
[2] = alias_sym_id_name, [2] = alias_sym_id_name,
}, },
[13] = { [12] = {
[1] = alias_sym_namespace_name, [1] = alias_sym_namespace_name,
}, },
[14] = { [13] = {
[0] = alias_sym_property_name, [0] = alias_sym_property_name,
}, },
[15] = { [14] = {
[2] = alias_sym_attribute_name,
},
[16] = {
[1] = alias_sym_feature_name, [1] = alias_sym_feature_name,
}, },
}; };
static uint16_t ts_non_terminal_alias_map[] = {
0,
};
static inline bool sym_plain_value_character_set_1(int32_t c) {
return (c < ','
? (c < '\r'
? (c < '\t'
? c == 0
: c <= '\n')
: (c <= '\r' || (c < '('
? (c >= ' ' && c <= '!')
: c <= ')')))
: (c <= ',' || (c < ']'
? (c < '['
? c == ';'
: c <= '[')
: (c <= ']' || (c < '}'
? c == '{'
: c <= '}')))));
}
static inline bool sym_plain_value_character_set_2(int32_t c) {
return (c < ','
? (c < '\r'
? (c < '\t'
? c == 0
: c <= '\n')
: (c <= '\r' || (c < '('
? (c >= ' ' && c <= '!')
: c <= '*')))
: (c <= ',' || (c < ']'
? (c < '['
? c == ';'
: c <= '[')
: (c <= ']' || (c < '}'
? c == '{'
: c <= '}')))));
}
static bool ts_lex(TSLexer *lexer, TSStateId state) { static bool ts_lex(TSLexer *lexer, TSStateId state) {
START_LEXER(); START_LEXER();
eof = lexer->eof(lexer); eof = lexer->eof(lexer);
@ -1054,7 +1082,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
END_STATE(); END_STATE();
case 6: case 6:
if (lookahead == '"') ADVANCE(156); if (lookahead == '"') ADVANCE(156);
if (lookahead == '\\') ADVANCE(69); if (lookahead == '\\') ADVANCE(71);
if (lookahead != 0 && if (lookahead != 0 &&
lookahead != '\n') ADVANCE(6); lookahead != '\n') ADVANCE(6);
END_STATE(); END_STATE();
@ -1103,7 +1131,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
END_STATE(); END_STATE();
case 9: case 9:
if (lookahead == '\'') ADVANCE(156); if (lookahead == '\'') ADVANCE(156);
if (lookahead == '\\') ADVANCE(70); if (lookahead == '\\') ADVANCE(72);
if (lookahead != 0 && if (lookahead != 0 &&
lookahead != '\n') ADVANCE(9); lookahead != '\n') ADVANCE(9);
END_STATE(); END_STATE();
@ -1199,20 +1227,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
END_STATE(); END_STATE();
case 16: case 16:
if (lookahead == '*') ADVANCE(18); if (lookahead == '*') ADVANCE(18);
if (lookahead != 0 && if (!sym_plain_value_character_set_1(lookahead)) ADVANCE(27);
lookahead != '\t' &&
lookahead != '\n' &&
lookahead != '\r' &&
lookahead != ' ' &&
lookahead != '!' &&
lookahead != '(' &&
lookahead != ')' &&
lookahead != ',' &&
lookahead != ';' &&
lookahead != '[' &&
lookahead != ']' &&
lookahead != '{' &&
lookahead != '}') ADVANCE(27);
END_STATE(); END_STATE();
case 17: case 17:
if (lookahead == '*') ADVANCE(17); if (lookahead == '*') ADVANCE(17);
@ -1288,7 +1303,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
('a' <= lookahead && lookahead <= 'f')) ADVANCE(68); ('a' <= lookahead && lookahead <= 'f')) ADVANCE(68);
END_STATE(); END_STATE();
case 27: case 27:
if (lookahead == '/') ADVANCE(71); if (lookahead == '/') ADVANCE(69);
if (lookahead == '-' || if (lookahead == '-' ||
lookahead == '_') ADVANCE(27); lookahead == '_') ADVANCE(27);
if (('A' <= lookahead && lookahead <= 'Z') || if (('A' <= lookahead && lookahead <= 'Z') ||
@ -1448,48 +1463,24 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
('a' <= lookahead && lookahead <= 'f')) ADVANCE(67); ('a' <= lookahead && lookahead <= 'f')) ADVANCE(67);
END_STATE(); END_STATE();
case 69: case 69:
if (!sym_plain_value_character_set_2(lookahead)) ADVANCE(27);
END_STATE();
case 70:
if (!sym_plain_value_character_set_2(lookahead)) ADVANCE(263);
END_STATE();
case 71:
if (lookahead != 0 && if (lookahead != 0 &&
lookahead != '"' && lookahead != '"' &&
lookahead != '\\') ADVANCE(6); lookahead != '\\') ADVANCE(6);
if (lookahead == '"') ADVANCE(157); if (lookahead == '"') ADVANCE(157);
if (lookahead == '\\') ADVANCE(69); if (lookahead == '\\') ADVANCE(71);
END_STATE(); END_STATE();
case 70: case 72:
if (lookahead != 0 && if (lookahead != 0 &&
lookahead != '\'' && lookahead != '\'' &&
lookahead != '\\') ADVANCE(9); lookahead != '\\') ADVANCE(9);
if (lookahead == '\'') ADVANCE(158); if (lookahead == '\'') ADVANCE(158);
if (lookahead == '\\') ADVANCE(70); if (lookahead == '\\') ADVANCE(72);
END_STATE();
case 71:
if (lookahead != 0 &&
lookahead != '\t' &&
lookahead != '\n' &&
lookahead != '\r' &&
lookahead != ' ' &&
lookahead != '!' &&
(lookahead < '(' || '*' < lookahead) &&
lookahead != ',' &&
lookahead != ';' &&
lookahead != '[' &&
lookahead != ']' &&
lookahead != '{' &&
lookahead != '}') ADVANCE(27);
END_STATE();
case 72:
if (lookahead != 0 &&
lookahead != '\t' &&
lookahead != '\n' &&
lookahead != '\r' &&
lookahead != ' ' &&
lookahead != '!' &&
(lookahead < '(' || '*' < lookahead) &&
lookahead != ',' &&
lookahead != ';' &&
lookahead != '[' &&
lookahead != ']' &&
lookahead != '{' &&
lookahead != '}') ADVANCE(263);
END_STATE(); END_STATE();
case 73: case 73:
if (eof) ADVANCE(76); if (eof) ADVANCE(76);
@ -1871,45 +1862,45 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == '.') ADVANCE(64); if (lookahead == '.') ADVANCE(64);
if (lookahead == 'E' || if (lookahead == 'E' ||
lookahead == 'e') ADVANCE(127); lookahead == 'e') ADVANCE(127);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(133);
if (('A' <= lookahead && lookahead <= 'F') || if (('A' <= lookahead && lookahead <= 'F') ||
('a' <= lookahead && lookahead <= 'f')) ADVANCE(126); ('a' <= lookahead && lookahead <= 'f')) ADVANCE(126);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(133);
END_STATE(); END_STATE();
case 135: case 135:
ACCEPT_TOKEN(aux_sym_color_value_token1); ACCEPT_TOKEN(aux_sym_color_value_token1);
if (lookahead == '.') ADVANCE(64); if (lookahead == '.') ADVANCE(64);
if (lookahead == 'E' || if (lookahead == 'E' ||
lookahead == 'e') ADVANCE(129); lookahead == 'e') ADVANCE(129);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(136);
if (('A' <= lookahead && lookahead <= 'F') || if (('A' <= lookahead && lookahead <= 'F') ||
('a' <= lookahead && lookahead <= 'f')) ADVANCE(149); ('a' <= lookahead && lookahead <= 'f')) ADVANCE(149);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(136);
END_STATE(); END_STATE();
case 136: case 136:
ACCEPT_TOKEN(aux_sym_color_value_token1); ACCEPT_TOKEN(aux_sym_color_value_token1);
if (lookahead == '.') ADVANCE(64); if (lookahead == '.') ADVANCE(64);
if (lookahead == 'E' || if (lookahead == 'E' ||
lookahead == 'e') ADVANCE(130); lookahead == 'e') ADVANCE(130);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(137);
if (('A' <= lookahead && lookahead <= 'F') || if (('A' <= lookahead && lookahead <= 'F') ||
('a' <= lookahead && lookahead <= 'f')) ADVANCE(147); ('a' <= lookahead && lookahead <= 'f')) ADVANCE(147);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(137);
END_STATE(); END_STATE();
case 137: case 137:
ACCEPT_TOKEN(aux_sym_color_value_token1); ACCEPT_TOKEN(aux_sym_color_value_token1);
if (lookahead == '.') ADVANCE(64); if (lookahead == '.') ADVANCE(64);
if (lookahead == 'E' || if (lookahead == 'E' ||
lookahead == 'e') ADVANCE(128); lookahead == 'e') ADVANCE(128);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(134);
if (('A' <= lookahead && lookahead <= 'F') || if (('A' <= lookahead && lookahead <= 'F') ||
('a' <= lookahead && lookahead <= 'f')) ADVANCE(145); ('a' <= lookahead && lookahead <= 'f')) ADVANCE(145);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(134);
END_STATE(); END_STATE();
case 138: case 138:
ACCEPT_TOKEN(aux_sym_color_value_token1); ACCEPT_TOKEN(aux_sym_color_value_token1);
if (lookahead == '.') ADVANCE(64); if (lookahead == '.') ADVANCE(64);
if (lookahead == 'E' || if (lookahead == 'E' ||
lookahead == 'e') ADVANCE(131); lookahead == 'e') ADVANCE(131);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(135);
if (('A' <= lookahead && lookahead <= 'F') || if (('A' <= lookahead && lookahead <= 'F') ||
('a' <= lookahead && lookahead <= 'f')) ADVANCE(151); ('a' <= lookahead && lookahead <= 'f')) ADVANCE(151);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(135);
END_STATE(); END_STATE();
case 139: case 139:
ACCEPT_TOKEN(aux_sym_color_value_token1); ACCEPT_TOKEN(aux_sym_color_value_token1);
@ -2039,14 +2030,14 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
case 157: case 157:
ACCEPT_TOKEN(sym_string_value); ACCEPT_TOKEN(sym_string_value);
if (lookahead == '"') ADVANCE(156); if (lookahead == '"') ADVANCE(156);
if (lookahead == '\\') ADVANCE(69); if (lookahead == '\\') ADVANCE(71);
if (lookahead != 0 && if (lookahead != 0 &&
lookahead != '\n') ADVANCE(6); lookahead != '\n') ADVANCE(6);
END_STATE(); END_STATE();
case 158: case 158:
ACCEPT_TOKEN(sym_string_value); ACCEPT_TOKEN(sym_string_value);
if (lookahead == '\'') ADVANCE(156); if (lookahead == '\'') ADVANCE(156);
if (lookahead == '\\') ADVANCE(70); if (lookahead == '\\') ADVANCE(72);
if (lookahead != 0 && if (lookahead != 0 &&
lookahead != '\n') ADVANCE(9); lookahead != '\n') ADVANCE(9);
END_STATE(); END_STATE();
@ -2062,9 +2053,9 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == '.') ADVANCE(64); if (lookahead == '.') ADVANCE(64);
if (lookahead == 'E' || if (lookahead == 'E' ||
lookahead == 'e') ADVANCE(132); lookahead == 'e') ADVANCE(132);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(138);
if (('A' <= lookahead && lookahead <= 'F') || if (('A' <= lookahead && lookahead <= 'F') ||
('a' <= lookahead && lookahead <= 'f')) ADVANCE(153); ('a' <= lookahead && lookahead <= 'f')) ADVANCE(153);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(138);
END_STATE(); END_STATE();
case 161: case 161:
ACCEPT_TOKEN(aux_sym_integer_value_token1); ACCEPT_TOKEN(aux_sym_integer_value_token1);
@ -2082,9 +2073,9 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == '.') ADVANCE(64); if (lookahead == '.') ADVANCE(64);
if (lookahead == 'E' || if (lookahead == 'E' ||
lookahead == 'e') ADVANCE(21); lookahead == 'e') ADVANCE(21);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(160);
if (('A' <= lookahead && lookahead <= 'F') || if (('A' <= lookahead && lookahead <= 'F') ||
('a' <= lookahead && lookahead <= 'f')) ADVANCE(67); ('a' <= lookahead && lookahead <= 'f')) ADVANCE(67);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(160);
END_STATE(); END_STATE();
case 163: case 163:
ACCEPT_TOKEN(aux_sym_integer_value_token1); ACCEPT_TOKEN(aux_sym_integer_value_token1);
@ -2092,26 +2083,13 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
END_STATE(); END_STATE();
case 164: case 164:
ACCEPT_TOKEN(aux_sym_float_value_token1); ACCEPT_TOKEN(aux_sym_float_value_token1);
if (lookahead == '/') ADVANCE(72); if (lookahead == '/') ADVANCE(70);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(164); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(164);
if (lookahead == '-' || if (lookahead == '-' ||
('A' <= lookahead && lookahead <= 'Z') || ('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' || lookahead == '_' ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(197); ('a' <= lookahead && lookahead <= 'z')) ADVANCE(197);
if (lookahead != 0 && if (!sym_plain_value_character_set_1(lookahead)) ADVANCE(263);
lookahead != '\t' &&
lookahead != '\n' &&
lookahead != '\r' &&
lookahead != ' ' &&
lookahead != '!' &&
lookahead != '(' &&
lookahead != ')' &&
lookahead != ',' &&
lookahead != ';' &&
lookahead != '[' &&
lookahead != ']' &&
lookahead != '{' &&
lookahead != '}') ADVANCE(263);
END_STATE(); END_STATE();
case 165: case 165:
ACCEPT_TOKEN(aux_sym_float_value_token1); ACCEPT_TOKEN(aux_sym_float_value_token1);
@ -2270,70 +2248,31 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
ACCEPT_TOKEN(sym_unit); ACCEPT_TOKEN(sym_unit);
if (lookahead == '%') ADVANCE(184); if (lookahead == '%') ADVANCE(184);
if (lookahead == '-') ADVANCE(196); if (lookahead == '-') ADVANCE(196);
if (lookahead == '/') ADVANCE(72); if (lookahead == '/') ADVANCE(70);
if (lookahead == '_') ADVANCE(197); if (lookahead == '_') ADVANCE(197);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(164); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(164);
if (('A' <= lookahead && lookahead <= 'Z') || if (('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(183); ('a' <= lookahead && lookahead <= 'z')) ADVANCE(183);
if (lookahead != 0 && if (!sym_plain_value_character_set_1(lookahead)) ADVANCE(263);
lookahead != '\t' &&
lookahead != '\n' &&
lookahead != '\r' &&
lookahead != ' ' &&
lookahead != '!' &&
lookahead != '(' &&
lookahead != ')' &&
lookahead != ',' &&
lookahead != ';' &&
lookahead != '[' &&
lookahead != ']' &&
lookahead != '{' &&
lookahead != '}') ADVANCE(263);
END_STATE(); END_STATE();
case 183: case 183:
ACCEPT_TOKEN(sym_unit); ACCEPT_TOKEN(sym_unit);
if (lookahead == '%') ADVANCE(184); if (lookahead == '%') ADVANCE(184);
if (lookahead == '/') ADVANCE(72); if (lookahead == '/') ADVANCE(70);
if (lookahead == '-' || if (lookahead == '-' ||
('0' <= lookahead && lookahead <= '9') || ('0' <= lookahead && lookahead <= '9') ||
lookahead == '_') ADVANCE(197); lookahead == '_') ADVANCE(197);
if (('A' <= lookahead && lookahead <= 'Z') || if (('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(183); ('a' <= lookahead && lookahead <= 'z')) ADVANCE(183);
if (lookahead != 0 && if (!sym_plain_value_character_set_1(lookahead)) ADVANCE(263);
lookahead != '\t' &&
lookahead != '\n' &&
lookahead != '\r' &&
lookahead != ' ' &&
lookahead != '!' &&
lookahead != '(' &&
lookahead != ')' &&
lookahead != ',' &&
lookahead != ';' &&
lookahead != '[' &&
lookahead != ']' &&
lookahead != '{' &&
lookahead != '}') ADVANCE(263);
END_STATE(); END_STATE();
case 184: case 184:
ACCEPT_TOKEN(sym_unit); ACCEPT_TOKEN(sym_unit);
if (lookahead == '/') ADVANCE(72); if (lookahead == '/') ADVANCE(70);
if (lookahead == '%' || if (lookahead == '%' ||
('A' <= lookahead && lookahead <= 'Z') || ('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(184); ('a' <= lookahead && lookahead <= 'z')) ADVANCE(184);
if (lookahead != 0 && if (!sym_plain_value_character_set_1(lookahead)) ADVANCE(263);
lookahead != '\t' &&
lookahead != '\n' &&
lookahead != '\r' &&
lookahead != ' ' &&
lookahead != '!' &&
lookahead != '(' &&
lookahead != ')' &&
lookahead != ',' &&
lookahead != ';' &&
lookahead != '[' &&
lookahead != ']' &&
lookahead != '{' &&
lookahead != '}') ADVANCE(263);
END_STATE(); END_STATE();
case 185: case 185:
ACCEPT_TOKEN(sym_unit); ACCEPT_TOKEN(sym_unit);
@ -2347,7 +2286,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
case 187: case 187:
ACCEPT_TOKEN(anon_sym_DASH); ACCEPT_TOKEN(anon_sym_DASH);
if (lookahead == '.') ADVANCE(64); if (lookahead == '.') ADVANCE(64);
if (lookahead == '/') ADVANCE(71); if (lookahead == '/') ADVANCE(69);
if (lookahead == '-' || if (lookahead == '-' ||
lookahead == '_') ADVANCE(195); lookahead == '_') ADVANCE(195);
if (lookahead == 'E' || if (lookahead == 'E' ||
@ -2378,43 +2317,17 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
case 191: case 191:
ACCEPT_TOKEN(anon_sym_SLASH); ACCEPT_TOKEN(anon_sym_SLASH);
if (lookahead == '*') ADVANCE(18); if (lookahead == '*') ADVANCE(18);
if (lookahead != 0 && if (!sym_plain_value_character_set_1(lookahead)) ADVANCE(27);
lookahead != '\t' &&
lookahead != '\n' &&
lookahead != '\r' &&
lookahead != ' ' &&
lookahead != '!' &&
lookahead != '(' &&
lookahead != ')' &&
lookahead != ',' &&
lookahead != ';' &&
lookahead != '[' &&
lookahead != ']' &&
lookahead != '{' &&
lookahead != '}') ADVANCE(27);
END_STATE(); END_STATE();
case 192: case 192:
ACCEPT_TOKEN(sym_identifier); ACCEPT_TOKEN(sym_identifier);
if (lookahead == '-') ADVANCE(196); if (lookahead == '-') ADVANCE(196);
if (lookahead == '/') ADVANCE(72); if (lookahead == '/') ADVANCE(70);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(164); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(164);
if (('A' <= lookahead && lookahead <= 'Z') || if (('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' || lookahead == '_' ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(197); ('a' <= lookahead && lookahead <= 'z')) ADVANCE(197);
if (lookahead != 0 && if (!sym_plain_value_character_set_1(lookahead)) ADVANCE(263);
lookahead != '\t' &&
lookahead != '\n' &&
lookahead != '\r' &&
lookahead != ' ' &&
lookahead != '!' &&
lookahead != '(' &&
lookahead != ')' &&
lookahead != ',' &&
lookahead != ';' &&
lookahead != '[' &&
lookahead != ']' &&
lookahead != '{' &&
lookahead != '}') ADVANCE(263);
END_STATE(); END_STATE();
case 193: case 193:
ACCEPT_TOKEN(sym_identifier); ACCEPT_TOKEN(sym_identifier);
@ -2427,7 +2340,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
case 194: case 194:
ACCEPT_TOKEN(sym_identifier); ACCEPT_TOKEN(sym_identifier);
if (lookahead == '.') ADVANCE(64); if (lookahead == '.') ADVANCE(64);
if (lookahead == '/') ADVANCE(71); if (lookahead == '/') ADVANCE(69);
if (lookahead == '-' || if (lookahead == '-' ||
lookahead == '_') ADVANCE(195); lookahead == '_') ADVANCE(195);
if (lookahead == 'E' || if (lookahead == 'E' ||
@ -2438,7 +2351,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
END_STATE(); END_STATE();
case 195: case 195:
ACCEPT_TOKEN(sym_identifier); ACCEPT_TOKEN(sym_identifier);
if (lookahead == '/') ADVANCE(71); if (lookahead == '/') ADVANCE(69);
if (lookahead == '-' || if (lookahead == '-' ||
lookahead == '_') ADVANCE(195); lookahead == '_') ADVANCE(195);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(213); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(213);
@ -2447,49 +2360,23 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
END_STATE(); END_STATE();
case 196: case 196:
ACCEPT_TOKEN(sym_identifier); ACCEPT_TOKEN(sym_identifier);
if (lookahead == '/') ADVANCE(72); if (lookahead == '/') ADVANCE(70);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(164); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(164);
if (lookahead == '-' || if (lookahead == '-' ||
('A' <= lookahead && lookahead <= 'Z') || ('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' || lookahead == '_' ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(197); ('a' <= lookahead && lookahead <= 'z')) ADVANCE(197);
if (lookahead != 0 && if (!sym_plain_value_character_set_1(lookahead)) ADVANCE(263);
lookahead != '\t' &&
lookahead != '\n' &&
lookahead != '\r' &&
lookahead != ' ' &&
lookahead != '!' &&
lookahead != '(' &&
lookahead != ')' &&
lookahead != ',' &&
lookahead != ';' &&
lookahead != '[' &&
lookahead != ']' &&
lookahead != '{' &&
lookahead != '}') ADVANCE(263);
END_STATE(); END_STATE();
case 197: case 197:
ACCEPT_TOKEN(sym_identifier); ACCEPT_TOKEN(sym_identifier);
if (lookahead == '/') ADVANCE(72); if (lookahead == '/') ADVANCE(70);
if (lookahead == '-' || if (lookahead == '-' ||
('0' <= lookahead && lookahead <= '9') || ('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') || ('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' || lookahead == '_' ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(197); ('a' <= lookahead && lookahead <= 'z')) ADVANCE(197);
if (lookahead != 0 && if (!sym_plain_value_character_set_1(lookahead)) ADVANCE(263);
lookahead != '\t' &&
lookahead != '\n' &&
lookahead != '\r' &&
lookahead != ' ' &&
lookahead != '!' &&
lookahead != '(' &&
lookahead != ')' &&
lookahead != ',' &&
lookahead != ';' &&
lookahead != '[' &&
lookahead != ']' &&
lookahead != '{' &&
lookahead != '}') ADVANCE(263);
END_STATE(); END_STATE();
case 198: case 198:
ACCEPT_TOKEN(sym_identifier); ACCEPT_TOKEN(sym_identifier);
@ -3069,21 +2956,8 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
END_STATE(); END_STATE();
case 263: case 263:
ACCEPT_TOKEN(sym_plain_value); ACCEPT_TOKEN(sym_plain_value);
if (lookahead == '/') ADVANCE(72); if (lookahead == '/') ADVANCE(70);
if (lookahead != 0 && if (!sym_plain_value_character_set_1(lookahead)) ADVANCE(263);
lookahead != '\t' &&
lookahead != '\n' &&
lookahead != '\r' &&
lookahead != ' ' &&
lookahead != '!' &&
lookahead != '(' &&
lookahead != ')' &&
lookahead != ',' &&
lookahead != ';' &&
lookahead != '[' &&
lookahead != ']' &&
lookahead != '{' &&
lookahead != '}') ADVANCE(263);
END_STATE(); END_STATE();
default: default:
return false; return false;
@ -9149,7 +9023,7 @@ static TSParseActionEntry ts_parse_actions[] = {
[181] = {.entry = {.count = 1, .reusable = true}}, SHIFT(153), [181] = {.entry = {.count = 1, .reusable = true}}, SHIFT(153),
[183] = {.entry = {.count = 1, .reusable = true}}, SHIFT(108), [183] = {.entry = {.count = 1, .reusable = true}}, SHIFT(108),
[185] = {.entry = {.count = 1, .reusable = true}}, SHIFT(67), [185] = {.entry = {.count = 1, .reusable = true}}, SHIFT(67),
[187] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_last_declaration, 3, .production_id = 14), [187] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_last_declaration, 3, .production_id = 13),
[189] = {.entry = {.count = 1, .reusable = true}}, SHIFT(109), [189] = {.entry = {.count = 1, .reusable = true}}, SHIFT(109),
[191] = {.entry = {.count = 1, .reusable = true}}, SHIFT(247), [191] = {.entry = {.count = 1, .reusable = true}}, SHIFT(247),
[193] = {.entry = {.count = 1, .reusable = false}}, SHIFT(109), [193] = {.entry = {.count = 1, .reusable = false}}, SHIFT(109),
@ -9190,15 +9064,15 @@ static TSParseActionEntry ts_parse_actions[] = {
[269] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_declaration_repeat1, 2), SHIFT_REPEAT(57), [269] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_declaration_repeat1, 2), SHIFT_REPEAT(57),
[272] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_declaration_repeat1, 2), SHIFT_REPEAT(100), [272] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_declaration_repeat1, 2), SHIFT_REPEAT(100),
[275] = {.entry = {.count = 1, .reusable = true}}, SHIFT(63), [275] = {.entry = {.count = 1, .reusable = true}}, SHIFT(63),
[277] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_last_declaration, 4, .production_id = 14), [277] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_last_declaration, 4, .production_id = 13),
[279] = {.entry = {.count = 1, .reusable = true}}, SHIFT(244), [279] = {.entry = {.count = 1, .reusable = true}}, SHIFT(244),
[281] = {.entry = {.count = 1, .reusable = true}}, SHIFT(189), [281] = {.entry = {.count = 1, .reusable = true}}, SHIFT(189),
[283] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_keyframe_block_list, 3), [283] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_keyframe_block_list, 3),
[285] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_keyframe_block_list, 3), [285] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_keyframe_block_list, 3),
[287] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_at_rule, 2), [287] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_at_rule, 2),
[289] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_at_rule, 2), [289] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_at_rule, 2),
[291] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_namespace_statement, 4, .production_id = 13), [291] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_namespace_statement, 4, .production_id = 12),
[293] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_namespace_statement, 4, .production_id = 13), [293] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_namespace_statement, 4, .production_id = 12),
[295] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_media_statement, 4), [295] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_media_statement, 4),
[297] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_media_statement, 4), [297] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_media_statement, 4),
[299] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_import_statement, 3), [299] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_import_statement, 3),
@ -9217,8 +9091,8 @@ static TSParseActionEntry ts_parse_actions[] = {
[329] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_pseudo_class_arguments_repeat1, 2), SHIFT_REPEAT(80), [329] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_pseudo_class_arguments_repeat1, 2), SHIFT_REPEAT(80),
[332] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_pseudo_class_arguments_repeat1, 2), SHIFT_REPEAT(57), [332] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_pseudo_class_arguments_repeat1, 2), SHIFT_REPEAT(57),
[335] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_pseudo_class_arguments_repeat1, 2), SHIFT_REPEAT(110), [335] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_pseudo_class_arguments_repeat1, 2), SHIFT_REPEAT(110),
[338] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_declaration, 4, .production_id = 14), [338] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_declaration, 4, .production_id = 13),
[340] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_declaration, 4, .production_id = 14), [340] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_declaration, 4, .production_id = 13),
[342] = {.entry = {.count = 1, .reusable = true}}, SHIFT(257), [342] = {.entry = {.count = 1, .reusable = true}}, SHIFT(257),
[344] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12), [344] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12),
[346] = {.entry = {.count = 1, .reusable = true}}, SHIFT(135), [346] = {.entry = {.count = 1, .reusable = true}}, SHIFT(135),
@ -9226,8 +9100,8 @@ static TSParseActionEntry ts_parse_actions[] = {
[350] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_import_statement, 5), [350] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_import_statement, 5),
[352] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_at_rule, 4), [352] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_at_rule, 4),
[354] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_at_rule, 4), [354] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_at_rule, 4),
[356] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_declaration, 5, .production_id = 14), [356] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_declaration, 5, .production_id = 13),
[358] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_declaration, 5, .production_id = 14), [358] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_declaration, 5, .production_id = 13),
[360] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block, 4), [360] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block, 4),
[362] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block, 4), [362] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block, 4),
[364] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_arguments_repeat1, 2), [364] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_arguments_repeat1, 2),
@ -9235,8 +9109,8 @@ static TSParseActionEntry ts_parse_actions[] = {
[368] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_at_rule, 3), [368] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_at_rule, 3),
[370] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_charset_statement, 3), [370] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_charset_statement, 3),
[372] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_charset_statement, 3), [372] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_charset_statement, 3),
[374] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_declaration, 6, .production_id = 14), [374] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_declaration, 6, .production_id = 13),
[376] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_declaration, 6, .production_id = 14), [376] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_declaration, 6, .production_id = 13),
[378] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block, 2), [378] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block, 2),
[380] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block, 2), [380] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_block, 2),
[382] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_rule_set, 2), [382] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_rule_set, 2),
@ -9328,8 +9202,8 @@ static TSParseActionEntry ts_parse_actions[] = {
[554] = {.entry = {.count = 1, .reusable = false}}, SHIFT(210), [554] = {.entry = {.count = 1, .reusable = false}}, SHIFT(210),
[556] = {.entry = {.count = 1, .reusable = true}}, SHIFT(30), [556] = {.entry = {.count = 1, .reusable = true}}, SHIFT(30),
[558] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), [558] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6),
[560] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pseudo_class_selector, 3, .production_id = 10), [560] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pseudo_class_selector, 3, .production_id = 9),
[562] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_pseudo_class_selector, 3, .production_id = 10), [562] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_pseudo_class_selector, 3, .production_id = 9),
[564] = {.entry = {.count = 1, .reusable = true}}, SHIFT(89), [564] = {.entry = {.count = 1, .reusable = true}}, SHIFT(89),
[566] = {.entry = {.count = 1, .reusable = false}}, SHIFT(89), [566] = {.entry = {.count = 1, .reusable = false}}, SHIFT(89),
[568] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), [568] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13),
@ -9344,12 +9218,12 @@ static TSParseActionEntry ts_parse_actions[] = {
[586] = {.entry = {.count = 1, .reusable = false}}, SHIFT(85), [586] = {.entry = {.count = 1, .reusable = false}}, SHIFT(85),
[588] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), [588] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14),
[590] = {.entry = {.count = 1, .reusable = false}}, SHIFT(14), [590] = {.entry = {.count = 1, .reusable = false}}, SHIFT(14),
[592] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pseudo_element_selector, 3, .production_id = 11), [592] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pseudo_element_selector, 3, .production_id = 10),
[594] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_pseudo_element_selector, 3, .production_id = 11), [594] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_pseudo_element_selector, 3, .production_id = 10),
[596] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute_selector, 5, .production_id = 9), [596] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute_selector, 5),
[598] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attribute_selector, 5, .production_id = 9), [598] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attribute_selector, 5),
[600] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_id_selector, 3, .production_id = 12), [600] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_id_selector, 3, .production_id = 11),
[602] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_id_selector, 3, .production_id = 12), [602] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_id_selector, 3, .production_id = 11),
[604] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_class_selector, 2, .production_id = 4), [604] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_class_selector, 2, .production_id = 4),
[606] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_class_selector, 2, .production_id = 4), [606] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_class_selector, 2, .production_id = 4),
[608] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_child_selector, 3), [608] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_child_selector, 3),
@ -9365,21 +9239,21 @@ static TSParseActionEntry ts_parse_actions[] = {
[628] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_id_selector, 2, .production_id = 6), [628] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_id_selector, 2, .production_id = 6),
[630] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pseudo_class_selector, 3, .production_id = 4), [630] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pseudo_class_selector, 3, .production_id = 4),
[632] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_pseudo_class_selector, 3, .production_id = 4), [632] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_pseudo_class_selector, 3, .production_id = 4),
[634] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute_selector, 3, .production_id = 9), [634] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute_selector, 3),
[636] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attribute_selector, 3, .production_id = 9), [636] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attribute_selector, 3),
[638] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute_selector, 6, .production_id = 15), [638] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute_selector, 6),
[640] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attribute_selector, 6, .production_id = 15), [640] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attribute_selector, 6),
[642] = {.entry = {.count = 1, .reusable = true}}, SHIFT(86), [642] = {.entry = {.count = 1, .reusable = true}}, SHIFT(86),
[644] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pseudo_class_arguments, 3), [644] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pseudo_class_arguments, 3),
[646] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_pseudo_class_arguments, 3), [646] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_pseudo_class_arguments, 3),
[648] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pseudo_class_arguments, 4), [648] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pseudo_class_arguments, 4),
[650] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_pseudo_class_arguments, 4), [650] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_pseudo_class_arguments, 4),
[652] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pseudo_class_selector, 4, .production_id = 10), [652] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pseudo_class_selector, 4, .production_id = 9),
[654] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_pseudo_class_selector, 4, .production_id = 10), [654] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_pseudo_class_selector, 4, .production_id = 9),
[656] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute_selector, 4, .production_id = 15), [656] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute_selector, 4),
[658] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attribute_selector, 4, .production_id = 15), [658] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attribute_selector, 4),
[660] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_class_selector, 3, .production_id = 10), [660] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_class_selector, 3, .production_id = 9),
[662] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_class_selector, 3, .production_id = 10), [662] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_class_selector, 3, .production_id = 9),
[664] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_descendant_selector, 3), [664] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_descendant_selector, 3),
[666] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_descendant_selector, 3), [666] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_descendant_selector, 3),
[668] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), [668] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18),
@ -9425,7 +9299,7 @@ static TSParseActionEntry ts_parse_actions[] = {
[751] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_keyframe_block_list_repeat1, 2), SHIFT_REPEAT(240), [751] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_keyframe_block_list_repeat1, 2), SHIFT_REPEAT(240),
[754] = {.entry = {.count = 1, .reusable = true}}, SHIFT(29), [754] = {.entry = {.count = 1, .reusable = true}}, SHIFT(29),
[756] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__query, 1, .production_id = 3), [756] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__query, 1, .production_id = 3),
[758] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_feature_query, 5, .production_id = 16), [758] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_feature_query, 5, .production_id = 14),
[760] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_selector_query, 4), [760] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_selector_query, 4),
[762] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_parenthesized_query, 3), [762] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_parenthesized_query, 3),
[764] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_binary_query, 3), [764] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_binary_query, 3),
@ -9471,7 +9345,7 @@ static TSParseActionEntry ts_parse_actions[] = {
[848] = {.entry = {.count = 1, .reusable = false}}, SHIFT(130), [848] = {.entry = {.count = 1, .reusable = false}}, SHIFT(130),
[850] = {.entry = {.count = 1, .reusable = true}}, SHIFT(156), [850] = {.entry = {.count = 1, .reusable = true}}, SHIFT(156),
[852] = {.entry = {.count = 1, .reusable = true}}, SHIFT(61), [852] = {.entry = {.count = 1, .reusable = true}}, SHIFT(61),
[854] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_last_declaration, 5, .production_id = 14), [854] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_last_declaration, 5, .production_id = 13),
[856] = {.entry = {.count = 1, .reusable = true}}, SHIFT(187), [856] = {.entry = {.count = 1, .reusable = true}}, SHIFT(187),
[858] = {.entry = {.count = 1, .reusable = true}}, SHIFT(88), [858] = {.entry = {.count = 1, .reusable = true}}, SHIFT(88),
[860] = {.entry = {.count = 1, .reusable = true}}, SHIFT(122), [860] = {.entry = {.count = 1, .reusable = true}}, SHIFT(122),
@ -9519,20 +9393,23 @@ extern const TSLanguage *tree_sitter_css(void) {
.symbol_count = SYMBOL_COUNT, .symbol_count = SYMBOL_COUNT,
.alias_count = ALIAS_COUNT, .alias_count = ALIAS_COUNT,
.token_count = TOKEN_COUNT, .token_count = TOKEN_COUNT,
.external_token_count = EXTERNAL_TOKEN_COUNT,
.state_count = STATE_COUNT,
.large_state_count = LARGE_STATE_COUNT, .large_state_count = LARGE_STATE_COUNT,
.symbol_metadata = ts_symbol_metadata, .production_id_count = PRODUCTION_ID_COUNT,
.parse_table = (const unsigned short *)ts_parse_table, .field_count = FIELD_COUNT,
.max_alias_sequence_length = MAX_ALIAS_SEQUENCE_LENGTH,
.parse_table = (const uint16_t *)ts_parse_table,
.small_parse_table = (const uint16_t *)ts_small_parse_table, .small_parse_table = (const uint16_t *)ts_small_parse_table,
.small_parse_table_map = (const uint32_t *)ts_small_parse_table_map, .small_parse_table_map = (const uint32_t *)ts_small_parse_table_map,
.parse_actions = ts_parse_actions, .parse_actions = ts_parse_actions,
.lex_modes = ts_lex_modes,
.symbol_names = ts_symbol_names, .symbol_names = ts_symbol_names,
.symbol_metadata = ts_symbol_metadata,
.public_symbol_map = ts_symbol_map, .public_symbol_map = ts_symbol_map,
.alias_map = ts_non_terminal_alias_map,
.alias_sequences = (const TSSymbol *)ts_alias_sequences, .alias_sequences = (const TSSymbol *)ts_alias_sequences,
.field_count = FIELD_COUNT, .lex_modes = ts_lex_modes,
.max_alias_sequence_length = MAX_ALIAS_SEQUENCE_LENGTH,
.lex_fn = ts_lex, .lex_fn = ts_lex,
.external_token_count = EXTERNAL_TOKEN_COUNT,
.external_scanner = { .external_scanner = {
(const bool *)ts_external_scanner_states, (const bool *)ts_external_scanner_states,
ts_external_scanner_symbol_map, ts_external_scanner_symbol_map,

View File

@ -13,6 +13,8 @@ extern "C" {
#define ts_builtin_sym_end 0 #define ts_builtin_sym_end 0
#define TREE_SITTER_SERIALIZATION_BUFFER_SIZE 1024 #define TREE_SITTER_SERIALIZATION_BUFFER_SIZE 1024
typedef uint16_t TSStateId;
#ifndef TREE_SITTER_API_H_ #ifndef TREE_SITTER_API_H_
typedef uint16_t TSSymbol; typedef uint16_t TSSymbol;
typedef uint16_t TSFieldId; typedef uint16_t TSFieldId;
@ -30,11 +32,10 @@ typedef struct {
uint16_t length; uint16_t length;
} TSFieldMapSlice; } TSFieldMapSlice;
typedef uint16_t TSStateId;
typedef struct { typedef struct {
bool visible : 1; bool visible;
bool named : 1; bool named;
bool supertype;
} TSSymbolMetadata; } TSSymbolMetadata;
typedef struct TSLexer TSLexer; typedef struct TSLexer TSLexer;
@ -56,21 +57,21 @@ typedef enum {
TSParseActionTypeRecover, TSParseActionTypeRecover,
} TSParseActionType; } TSParseActionType;
typedef struct { typedef union {
union {
struct { struct {
uint8_t type;
TSStateId state; TSStateId state;
bool extra : 1; bool extra;
bool repetition : 1; bool repetition;
} shift; } shift;
struct { struct {
uint8_t type;
uint8_t child_count;
TSSymbol symbol; TSSymbol symbol;
int16_t dynamic_precedence; int16_t dynamic_precedence;
uint8_t child_count; uint16_t production_id;
uint8_t production_id;
} reduce; } reduce;
} params; uint8_t type;
TSParseActionType type : 4;
} TSParseAction; } TSParseAction;
typedef struct { typedef struct {
@ -82,7 +83,7 @@ typedef union {
TSParseAction action; TSParseAction action;
struct { struct {
uint8_t count; uint8_t count;
bool reusable : 1; bool reusable;
} entry; } entry;
} TSParseActionEntry; } TSParseActionEntry;
@ -92,13 +93,24 @@ struct TSLanguage {
uint32_t alias_count; uint32_t alias_count;
uint32_t token_count; uint32_t token_count;
uint32_t external_token_count; uint32_t external_token_count;
const char **symbol_names; uint32_t state_count;
const TSSymbolMetadata *symbol_metadata; uint32_t large_state_count;
const uint16_t *parse_table; uint32_t production_id_count;
const TSParseActionEntry *parse_actions; uint32_t field_count;
const TSLexMode *lex_modes;
const TSSymbol *alias_sequences;
uint16_t max_alias_sequence_length; uint16_t max_alias_sequence_length;
const uint16_t *parse_table;
const uint16_t *small_parse_table;
const uint32_t *small_parse_table_map;
const TSParseActionEntry *parse_actions;
const char **symbol_names;
const char **field_names;
const TSFieldMapSlice *field_map_slices;
const TSFieldMapEntry *field_map_entries;
const TSSymbolMetadata *symbol_metadata;
const TSSymbol *public_symbol_map;
const uint16_t *alias_map;
const TSSymbol *alias_sequences;
const TSLexMode *lex_modes;
bool (*lex_fn)(TSLexer *, TSStateId); bool (*lex_fn)(TSLexer *, TSStateId);
bool (*keyword_lex_fn)(TSLexer *, TSStateId); bool (*keyword_lex_fn)(TSLexer *, TSStateId);
TSSymbol keyword_capture_token; TSSymbol keyword_capture_token;
@ -111,14 +123,6 @@ struct TSLanguage {
unsigned (*serialize)(void *, char *); unsigned (*serialize)(void *, char *);
void (*deserialize)(void *, const char *, unsigned); void (*deserialize)(void *, const char *, unsigned);
} external_scanner; } external_scanner;
uint32_t field_count;
const TSFieldMapSlice *field_map_slices;
const TSFieldMapEntry *field_map_entries;
const char **field_names;
uint32_t large_state_count;
const uint16_t *small_parse_table;
const uint32_t *small_parse_table_map;
const TSSymbol *public_symbol_map;
}; };
/* /*
@ -168,65 +172,49 @@ struct TSLanguage {
#define ACTIONS(id) id #define ACTIONS(id) id
#define SHIFT(state_value) \ #define SHIFT(state_value) \
{ \ {{ \
{ \
.params = { \
.shift = { \ .shift = { \
.type = TSParseActionTypeShift, \
.state = state_value \ .state = state_value \
} \ } \
}, \ }}
.type = TSParseActionTypeShift \
} \
}
#define SHIFT_REPEAT(state_value) \ #define SHIFT_REPEAT(state_value) \
{ \ {{ \
{ \
.params = { \
.shift = { \ .shift = { \
.type = TSParseActionTypeShift, \
.state = state_value, \ .state = state_value, \
.repetition = true \ .repetition = true \
} \ } \
}, \ }}
.type = TSParseActionTypeShift \
} \
}
#define RECOVER() \
{ \
{ .type = TSParseActionTypeRecover } \
}
#define SHIFT_EXTRA() \ #define SHIFT_EXTRA() \
{ \ {{ \
{ \
.params = { \
.shift = { \ .shift = { \
.type = TSParseActionTypeShift, \
.extra = true \ .extra = true \
} \ } \
}, \ }}
.type = TSParseActionTypeShift \
} \
}
#define REDUCE(symbol_val, child_count_val, ...) \ #define REDUCE(symbol_val, child_count_val, ...) \
{ \ {{ \
{ \
.params = { \
.reduce = { \ .reduce = { \
.type = TSParseActionTypeReduce, \
.symbol = symbol_val, \ .symbol = symbol_val, \
.child_count = child_count_val, \ .child_count = child_count_val, \
__VA_ARGS__ \ __VA_ARGS__ \
}, \ }, \
}, \ }}
.type = TSParseActionTypeReduce \
} \ #define RECOVER() \
} {{ \
.type = TSParseActionTypeRecover \
}}
#define ACCEPT_INPUT() \ #define ACCEPT_INPUT() \
{ \ {{ \
{ .type = TSParseActionTypeAccept } \ .type = TSParseActionTypeAccept \
} }}
#ifdef __cplusplus #ifdef __cplusplus
} }