This commit is contained in:
Luni-4 2020-11-16 17:10:02 +01:00
Родитель 004f46ac27
Коммит 409db245fe
17 изменённых файлов: 0 добавлений и 451 удалений

3
.gitmodules поставляемый
Просмотреть файл

@ -19,9 +19,6 @@
[submodule "tree-sitter-go"]
path = tree-sitter-go
url = https://github.com/tree-sitter/tree-sitter-go/
[submodule "tree-sitter-css"]
path = tree-sitter-css
url = https://github.com/tree-sitter/tree-sitter-css/
[submodule "tree-sitter-cpp"]
path = tree-sitter-cpp
url = https://github.com/tree-sitter/tree-sitter-cpp.git

Просмотреть файл

@ -10,7 +10,6 @@ mk_langs!(
(Go, tree_sitter_go),
(Html, tree_sitter_html),
(Rust, tree_sitter_rust),
(Css, tree_sitter_css),
(Cpp, tree_sitter_cpp),
(Python, tree_sitter_python),
(Tsx, tree_sitter_tsx),

Просмотреть файл

@ -137,8 +137,6 @@ impl Alterator for GoCode {
}
}
impl Alterator for CssCode {}
impl Alterator for HtmlCode {
fn alterate(node: &Node, code: &[u8], span: bool, children: Vec<AstNode>) -> AstNode {
match Html::from(node.object().kind_id()) {

Просмотреть файл

@ -252,15 +252,6 @@ impl Checker for GoCode {
mk_checker!(is_non_arg,);
}
impl Checker for CssCode {
mk_checker!(is_comment, Comment);
mk_checker!(is_string, StringValue);
mk_checker!(is_call, CallExpression);
mk_checker!(is_func,);
mk_checker!(is_func_space,);
mk_checker!(is_non_arg,);
}
impl Checker for HtmlCode {
mk_checker!(is_comment, Comment);
mk_checker!(is_string,);

Просмотреть файл

@ -472,5 +472,4 @@ impl Getter for PreprocCode {}
impl Getter for CcommentCode {}
impl Getter for JavaCode {}
impl Getter for GoCode {}
impl Getter for CssCode {}
impl Getter for HtmlCode {}

Просмотреть файл

@ -75,16 +75,6 @@ mk_langs!(
[rs],
["rust"]
),
(
Css,
"The `CSS` language",
"css",
CssCode,
CssParser,
tree_sitter_css,
[css],
["css"]
),
(
Cpp,
"The `C/C++` language",

Просмотреть файл

@ -1,413 +0,0 @@
// Code generated; DO NOT EDIT.
#[derive(Clone, Debug, PartialEq)]
pub enum Css {
End = 0,
ATimport = 1,
COMMA = 2,
SEMI = 3,
ATmedia = 4,
ATcharset = 5,
ATnamespace = 6,
ATkeyframes = 7,
AtKeyword = 8,
LBRACE = 9,
RBRACE = 10,
From = 11,
To = 12,
ATsupports = 13,
NestingSelector = 14,
STAR = 15,
DOT = 16,
COLON = 17,
COLONCOLON = 18,
HASH = 19,
LBRACK = 20,
EQ = 21,
TILDEEQ = 22,
CARETEQ = 23,
PIPEEQ = 24,
STAREQ = 25,
DOLLAREQ = 26,
RBRACK = 27,
GT = 28,
TILDE = 29,
PLUS = 30,
LPAREN = 31,
RPAREN = 32,
Important = 33,
LPAREN2 = 34,
And = 35,
Or = 36,
Not = 37,
Only = 38,
Selector2 = 39,
ColorValueToken1 = 40,
StringValue = 41,
IntegerValueToken1 = 42,
FloatValueToken1 = 43,
Unit = 44,
DASH = 45,
SLASH = 46,
Identifier = 47,
AtKeyword2 = 48,
Comment = 49,
PlainValue = 50,
DescendantOperator = 51,
Stylesheet = 52,
ImportStatement = 53,
MediaStatement = 54,
CharsetStatement = 55,
NamespaceStatement = 56,
KeyframesStatement = 57,
KeyframeBlockList = 58,
KeyframeBlock = 59,
SupportsStatement = 60,
AtRule = 61,
RuleSet = 62,
Selectors = 63,
Block = 64,
Selector = 65,
UniversalSelector = 66,
ClassSelector = 67,
PseudoClassSelector = 68,
PseudoElementSelector = 69,
IdSelector = 70,
AttributeSelector = 71,
ChildSelector = 72,
DescendantSelector = 73,
SiblingSelector = 74,
AdjacentSiblingSelector = 75,
Arguments = 76,
Declaration = 77,
Declaration2 = 78,
Query = 79,
FeatureQuery = 80,
ParenthesizedQuery = 81,
BinaryQuery = 82,
UnaryQuery = 83,
SelectorQuery = 84,
Value = 85,
ParenthesizedValue = 86,
ColorValue = 87,
IntegerValue = 88,
FloatValue = 89,
CallExpression = 90,
BinaryExpression = 91,
Arguments2 = 92,
StylesheetRepeat1 = 93,
ImportStatementRepeat1 = 94,
KeyframeBlockListRepeat1 = 95,
SelectorsRepeat1 = 96,
BlockRepeat1 = 97,
PseudoClassArgumentsRepeat1 = 98,
PseudoClassArgumentsRepeat2 = 99,
DeclarationRepeat1 = 100,
ArgumentsRepeat1 = 101,
AttributeName = 102,
ClassName = 103,
FeatureName = 104,
FunctionName = 105,
IdName = 106,
KeyframesName = 107,
KeywordQuery = 108,
NamespaceName = 109,
PropertyName = 110,
TagName = 111,
Error = 112,
}
impl Into<&'static str> for Css {
fn into(self) -> &'static str {
match self {
Css::End => "end",
Css::ATimport => "@import",
Css::COMMA => ",",
Css::SEMI => ";",
Css::ATmedia => "@media",
Css::ATcharset => "@charset",
Css::ATnamespace => "@namespace",
Css::ATkeyframes => "@keyframes",
Css::AtKeyword => "at_keyword",
Css::LBRACE => "{",
Css::RBRACE => "}",
Css::From => "from",
Css::To => "to",
Css::ATsupports => "@supports",
Css::NestingSelector => "nesting_selector",
Css::STAR => "*",
Css::DOT => ".",
Css::COLON => ":",
Css::COLONCOLON => "::",
Css::HASH => "#",
Css::LBRACK => "[",
Css::EQ => "=",
Css::TILDEEQ => "~=",
Css::CARETEQ => "^=",
Css::PIPEEQ => "|=",
Css::STAREQ => "*=",
Css::DOLLAREQ => "$=",
Css::RBRACK => "]",
Css::GT => ">",
Css::TILDE => "~",
Css::PLUS => "+",
Css::LPAREN => "(",
Css::RPAREN => ")",
Css::Important => "important",
Css::LPAREN2 => "(",
Css::And => "and",
Css::Or => "or",
Css::Not => "not",
Css::Only => "only",
Css::Selector2 => "selector",
Css::ColorValueToken1 => "color_value_token1",
Css::StringValue => "string_value",
Css::IntegerValueToken1 => "integer_value_token1",
Css::FloatValueToken1 => "float_value_token1",
Css::Unit => "unit",
Css::DASH => "-",
Css::SLASH => "/",
Css::Identifier => "identifier",
Css::AtKeyword2 => "at_keyword",
Css::Comment => "comment",
Css::PlainValue => "plain_value",
Css::DescendantOperator => "_descendant_operator",
Css::Stylesheet => "stylesheet",
Css::ImportStatement => "import_statement",
Css::MediaStatement => "media_statement",
Css::CharsetStatement => "charset_statement",
Css::NamespaceStatement => "namespace_statement",
Css::KeyframesStatement => "keyframes_statement",
Css::KeyframeBlockList => "keyframe_block_list",
Css::KeyframeBlock => "keyframe_block",
Css::SupportsStatement => "supports_statement",
Css::AtRule => "at_rule",
Css::RuleSet => "rule_set",
Css::Selectors => "selectors",
Css::Block => "block",
Css::Selector => "_selector",
Css::UniversalSelector => "universal_selector",
Css::ClassSelector => "class_selector",
Css::PseudoClassSelector => "pseudo_class_selector",
Css::PseudoElementSelector => "pseudo_element_selector",
Css::IdSelector => "id_selector",
Css::AttributeSelector => "attribute_selector",
Css::ChildSelector => "child_selector",
Css::DescendantSelector => "descendant_selector",
Css::SiblingSelector => "sibling_selector",
Css::AdjacentSiblingSelector => "adjacent_sibling_selector",
Css::Arguments => "arguments",
Css::Declaration => "declaration",
Css::Declaration2 => "declaration",
Css::Query => "_query",
Css::FeatureQuery => "feature_query",
Css::ParenthesizedQuery => "parenthesized_query",
Css::BinaryQuery => "binary_query",
Css::UnaryQuery => "unary_query",
Css::SelectorQuery => "selector_query",
Css::Value => "_value",
Css::ParenthesizedValue => "parenthesized_value",
Css::ColorValue => "color_value",
Css::IntegerValue => "integer_value",
Css::FloatValue => "float_value",
Css::CallExpression => "call_expression",
Css::BinaryExpression => "binary_expression",
Css::Arguments2 => "arguments",
Css::StylesheetRepeat1 => "stylesheet_repeat1",
Css::ImportStatementRepeat1 => "import_statement_repeat1",
Css::KeyframeBlockListRepeat1 => "keyframe_block_list_repeat1",
Css::SelectorsRepeat1 => "selectors_repeat1",
Css::BlockRepeat1 => "block_repeat1",
Css::PseudoClassArgumentsRepeat1 => "pseudo_class_arguments_repeat1",
Css::PseudoClassArgumentsRepeat2 => "pseudo_class_arguments_repeat2",
Css::DeclarationRepeat1 => "declaration_repeat1",
Css::ArgumentsRepeat1 => "arguments_repeat1",
Css::AttributeName => "attribute_name",
Css::ClassName => "class_name",
Css::FeatureName => "feature_name",
Css::FunctionName => "function_name",
Css::IdName => "id_name",
Css::KeyframesName => "keyframes_name",
Css::KeywordQuery => "keyword_query",
Css::NamespaceName => "namespace_name",
Css::PropertyName => "property_name",
Css::TagName => "tag_name",
Css::Error => "ERROR",
}
}
}
#[allow(clippy::unreadable_literal)]
static KEYS: phf::Map<&'static str, Css> = ::phf::Map {
key: 3213172566270843353,
disps: ::phf::Slice::Static(&[
(3, 86),
(0, 7),
(0, 8),
(0, 88),
(1, 39),
(7, 92),
(3, 65),
(0, 3),
(0, 73),
(0, 8),
(1, 56),
(0, 29),
(2, 5),
(1, 100),
(0, 0),
(1, 0),
(0, 1),
(30, 37),
(90, 62),
(3, 83),
(0, 21),
(27, 73),
]),
entries: ::phf::Slice::Static(&[
("*=", Css::STAREQ),
("float_value", Css::FloatValue),
("namespace_name", Css::NamespaceName),
(
"pseudo_class_arguments_repeat1",
Css::PseudoClassArgumentsRepeat1,
),
("unit", Css::Unit),
("sibling_selector", Css::SiblingSelector),
("_value", Css::Value),
("|=", Css::PIPEEQ),
("feature_query", Css::FeatureQuery),
("string_value", Css::StringValue),
("important", Css::Important),
("stylesheet_repeat1", Css::StylesheetRepeat1),
("color_value", Css::ColorValue),
("comment", Css::Comment),
("@namespace", Css::ATnamespace),
("*", Css::STAR),
("_selector", Css::Selector),
("@charset", Css::ATcharset),
("to", Css::To),
("selector_query", Css::SelectorQuery),
("@media", Css::ATmedia),
("integer_value", Css::IntegerValue),
("$=", Css::DOLLAREQ),
("call_expression", Css::CallExpression),
("import_statement", Css::ImportStatement),
("-", Css::DASH),
("selectors", Css::Selectors),
("(", Css::LPAREN),
("@import", Css::ATimport),
("nesting_selector", Css::NestingSelector),
("pseudo_element_selector", Css::PseudoElementSelector),
("id_name", Css::IdName),
("not", Css::Not),
("keyframe_block_list_repeat1", Css::KeyframeBlockListRepeat1),
("import_statement_repeat1", Css::ImportStatementRepeat1),
("at_rule", Css::AtRule),
("_descendant_operator", Css::DescendantOperator),
("arguments", Css::Arguments),
("id_selector", Css::IdSelector),
(
"pseudo_class_arguments_repeat2",
Css::PseudoClassArgumentsRepeat2,
),
("attribute_selector", Css::AttributeSelector),
("and", Css::And),
("supports_statement", Css::SupportsStatement),
("identifier", Css::Identifier),
("media_statement", Css::MediaStatement),
("/", Css::SLASH),
("only", Css::Only),
("binary_query", Css::BinaryQuery),
(";", Css::SEMI),
("{", Css::LBRACE),
("feature_name", Css::FeatureName),
("class_name", Css::ClassName),
("integer_value_token1", Css::IntegerValueToken1),
("declaration_repeat1", Css::DeclarationRepeat1),
("parenthesized_query", Css::ParenthesizedQuery),
("::", Css::COLONCOLON),
(".", Css::DOT),
("^=", Css::CARETEQ),
("pseudo_class_selector", Css::PseudoClassSelector),
("block_repeat1", Css::BlockRepeat1),
("_query", Css::Query),
("property_name", Css::PropertyName),
("unary_query", Css::UnaryQuery),
("keyword_query", Css::KeywordQuery),
(")", Css::RPAREN),
("charset_statement", Css::CharsetStatement),
("tag_name", Css::TagName),
("end", Css::End),
("~=", Css::TILDEEQ),
("keyframe_block_list", Css::KeyframeBlockList),
(":", Css::COLON),
("selectors_repeat1", Css::SelectorsRepeat1),
("keyframe_block", Css::KeyframeBlock),
("#", Css::HASH),
("float_value_token1", Css::FloatValueToken1),
("keyframes_statement", Css::KeyframesStatement),
("@keyframes", Css::ATkeyframes),
("block", Css::Block),
("attribute_name", Css::AttributeName),
("binary_expression", Css::BinaryExpression),
("stylesheet", Css::Stylesheet),
("namespace_statement", Css::NamespaceStatement),
("universal_selector", Css::UniversalSelector),
(">", Css::GT),
("[", Css::LBRACK),
("~", Css::TILDE),
(",", Css::COMMA),
("adjacent_sibling_selector", Css::AdjacentSiblingSelector),
("rule_set", Css::RuleSet),
("}", Css::RBRACE),
("declaration", Css::Declaration),
("function_name", Css::FunctionName),
("@supports", Css::ATsupports),
("from", Css::From),
("=", Css::EQ),
("keyframes_name", Css::KeyframesName),
("plain_value", Css::PlainValue),
("descendant_selector", Css::DescendantSelector),
("parenthesized_value", Css::ParenthesizedValue),
("+", Css::PLUS),
("child_selector", Css::ChildSelector),
("arguments_repeat1", Css::ArgumentsRepeat1),
("color_value_token1", Css::ColorValueToken1),
("or", Css::Or),
("class_selector", Css::ClassSelector),
("]", Css::RBRACK),
("at_keyword", Css::AtKeyword),
("ERROR", Css::Error),
]),
};
impl From<&str> for Css {
#[inline(always)]
fn from(key: &str) -> Self {
KEYS.get(key).unwrap().clone()
}
}
impl From<u16> for Css {
#[inline(always)]
fn from(x: u16) -> Self {
unsafe { std::mem::transmute(x as u8) }
}
}
// Css == u16
impl PartialEq<u16> for Css {
#[inline(always)]
fn eq(&self, x: &u16) -> bool {
*self == Css::from(*x)
}
}
// u16 == Css
impl PartialEq<Css> for u16 {
#[inline(always)]
fn eq(&self, x: &Css) -> bool {
*x == *self
}
}

Просмотреть файл

@ -4,9 +4,6 @@ pub use language_ccomment::*;
pub mod language_cpp;
pub use language_cpp::*;
pub mod language_css;
pub use language_css::*;
pub mod language_go;
pub use language_go::*;

Просмотреть файл

@ -405,7 +405,6 @@ impl Cognitive for PreprocCode {}
impl Cognitive for CcommentCode {}
impl Cognitive for JavaCode {}
impl Cognitive for GoCode {}
impl Cognitive for CssCode {}
impl Cognitive for HtmlCode {}
#[cfg(test)]

Просмотреть файл

@ -173,7 +173,6 @@ impl Cyclomatic for PreprocCode {}
impl Cyclomatic for CcommentCode {}
impl Cyclomatic for JavaCode {}
impl Cyclomatic for GoCode {}
impl Cyclomatic for CssCode {}
impl Cyclomatic for HtmlCode {}
#[cfg(test)]

Просмотреть файл

@ -137,7 +137,6 @@ impl Exit for PreprocCode {}
impl Exit for CcommentCode {}
impl Exit for JavaCode {}
impl Exit for GoCode {}
impl Exit for CssCode {}
impl Exit for HtmlCode {}
#[cfg(test)]

Просмотреть файл

@ -121,7 +121,6 @@ impl NArgs for PreprocCode {}
impl NArgs for CcommentCode {}
impl NArgs for JavaCode {}
impl NArgs for GoCode {}
impl NArgs for CssCode {}
impl NArgs for HtmlCode {}
#[cfg(test)]

Просмотреть файл

@ -329,7 +329,6 @@ impl Halstead for PreprocCode {}
impl Halstead for CcommentCode {}
impl Halstead for JavaCode {}
impl Halstead for GoCode {}
impl Halstead for CssCode {}
impl Halstead for HtmlCode {}
#[cfg(test)]

Просмотреть файл

@ -365,7 +365,6 @@ impl Loc for PreprocCode {}
impl Loc for CcommentCode {}
impl Loc for JavaCode {}
impl Loc for GoCode {}
impl Loc for CssCode {}
impl Loc for HtmlCode {}
#[cfg(test)]

Просмотреть файл

@ -113,7 +113,6 @@ impl Mi for PreprocCode {}
impl Mi for CcommentCode {}
impl Mi for JavaCode {}
impl Mi for GoCode {}
impl Mi for CssCode {}
impl Mi for HtmlCode {}
#[cfg(test)]

Просмотреть файл

@ -196,7 +196,6 @@ impl Nom for PreprocCode {}
impl Nom for CcommentCode {}
impl Nom for JavaCode {}
impl Nom for GoCode {}
impl Nom for CssCode {}
impl Nom for HtmlCode {}
#[cfg(test)]

@ -1 +0,0 @@
Subproject commit 23f2cb97d47860c517f67f03e1f4b621d5bd2085