Skip to content

Commit 73f5e1d

Browse files
authored
Update tree-sitter-mozcpp to 0.20 (mozilla#754)
* Pick first grep occurrence * enums: Update tree-sitter deps * Update tree-sitter-mozcpp * Fix grammar enums * Update mozcpp grammar to 0.20 * Add loc test for namespace
1 parent 1c3c663 commit 73f5e1d

File tree

14 files changed

+348513
-375681
lines changed

14 files changed

+348513
-375681
lines changed

Cargo.lock

Lines changed: 24 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ tree-sitter-python = "=0.19.0"
3434
tree-sitter-rust = "=0.19.0"
3535
tree-sitter-preproc = { path = "./tree-sitter-preproc", version = "=0.19.0" }
3636
tree-sitter-ccomment = { path = "./tree-sitter-ccomment", version = "=0.19.0" }
37-
tree-sitter-mozcpp = { path = "./tree-sitter-mozcpp", version = "=0.19.5" }
37+
tree-sitter-mozcpp = { path = "./tree-sitter-mozcpp", version = "=0.20.0" }
3838
tree-sitter-mozjs = { path = "./tree-sitter-mozjs", version = "=0.19.0" }
3939

4040
[dev-dependencies]

enums/Cargo.lock

Lines changed: 24 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

enums/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ tree-sitter-python = "=0.19.0"
1616
tree-sitter-rust = "=0.19.0"
1717
tree-sitter-preproc = { path = "../tree-sitter-preproc", version = "=0.19.0" }
1818
tree-sitter-ccomment = { path = "../tree-sitter-ccomment", version = "=0.19.0" }
19-
tree-sitter-mozcpp = { path = "../tree-sitter-mozcpp", version = "=0.19.5" }
19+
tree-sitter-mozcpp = { path = "../tree-sitter-mozcpp", version = "=0.20.0" }
2020
tree-sitter-mozjs = { path = "../tree-sitter-mozjs", version = "=0.19.0" }

generate-grammars/generate-mozcpp.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ TS_CPP_CRATE="tree-sitter-cpp"
1212
JSON_CRATE_FILENAME=".cargo_vcs_info.json"
1313

1414
# Get the current tree-sitter-cpp crate version from the tree-sitter-mozcpp grammar
15-
TS_CPP_VERSION=`grep $TS_CPP_CRATE tree-sitter-mozcpp/Cargo.toml | cut -f2 -d "," | cut -f2 -d "=" | tr -d ' ' | tr -d } | tr -d \"`
15+
TS_CPP_VERSION=`grep -m 1 $TS_CPP_CRATE tree-sitter-mozcpp/Cargo.toml | cut -f2 -d "," | cut -f2 -d "=" | tr -d ' ' | tr -d } | tr -d \"`
1616

1717
# Name assigned to the compressed binary crate downloaded from crates.io
1818
CRATE_OUTPUT="$TS_CPP_CRATE-download.gz"

src/checker.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,7 @@ impl Checker for CppCode {
151151
FunctionDefinition,
152152
FunctionDefinition2,
153153
FunctionDefinition3,
154-
FunctionDefinition4,
155-
FunctionDefinitionRepeat1
154+
FunctionDefinition4
156155
);
157156
mk_checker!(is_closure, LambdaExpression);
158157
mk_checker!(

src/getter.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,10 +446,9 @@ impl Getter for CppCode {
446446
}) {
447447
if let Some(first) = fd.object().child(0) {
448448
match first.kind_id().into() {
449-
Cpp::ScopedIdentifier
449+
Cpp::TypeIdentifier
450450
| Cpp::Identifier
451451
| Cpp::FieldIdentifier
452-
| Cpp::ScopedFieldIdentifier
453452
| Cpp::DestructorName
454453
| Cpp::OperatorName
455454
| Cpp::TemplateFunction

0 commit comments

Comments
 (0)