From 7acc3f1b49fab0565c49cffd98c98bcffa57ee9c Mon Sep 17 00:00:00 2001 From: Luni-4 Date: Mon, 16 Nov 2020 18:12:51 +0100 Subject: [PATCH] Remove go language --- .gitmodules | 3 - enums/src/languages.rs | 1 - src/alterator.rs | 12 - src/checker.rs | 15 - src/getter.rs | 1 - src/langs.rs | 10 - src/languages/language_go.rs | 708 ----------------------------------- src/languages/mod.rs | 3 - src/metrics/cognitive.rs | 1 - src/metrics/cyclomatic.rs | 1 - src/metrics/exit.rs | 1 - src/metrics/fn_args.rs | 1 - src/metrics/halstead.rs | 1 - src/metrics/loc.rs | 1 - src/metrics/mi.rs | 1 - src/metrics/nom.rs | 1 - tree-sitter-go | 1 - 17 files changed, 762 deletions(-) delete mode 100644 src/languages/language_go.rs delete mode 160000 tree-sitter-go diff --git a/.gitmodules b/.gitmodules index 72f12aa9b..a9baed2fd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,9 +13,6 @@ [submodule "tree-sitter-java"] path = tree-sitter-java url = https://github.com/tree-sitter/tree-sitter-java/ -[submodule "tree-sitter-go"] - path = tree-sitter-go - url = https://github.com/tree-sitter/tree-sitter-go/ [submodule "tree-sitter-cpp"] path = tree-sitter-cpp url = https://github.com/tree-sitter/tree-sitter-cpp.git diff --git a/enums/src/languages.rs b/enums/src/languages.rs index c81a65a17..73ed6e343 100644 --- a/enums/src/languages.rs +++ b/enums/src/languages.rs @@ -7,7 +7,6 @@ mk_langs!( // 1) Name for enum // 2) tree-sitter function to call to get a Language (Java, tree_sitter_java), - (Go, tree_sitter_go), (Rust, tree_sitter_rust), (Cpp, tree_sitter_cpp), (Python, tree_sitter_python), diff --git a/src/alterator.rs b/src/alterator.rs index ce6153548..d0101a5df 100644 --- a/src/alterator.rs +++ b/src/alterator.rs @@ -125,18 +125,6 @@ impl Alterator for TsxCode { } } -impl Alterator for GoCode { - fn alterate(node: &Node, code: &[u8], span: bool, children: Vec) -> AstNode { - match Go::from(node.object().kind_id()) { - Go::InterpretedStringLiteral => { - let (text, span) = Self::get_text_span(node, code, span, true); - AstNode::new(node.object().kind(), text, span, Vec::new()) - } - _ => Self::get_default(node, code, span, children), - } - } -} - impl Alterator for RustCode { fn alterate(node: &Node, code: &[u8], span: bool, children: Vec) -> AstNode { match Rust::from(node.object().kind_id()) { diff --git a/src/checker.rs b/src/checker.rs index d8750a2b0..06a182b38 100644 --- a/src/checker.rs +++ b/src/checker.rs @@ -237,21 +237,6 @@ impl Checker for TsxCode { mk_checker!(is_non_arg, LPAREN, COMMA, RPAREN); } -impl Checker for GoCode { - mk_checker!(is_comment, Comment); - mk_checker!(is_string, RawStringLiteral, InterpretedStringLiteral); - mk_checker!(is_call, CallExpression); - mk_checker!(is_func, FunctionDeclaration, MethodDeclaration, FuncLiteral); - mk_checker!( - is_func_space, - SourceFile, - FunctionDeclaration, - MethodDeclaration, - FuncLiteral - ); - mk_checker!(is_non_arg,); -} - impl Checker for RustCode { mk_checker!(is_comment, LineComment, BlockComment); diff --git a/src/getter.rs b/src/getter.rs index c7d9c8c1e..5544d6a3f 100644 --- a/src/getter.rs +++ b/src/getter.rs @@ -471,4 +471,3 @@ impl Getter for CppCode { impl Getter for PreprocCode {} impl Getter for CcommentCode {} impl Getter for JavaCode {} -impl Getter for GoCode {} diff --git a/src/langs.rs b/src/langs.rs index 5fa9b947a..6fa453f54 100644 --- a/src/langs.rs +++ b/src/langs.rs @@ -45,16 +45,6 @@ mk_langs!( [java], ["java"] ), - ( - Go, - "The `Go` language", - "go", - GoCode, - GoParser, - tree_sitter_go, - [go], - ["go"] - ), ( Rust, "The `Rust` language", diff --git a/src/languages/language_go.rs b/src/languages/language_go.rs deleted file mode 100644 index 9814dec5c..000000000 --- a/src/languages/language_go.rs +++ /dev/null @@ -1,708 +0,0 @@ -// Code generated; DO NOT EDIT. - -#[derive(Clone, Debug, PartialEq)] -pub enum Go { - End = 0, - Identifier = 1, - LF = 2, - SEMI = 3, - Package = 4, - Import = 5, - DOT = 6, - BlankIdentifier = 7, - LPAREN = 8, - RPAREN = 9, - Const = 10, - COMMA = 11, - EQ = 12, - Var = 13, - Func = 14, - DOTDOTDOT = 15, - Type = 16, - STAR = 17, - LBRACK = 18, - RBRACK = 19, - Struct = 20, - LBRACE = 21, - RBRACE = 22, - Interface = 23, - Map = 24, - Chan = 25, - LTDASH = 26, - COLONEQ = 27, - PLUSPLUS = 28, - DASHDASH = 29, - STAREQ = 30, - SLASHEQ = 31, - PERCENTEQ = 32, - LTLTEQ = 33, - GTGTEQ = 34, - AMPEQ = 35, - AMPCARETEQ = 36, - PLUSEQ = 37, - DASHEQ = 38, - PIPEEQ = 39, - CARETEQ = 40, - COLON = 41, - Fallthrough = 42, - Break = 43, - Continue = 44, - Goto = 45, - Return = 46, - Go = 47, - Defer = 48, - If = 49, - Else = 50, - For = 51, - Range = 52, - Switch = 53, - Case = 54, - Default = 55, - Select = 56, - Identifier2 = 57, - Identifier3 = 58, - PLUS = 59, - DASH = 60, - BANG = 61, - CARET = 62, - AMP = 63, - SLASH = 64, - PERCENT = 65, - LTLT = 66, - GTGT = 67, - AMPCARET = 68, - PIPE = 69, - EQEQ = 70, - BANGEQ = 71, - LT = 72, - LTEQ = 73, - GT = 74, - GTEQ = 75, - AMPAMP = 76, - PIPEPIPE = 77, - RawStringLiteral = 78, - DQUOTE = 79, - InterpretedStringLiteralToken1 = 80, - EscapeSequence = 81, - IntLiteral = 82, - FloatLiteral = 83, - ImaginaryLiteral = 84, - RuneLiteral = 85, - Nil = 86, - True = 87, - False = 88, - Comment = 89, - SourceFile = 90, - PackageClause = 91, - ImportDeclaration = 92, - ImportSpec = 93, - Dot = 94, - ImportSpecList = 95, - Declaration = 96, - ConstDeclaration = 97, - ConstSpec = 98, - VarDeclaration = 99, - VarSpec = 100, - FunctionDeclaration = 101, - MethodDeclaration = 102, - ParameterList = 103, - ParameterDeclaration = 104, - VariadicParameterDeclaration = 105, - TypeAlias = 106, - TypeDeclaration = 107, - TypeSpec = 108, - ExpressionList = 109, - ParenthesizedType = 110, - SimpleType = 111, - PointerType = 112, - ArrayType = 113, - ImplicitLengthArrayType = 114, - SliceType = 115, - StructType = 116, - FieldDeclarationList = 117, - FieldDeclaration = 118, - InterfaceType = 119, - MethodSpecList = 120, - MethodSpec = 121, - MapType = 122, - ChannelType = 123, - FunctionType = 124, - Block = 125, - StatementList = 126, - Statement = 127, - EmptyStatement = 128, - SimpleStatement = 129, - SendStatement = 130, - ReceiveStatement = 131, - IncStatement = 132, - DecStatement = 133, - AssignmentStatement = 134, - ShortVarDeclaration = 135, - LabeledStatement = 136, - LabeledStatement2 = 137, - FallthroughStatement = 138, - BreakStatement = 139, - ContinueStatement = 140, - GotoStatement = 141, - ReturnStatement = 142, - GoStatement = 143, - DeferStatement = 144, - IfStatement = 145, - ForStatement = 146, - ForClause = 147, - RangeClause = 148, - ExpressionSwitchStatement = 149, - ExpressionCase = 150, - DefaultCase = 151, - TypeSwitchStatement = 152, - TypeSwitchHeader = 153, - TypeCase = 154, - SelectStatement = 155, - CommunicationCase = 156, - Expression = 157, - ParenthesizedExpression = 158, - CallExpression = 159, - VariadicArgument = 160, - ArgumentList = 161, - ArgumentList2 = 162, - SelectorExpression = 163, - IndexExpression = 164, - SliceExpression = 165, - TypeAssertionExpression = 166, - TypeConversionExpression = 167, - CompositeLiteral = 168, - LiteralValue = 169, - KeyedElement = 170, - Element = 171, - FuncLiteral = 172, - UnaryExpression = 173, - BinaryExpression = 174, - QualifiedType = 175, - InterpretedStringLiteral = 176, - SourceFileRepeat1 = 177, - ImportSpecListRepeat1 = 178, - ConstDeclarationRepeat1 = 179, - ConstSpecRepeat1 = 180, - VarDeclarationRepeat1 = 181, - ParameterListRepeat1 = 182, - TypeDeclarationRepeat1 = 183, - FieldNameListRepeat1 = 184, - ExpressionListRepeat1 = 185, - FieldDeclarationListRepeat1 = 186, - MethodSpecListRepeat1 = 187, - StatementListRepeat1 = 188, - ExpressionSwitchStatementRepeat1 = 189, - TypeSwitchStatementRepeat1 = 190, - TypeCaseRepeat1 = 191, - SelectStatementRepeat1 = 192, - ArgumentListRepeat1 = 193, - LiteralValueRepeat1 = 194, - InterpretedStringLiteralRepeat1 = 195, - FieldIdentifier = 196, - LabelName = 197, - PackageIdentifier = 198, - TypeIdentifier = 199, - Error = 200, -} - -impl Into<&'static str> for Go { - fn into(self) -> &'static str { - match self { - Go::End => "end", - Go::Identifier => "identifier", - Go::LF => "\n", - Go::SEMI => ";", - Go::Package => "package", - Go::Import => "import", - Go::DOT => ".", - Go::BlankIdentifier => "blank_identifier", - Go::LPAREN => "(", - Go::RPAREN => ")", - Go::Const => "const", - Go::COMMA => ",", - Go::EQ => "=", - Go::Var => "var", - Go::Func => "func", - Go::DOTDOTDOT => "...", - Go::Type => "type", - Go::STAR => "*", - Go::LBRACK => "[", - Go::RBRACK => "]", - Go::Struct => "struct", - Go::LBRACE => "{", - Go::RBRACE => "}", - Go::Interface => "interface", - Go::Map => "map", - Go::Chan => "chan", - Go::LTDASH => "<-", - Go::COLONEQ => ":=", - Go::PLUSPLUS => "++", - Go::DASHDASH => "--", - Go::STAREQ => "*=", - Go::SLASHEQ => "/=", - Go::PERCENTEQ => "%=", - Go::LTLTEQ => "<<=", - Go::GTGTEQ => ">>=", - Go::AMPEQ => "&=", - Go::AMPCARETEQ => "&^=", - Go::PLUSEQ => "+=", - Go::DASHEQ => "-=", - Go::PIPEEQ => "|=", - Go::CARETEQ => "^=", - Go::COLON => ":", - Go::Fallthrough => "fallthrough", - Go::Break => "break", - Go::Continue => "continue", - Go::Goto => "goto", - Go::Return => "return", - Go::Go => "go", - Go::Defer => "defer", - Go::If => "if", - Go::Else => "else", - Go::For => "for", - Go::Range => "range", - Go::Switch => "switch", - Go::Case => "case", - Go::Default => "default", - Go::Select => "select", - Go::Identifier2 => "identifier", - Go::Identifier3 => "identifier", - Go::PLUS => "+", - Go::DASH => "-", - Go::BANG => "!", - Go::CARET => "^", - Go::AMP => "&", - Go::SLASH => "/", - Go::PERCENT => "%", - Go::LTLT => "<<", - Go::GTGT => ">>", - Go::AMPCARET => "&^", - Go::PIPE => "|", - Go::EQEQ => "==", - Go::BANGEQ => "!=", - Go::LT => "<", - Go::LTEQ => "<=", - Go::GT => ">", - Go::GTEQ => ">=", - Go::AMPAMP => "&&", - Go::PIPEPIPE => "||", - Go::RawStringLiteral => "raw_string_literal", - Go::DQUOTE => "\"", - Go::InterpretedStringLiteralToken1 => "interpreted_string_literal_token1", - Go::EscapeSequence => "escape_sequence", - Go::IntLiteral => "int_literal", - Go::FloatLiteral => "float_literal", - Go::ImaginaryLiteral => "imaginary_literal", - Go::RuneLiteral => "rune_literal", - Go::Nil => "nil", - Go::True => "true", - Go::False => "false", - Go::Comment => "comment", - Go::SourceFile => "source_file", - Go::PackageClause => "package_clause", - Go::ImportDeclaration => "import_declaration", - Go::ImportSpec => "import_spec", - Go::Dot => "dot", - Go::ImportSpecList => "import_spec_list", - Go::Declaration => "_declaration", - Go::ConstDeclaration => "const_declaration", - Go::ConstSpec => "const_spec", - Go::VarDeclaration => "var_declaration", - Go::VarSpec => "var_spec", - Go::FunctionDeclaration => "function_declaration", - Go::MethodDeclaration => "method_declaration", - Go::ParameterList => "parameter_list", - Go::ParameterDeclaration => "parameter_declaration", - Go::VariadicParameterDeclaration => "variadic_parameter_declaration", - Go::TypeAlias => "type_alias", - Go::TypeDeclaration => "type_declaration", - Go::TypeSpec => "type_spec", - Go::ExpressionList => "expression_list", - Go::ParenthesizedType => "parenthesized_type", - Go::SimpleType => "_simple_type", - Go::PointerType => "pointer_type", - Go::ArrayType => "array_type", - Go::ImplicitLengthArrayType => "implicit_length_array_type", - Go::SliceType => "slice_type", - Go::StructType => "struct_type", - Go::FieldDeclarationList => "field_declaration_list", - Go::FieldDeclaration => "field_declaration", - Go::InterfaceType => "interface_type", - Go::MethodSpecList => "method_spec_list", - Go::MethodSpec => "method_spec", - Go::MapType => "map_type", - Go::ChannelType => "channel_type", - Go::FunctionType => "function_type", - Go::Block => "block", - Go::StatementList => "_statement_list", - Go::Statement => "_statement", - Go::EmptyStatement => "empty_statement", - Go::SimpleStatement => "_simple_statement", - Go::SendStatement => "send_statement", - Go::ReceiveStatement => "receive_statement", - Go::IncStatement => "inc_statement", - Go::DecStatement => "dec_statement", - Go::AssignmentStatement => "assignment_statement", - Go::ShortVarDeclaration => "short_var_declaration", - Go::LabeledStatement => "labeled_statement", - Go::LabeledStatement2 => "labeled_statement", - Go::FallthroughStatement => "fallthrough_statement", - Go::BreakStatement => "break_statement", - Go::ContinueStatement => "continue_statement", - Go::GotoStatement => "goto_statement", - Go::ReturnStatement => "return_statement", - Go::GoStatement => "go_statement", - Go::DeferStatement => "defer_statement", - Go::IfStatement => "if_statement", - Go::ForStatement => "for_statement", - Go::ForClause => "for_clause", - Go::RangeClause => "range_clause", - Go::ExpressionSwitchStatement => "expression_switch_statement", - Go::ExpressionCase => "expression_case", - Go::DefaultCase => "default_case", - Go::TypeSwitchStatement => "type_switch_statement", - Go::TypeSwitchHeader => "_type_switch_header", - Go::TypeCase => "type_case", - Go::SelectStatement => "select_statement", - Go::CommunicationCase => "communication_case", - Go::Expression => "_expression", - Go::ParenthesizedExpression => "parenthesized_expression", - Go::CallExpression => "call_expression", - Go::VariadicArgument => "variadic_argument", - Go::ArgumentList => "argument_list", - Go::ArgumentList2 => "argument_list", - Go::SelectorExpression => "selector_expression", - Go::IndexExpression => "index_expression", - Go::SliceExpression => "slice_expression", - Go::TypeAssertionExpression => "type_assertion_expression", - Go::TypeConversionExpression => "type_conversion_expression", - Go::CompositeLiteral => "composite_literal", - Go::LiteralValue => "literal_value", - Go::KeyedElement => "keyed_element", - Go::Element => "element", - Go::FuncLiteral => "func_literal", - Go::UnaryExpression => "unary_expression", - Go::BinaryExpression => "binary_expression", - Go::QualifiedType => "qualified_type", - Go::InterpretedStringLiteral => "interpreted_string_literal", - Go::SourceFileRepeat1 => "source_file_repeat1", - Go::ImportSpecListRepeat1 => "import_spec_list_repeat1", - Go::ConstDeclarationRepeat1 => "const_declaration_repeat1", - Go::ConstSpecRepeat1 => "const_spec_repeat1", - Go::VarDeclarationRepeat1 => "var_declaration_repeat1", - Go::ParameterListRepeat1 => "parameter_list_repeat1", - Go::TypeDeclarationRepeat1 => "type_declaration_repeat1", - Go::FieldNameListRepeat1 => "field_name_list_repeat1", - Go::ExpressionListRepeat1 => "expression_list_repeat1", - Go::FieldDeclarationListRepeat1 => "field_declaration_list_repeat1", - Go::MethodSpecListRepeat1 => "method_spec_list_repeat1", - Go::StatementListRepeat1 => "_statement_list_repeat1", - Go::ExpressionSwitchStatementRepeat1 => "expression_switch_statement_repeat1", - Go::TypeSwitchStatementRepeat1 => "type_switch_statement_repeat1", - Go::TypeCaseRepeat1 => "type_case_repeat1", - Go::SelectStatementRepeat1 => "select_statement_repeat1", - Go::ArgumentListRepeat1 => "argument_list_repeat1", - Go::LiteralValueRepeat1 => "literal_value_repeat1", - Go::InterpretedStringLiteralRepeat1 => "interpreted_string_literal_repeat1", - Go::FieldIdentifier => "field_identifier", - Go::LabelName => "label_name", - Go::PackageIdentifier => "package_identifier", - Go::TypeIdentifier => "type_identifier", - Go::Error => "ERROR", - } - } -} - -#[allow(clippy::unreadable_literal)] -static KEYS: phf::Map<&'static str, Go> = ::phf::Map { - key: 3347381344252206323, - disps: ::phf::Slice::Static(&[ - (0, 121), - (0, 59), - (0, 0), - (0, 27), - (2, 30), - (0, 1), - (0, 126), - (1, 1), - (0, 26), - (0, 1), - (15, 187), - (0, 186), - (0, 180), - (0, 14), - (0, 112), - (0, 13), - (1, 41), - (0, 0), - (4, 156), - (0, 7), - (0, 35), - (13, 32), - (0, 2), - (0, 68), - (9, 150), - (4, 43), - (0, 17), - (23, 54), - (0, 129), - (1, 108), - (2, 120), - (0, 36), - (20, 115), - (0, 97), - (3, 14), - (0, 8), - (3, 33), - (0, 2), - (5, 1), - (2, 110), - ]), - entries: ::phf::Slice::Static(&[ - ("_declaration", Go::Declaration), - ("false", Go::False), - ("<<", Go::LTLT), - ("type_spec", Go::TypeSpec), - (":=", Go::COLONEQ), - (">>", Go::GTGT), - ("composite_literal", Go::CompositeLiteral), - ("break_statement", Go::BreakStatement), - ("default", Go::Default), - ("type_switch_statement", Go::TypeSwitchStatement), - ("for_clause", Go::ForClause), - ("struct", Go::Struct), - ("int_literal", Go::IntLiteral), - ("map_type", Go::MapType), - ("switch", Go::Switch), - ("parenthesized_expression", Go::ParenthesizedExpression), - ("labeled_statement", Go::LabeledStatement), - ("argument_list", Go::ArgumentList), - ("_expression", Go::Expression), - ("import_declaration", Go::ImportDeclaration), - ("method_spec", Go::MethodSpec), - ("type_conversion_expression", Go::TypeConversionExpression), - ("raw_string_literal", Go::RawStringLiteral), - ( - "type_switch_statement_repeat1", - Go::TypeSwitchStatementRepeat1, - ), - ("escape_sequence", Go::EscapeSequence), - ("type_alias", Go::TypeAlias), - ("variadic_argument", Go::VariadicArgument), - ("+=", Go::PLUSEQ), - ("select", Go::Select), - ("%=", Go::PERCENTEQ), - ("literal_value", Go::LiteralValue), - ("assignment_statement", Go::AssignmentStatement), - ("blank_identifier", Go::BlankIdentifier), - ("type_declaration_repeat1", Go::TypeDeclarationRepeat1), - ("<<=", Go::LTLTEQ), - ("import_spec_list", Go::ImportSpecList), - ("type", Go::Type), - ("%", Go::PERCENT), - ("--", Go::DASHDASH), - ("/=", Go::SLASHEQ), - ("&=", Go::AMPEQ), - ("*=", Go::STAREQ), - ("type_case_repeat1", Go::TypeCaseRepeat1), - ("dec_statement", Go::DecStatement), - ("import_spec_list_repeat1", Go::ImportSpecListRepeat1), - ("_simple_statement", Go::SimpleStatement), - ("float_literal", Go::FloatLiteral), - ("chan", Go::Chan), - ("source_file_repeat1", Go::SourceFileRepeat1), - ("argument_list_repeat1", Go::ArgumentListRepeat1), - ("&", Go::AMP), - ("type_assertion_expression", Go::TypeAssertionExpression), - (":", Go::COLON), - ("if_statement", Go::IfStatement), - ("literal_value_repeat1", Go::LiteralValueRepeat1), - ("func_literal", Go::FuncLiteral), - ("^", Go::CARET), - ("]", Go::RBRACK), - ("fallthrough_statement", Go::FallthroughStatement), - ("type_declaration", Go::TypeDeclaration), - ("|", Go::PIPE), - ("interface", Go::Interface), - ( - "expression_switch_statement_repeat1", - Go::ExpressionSwitchStatementRepeat1, - ), - ("struct_type", Go::StructType), - ("var_spec", Go::VarSpec), - ("select_statement_repeat1", Go::SelectStatementRepeat1), - ("method_declaration", Go::MethodDeclaration), - ( - "variadic_parameter_declaration", - Go::VariadicParameterDeclaration, - ), - ("-=", Go::DASHEQ), - ("!=", Go::BANGEQ), - ("default_case", Go::DefaultCase), - ("package_identifier", Go::PackageIdentifier), - ("continue_statement", Go::ContinueStatement), - ("expression_list", Go::ExpressionList), - ("type_identifier", Go::TypeIdentifier), - ("inc_statement", Go::IncStatement), - ("var_declaration_repeat1", Go::VarDeclarationRepeat1), - ("++", Go::PLUSPLUS), - ("const_spec", Go::ConstSpec), - ("field_declaration", Go::FieldDeclaration), - ("label_name", Go::LabelName), - ("fallthrough", Go::Fallthrough), - ("communication_case", Go::CommunicationCase), - ("goto", Go::Goto), - ("return_statement", Go::ReturnStatement), - ("func", Go::Func), - ("_statement_list_repeat1", Go::StatementListRepeat1), - ("keyed_element", Go::KeyedElement), - ("|=", Go::PIPEEQ), - ("[", Go::LBRACK), - ("import", Go::Import), - ("&^", Go::AMPCARET), - ("else", Go::Else), - ("_type_switch_header", Go::TypeSwitchHeader), - ("-", Go::DASH), - ("send_statement", Go::SendStatement), - ("interface_type", Go::InterfaceType), - ("short_var_declaration", Go::ShortVarDeclaration), - ("package", Go::Package), - ("_statement_list", Go::StatementList), - ("range_clause", Go::RangeClause), - (")", Go::RPAREN), - ("function_type", Go::FunctionType), - ("import_spec", Go::ImportSpec), - ("dot", Go::Dot), - ("const_spec_repeat1", Go::ConstSpecRepeat1), - ("expression_switch_statement", Go::ExpressionSwitchStatement), - (".", Go::DOT), - ("\\n", Go::LF), - ("go", Go::Go), - ("range", Go::Range), - ("_simple_type", Go::SimpleType), - ("channel_type", Go::ChannelType), - ("break", Go::Break), - ("identifier", Go::Identifier), - ("return", Go::Return), - ("\\\"", Go::DQUOTE), - ("pointer_type", Go::PointerType), - ("unary_expression", Go::UnaryExpression), - ("const", Go::Const), - ("field_declaration_list", Go::FieldDeclarationList), - ("receive_statement", Go::ReceiveStatement), - ("parameter_declaration", Go::ParameterDeclaration), - ("nil", Go::Nil), - ("ERROR", Go::Error), - ("call_expression", Go::CallExpression), - ("for", Go::For), - ("+", Go::PLUS), - ("block", Go::Block), - ("index_expression", Go::IndexExpression), - ("function_declaration", Go::FunctionDeclaration), - ("selector_expression", Go::SelectorExpression), - ("&^=", Go::AMPCARETEQ), - ("slice_type", Go::SliceType), - ("comment", Go::Comment), - ("binary_expression", Go::BinaryExpression), - ("expression_case", Go::ExpressionCase), - ("go_statement", Go::GoStatement), - ("&&", Go::AMPAMP), - ("!", Go::BANG), - ("empty_statement", Go::EmptyStatement), - ("select_statement", Go::SelectStatement), - ("field_identifier", Go::FieldIdentifier), - ("goto_statement", Go::GotoStatement), - ("imaginary_literal", Go::ImaginaryLiteral), - ("element", Go::Element), - ("var", Go::Var), - ("parameter_list_repeat1", Go::ParameterListRepeat1), - ("method_spec_list_repeat1", Go::MethodSpecListRepeat1), - ("package_clause", Go::PackageClause), - (">", Go::GT), - ("}", Go::RBRACE), - ( - "field_declaration_list_repeat1", - Go::FieldDeclarationListRepeat1, - ), - ("{", Go::LBRACE), - (">=", Go::GTEQ), - ("map", Go::Map), - ("true", Go::True), - ("parenthesized_type", Go::ParenthesizedType), - ("...", Go::DOTDOTDOT), - (";", Go::SEMI), - ("implicit_length_array_type", Go::ImplicitLengthArrayType), - ("rune_literal", Go::RuneLiteral), - ("const_declaration", Go::ConstDeclaration), - ("==", Go::EQEQ), - ("defer_statement", Go::DeferStatement), - ("_statement", Go::Statement), - ("/", Go::SLASH), - ("for_statement", Go::ForStatement), - ("const_declaration_repeat1", Go::ConstDeclarationRepeat1), - ("defer", Go::Defer), - ("array_type", Go::ArrayType), - ("type_case", Go::TypeCase), - (",", Go::COMMA), - ("<", Go::LT), - ("||", Go::PIPEPIPE), - ( - "interpreted_string_literal_token1", - Go::InterpretedStringLiteralToken1, - ), - ("*", Go::STAR), - ("(", Go::LPAREN), - ("case", Go::Case), - ("var_declaration", Go::VarDeclaration), - ("interpreted_string_literal", Go::InterpretedStringLiteral), - ("expression_list_repeat1", Go::ExpressionListRepeat1), - (">>=", Go::GTGTEQ), - ("<-", Go::LTDASH), - ("end", Go::End), - ("parameter_list", Go::ParameterList), - ("if", Go::If), - ("source_file", Go::SourceFile), - ("slice_expression", Go::SliceExpression), - ("method_spec_list", Go::MethodSpecList), - ("qualified_type", Go::QualifiedType), - ( - "interpreted_string_literal_repeat1", - Go::InterpretedStringLiteralRepeat1, - ), - ("=", Go::EQ), - ("<=", Go::LTEQ), - ("^=", Go::CARETEQ), - ("continue", Go::Continue), - ("field_name_list_repeat1", Go::FieldNameListRepeat1), - ]), -}; - -impl From<&str> for Go { - #[inline(always)] - fn from(key: &str) -> Self { - KEYS.get(key).unwrap().clone() - } -} - -impl From for Go { - #[inline(always)] - fn from(x: u16) -> Self { - unsafe { std::mem::transmute(x as u8) } - } -} - -// Go == u16 -impl PartialEq for Go { - #[inline(always)] - fn eq(&self, x: &u16) -> bool { - *self == Go::from(*x) - } -} - -// u16 == Go -impl PartialEq for u16 { - #[inline(always)] - fn eq(&self, x: &Go) -> bool { - *x == *self - } -} diff --git a/src/languages/mod.rs b/src/languages/mod.rs index 161ebeaa9..8073d95b6 100644 --- a/src/languages/mod.rs +++ b/src/languages/mod.rs @@ -4,9 +4,6 @@ pub use language_ccomment::*; pub mod language_cpp; pub use language_cpp::*; -pub mod language_go; -pub use language_go::*; - pub mod language_java; pub use language_java::*; diff --git a/src/metrics/cognitive.rs b/src/metrics/cognitive.rs index b04ba42be..bb6051b1f 100644 --- a/src/metrics/cognitive.rs +++ b/src/metrics/cognitive.rs @@ -404,7 +404,6 @@ impl Cognitive for TsxCode { impl Cognitive for PreprocCode {} impl Cognitive for CcommentCode {} impl Cognitive for JavaCode {} -impl Cognitive for GoCode {} #[cfg(test)] mod tests { diff --git a/src/metrics/cyclomatic.rs b/src/metrics/cyclomatic.rs index f42e05d05..7e753a874 100644 --- a/src/metrics/cyclomatic.rs +++ b/src/metrics/cyclomatic.rs @@ -172,7 +172,6 @@ impl Cyclomatic for CppCode { impl Cyclomatic for PreprocCode {} impl Cyclomatic for CcommentCode {} impl Cyclomatic for JavaCode {} -impl Cyclomatic for GoCode {} #[cfg(test)] mod tests { diff --git a/src/metrics/exit.rs b/src/metrics/exit.rs index f059f2b5e..46de3d882 100644 --- a/src/metrics/exit.rs +++ b/src/metrics/exit.rs @@ -136,7 +136,6 @@ impl Exit for CppCode { impl Exit for PreprocCode {} impl Exit for CcommentCode {} impl Exit for JavaCode {} -impl Exit for GoCode {} #[cfg(test)] mod tests { diff --git a/src/metrics/fn_args.rs b/src/metrics/fn_args.rs index 546c5826c..94dd256c2 100644 --- a/src/metrics/fn_args.rs +++ b/src/metrics/fn_args.rs @@ -120,7 +120,6 @@ impl NArgs for RustCode {} impl NArgs for PreprocCode {} impl NArgs for CcommentCode {} impl NArgs for JavaCode {} -impl NArgs for GoCode {} #[cfg(test)] mod tests { diff --git a/src/metrics/halstead.rs b/src/metrics/halstead.rs index c04f5e071..c66dff555 100644 --- a/src/metrics/halstead.rs +++ b/src/metrics/halstead.rs @@ -328,7 +328,6 @@ impl Halstead for CppCode { impl Halstead for PreprocCode {} impl Halstead for CcommentCode {} impl Halstead for JavaCode {} -impl Halstead for GoCode {} #[cfg(test)] mod tests { diff --git a/src/metrics/loc.rs b/src/metrics/loc.rs index 771ececc1..ccb40567a 100644 --- a/src/metrics/loc.rs +++ b/src/metrics/loc.rs @@ -364,7 +364,6 @@ impl Loc for CppCode { impl Loc for PreprocCode {} impl Loc for CcommentCode {} impl Loc for JavaCode {} -impl Loc for GoCode {} #[cfg(test)] mod tests { diff --git a/src/metrics/mi.rs b/src/metrics/mi.rs index b1e172350..e88271c91 100644 --- a/src/metrics/mi.rs +++ b/src/metrics/mi.rs @@ -112,7 +112,6 @@ impl Mi for TsxCode {} impl Mi for PreprocCode {} impl Mi for CcommentCode {} impl Mi for JavaCode {} -impl Mi for GoCode {} #[cfg(test)] mod tests { diff --git a/src/metrics/nom.rs b/src/metrics/nom.rs index 55a97da0b..8b25a4520 100644 --- a/src/metrics/nom.rs +++ b/src/metrics/nom.rs @@ -195,7 +195,6 @@ impl Nom for CppCode { impl Nom for PreprocCode {} impl Nom for CcommentCode {} impl Nom for JavaCode {} -impl Nom for GoCode {} #[cfg(test)] mod tests { diff --git a/tree-sitter-go b/tree-sitter-go deleted file mode 160000 index 34181774b..000000000 --- a/tree-sitter-go +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 34181774b3e86b7801c939c79c7b80a82df91a2b