From 32c244787097e8b12e3f1de1a61777c35db45133 Mon Sep 17 00:00:00 2001 From: NzSN Date: Thu, 22 Feb 2024 10:26:10 +0800 Subject: [PATCH] Remove tree-sitter-xxx. --- .gitmodules | 6 ------ parsers/tree-sitter-json | 1 - parsers/tree-sitter-wgsl | 1 - src/BUILD.bazel | 18 ------------------ src/Base/generic_parsetree_antlr4.cc | 6 +++--- 5 files changed, 3 insertions(+), 29 deletions(-) delete mode 160000 parsers/tree-sitter-json delete mode 160000 parsers/tree-sitter-wgsl diff --git a/.gitmodules b/.gitmodules index 87419e5..6b60b54 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,3 @@ [submodule "third_party/grammars-v4"] path = third_party/grammars-v4 url = https://github.com/antlr/grammars-v4.git -[submodule "parsers/tree-sitter-wgsl"] - path = parsers/tree-sitter-wgsl - url = https://github.com/mehmetoguzderin/tree-sitter-wgsl.git -[submodule "parsers/tree-sitter-json"] - path = parsers/tree-sitter-json - url = https://github.com/tree-sitter/tree-sitter-json.git diff --git a/parsers/tree-sitter-json b/parsers/tree-sitter-json deleted file mode 160000 index 3fef30d..0000000 --- a/parsers/tree-sitter-json +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3fef30de8aee74600f25ec2e319b62a1a870d51e diff --git a/parsers/tree-sitter-wgsl b/parsers/tree-sitter-wgsl deleted file mode 160000 index 27ae4db..0000000 --- a/parsers/tree-sitter-wgsl +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 27ae4db1458d5ea7555300c9e93c6273723d420c diff --git a/src/BUILD.bazel b/src/BUILD.bazel index 672e410..a9c3c31 100644 --- a/src/BUILD.bazel +++ b/src/BUILD.bazel @@ -50,21 +50,3 @@ cc_test( ], visibility = ["//:__pkg__"] ) - -cc_test( - name = "tree_sitter_test", - srcs = [ - "tree_sitter_unittests.cc", - "//parsers:wgsl_treesitter_parser_srcs", - "//parsers:json_treesitter_parser_srcs", - ], - copts = [ - "-Iexternal/tree_sitter/tree_sitter/include", - "-Iparsers/tree-sitter-json/src", - "-Iparsers/tree-sitter-wgsl/src", - ], - deps = [ - "@com_google_googletest//:gtest_main", - "@tree_sitter//:tree_sitter", - ] -) diff --git a/src/Base/generic_parsetree_antlr4.cc b/src/Base/generic_parsetree_antlr4.cc index a09fa54..61777ac 100644 --- a/src/Base/generic_parsetree_antlr4.cc +++ b/src/Base/generic_parsetree_antlr4.cc @@ -24,11 +24,11 @@ struct FAILED_TO_CLONE_ANTLR_NODE: public std::exception { V(WGSL, WGSL) #define ANTLR_COPY_LANG_SPECIFIC(NAMESPACE, LANG_ENUM) \ - case ParseTree::LANG_ENUM: { \ + case ParseTree::LANG_ENUM: { \ antlr4::tree::ParseTree* copy = \ NAMESPACE::clone(const_cast(this)->tree()); \ - return std::make_unique( \ - ParseTree::LANG_ENUM, \ + return std::make_unique( \ + ParseTree::LANG_ENUM, \ copy); \ }