Skip to content

Commit e4aba2a

Browse files
committed
Tree-sitter: Bump to 0.22.5
1 parent f7113e0 commit e4aba2a

File tree

17 files changed

+236
-171
lines changed

17 files changed

+236
-171
lines changed

python/extractor/tsg-python/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ authors = ["Taus Brock-Nannestad <[email protected]>"]
77
edition = "2018"
88

99
# When changing/updating these, the `Cargo.Bazel.lock` file has to be regenerated.
10-
# Run `CARGO_BAZEL_REPIN=true CARGO_BAZEL_REPIN_ONLY=py_deps ./build --bazel sync --only=py_deps`
10+
# Run `CARGO_BAZEL_REPIN=true CARGO_BAZEL_REPIN_ONLY=py_deps ./tools/bazel sync --only=py_deps`
1111
# in the `semmle-code` repository to do so.
1212
# For more information, check out the documentation at
1313
# https://bazelbuild.github.io/rules_rust/crate_universe.html#repinning--updating-dependencies

python/extractor/tsg-python/rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
# extractor. It is set to the lowest version of Rust we want to support.
33

44
[toolchain]
5-
channel = "1.68"
5+
channel = "1.70"
66
profile = "minimal"
77
components = [ "rustfmt" ]

ql/Cargo.lock

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

ql/buramu/tree-sitter-blame/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ include = [
2020
path = "bindings/rust/lib.rs"
2121

2222
[dependencies]
23-
tree-sitter = "~0.20.3"
23+
tree-sitter = "0.22.5"
2424

2525
[build-dependencies]
2626
cc = "1.0"

ql/extractor/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ edition = "2018"
77
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
88

99
[dependencies]
10-
tree-sitter = ">= 0.20, < 0.21"
11-
tree-sitter-ql = { git = "https://github.com/tree-sitter/tree-sitter-ql.git", rev = "d08db734f8dc52f6bc04db53a966603122bc6985"}
12-
tree-sitter-ql-dbscheme = { git = "https://github.com/erik-krogh/tree-sitter-ql-dbscheme.git", rev = "63e1344353f63931e88bfbc2faa2e78e1421b213"}
10+
tree-sitter = "0.22.5"
11+
tree-sitter-ql = { git = "https://github.com/tree-sitter/tree-sitter-ql.git", rev = "fa5c3821dd2161f5c8528a8cbdb258daa6dc4de6"}
12+
tree-sitter-ql-dbscheme = { git = "https://github.com/tree-sitter/tree-sitter-ql-dbscheme.git", rev = "5f770f57fa415607ff50e3d237d47c8f11440eb3"}
1313
tree-sitter-blame = {path = "../buramu/tree-sitter-blame"}
14-
tree-sitter-json = {git = "https://github.com/tausbn/tree-sitter-json.git", rev = "745663ee997f1576fe1e7187e6347e0db36ec7a9"}
14+
tree-sitter-json = {git = "https://github.com/tree-sitter/tree-sitter-json.git", rev = "80e623c2165887f9829357acfa9c0a0bab34a3cd"}
1515
clap = { version = "4.2", features = ["derive"] }
1616
tracing = "0.1"
1717
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }

ql/ql/src/codeql_ql/ast/internal/TreeSitter.qll

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,13 +1767,15 @@ module JSON {
17671767
final override string getAPrimaryQlClass() { result = "ReservedWord" }
17681768
}
17691769

1770+
class UnderscoreValue extends @json_underscore_value, AstNode { }
1771+
17701772
/** A class representing `array` nodes. */
17711773
class Array extends @json_array, AstNode {
17721774
/** Gets the name of the primary QL class for this element. */
17731775
final override string getAPrimaryQlClass() { result = "Array" }
17741776

17751777
/** Gets the `i`th child of this node. */
1776-
final Value getChild(int i) { json_array_child(this, i, result) }
1778+
final UnderscoreValue getChild(int i) { json_array_child(this, i, result) }
17771779

17781780
/** Gets a field or child node of this node. */
17791781
final override AstNode getAFieldOrChild() { json_array_child(this, _, result) }
@@ -1791,12 +1793,18 @@ module JSON {
17911793
final override string getAPrimaryQlClass() { result = "Document" }
17921794

17931795
/** Gets the `i`th child of this node. */
1794-
final Value getChild(int i) { json_document_child(this, i, result) }
1796+
final UnderscoreValue getChild(int i) { json_document_child(this, i, result) }
17951797

17961798
/** Gets a field or child node of this node. */
17971799
final override AstNode getAFieldOrChild() { json_document_child(this, _, result) }
17981800
}
17991801

1802+
/** A class representing `escape_sequence` tokens. */
1803+
class EscapeSequence extends @json_token_escape_sequence, Token {
1804+
/** Gets the name of the primary QL class for this element. */
1805+
final override string getAPrimaryQlClass() { result = "EscapeSequence" }
1806+
}
1807+
18001808
/** A class representing `false` tokens. */
18011809
class False extends @json_token_false, Token {
18021810
/** Gets the name of the primary QL class for this element. */
@@ -1833,10 +1841,10 @@ module JSON {
18331841
final override string getAPrimaryQlClass() { result = "Pair" }
18341842

18351843
/** Gets the node corresponding to the field `key`. */
1836-
final AstNode getKey() { json_pair_def(this, result, _) }
1844+
final String getKey() { json_pair_def(this, result, _) }
18371845

18381846
/** Gets the node corresponding to the field `value`. */
1839-
final Value getValue() { json_pair_def(this, _, result) }
1847+
final UnderscoreValue getValue() { json_pair_def(this, _, result) }
18401848

18411849
/** Gets a field or child node of this node. */
18421850
final override AstNode getAFieldOrChild() {
@@ -1856,17 +1864,21 @@ module JSON {
18561864
final override AstNode getAFieldOrChild() { json_string_child(this, result) }
18571865
}
18581866

1859-
/** A class representing `string_content` tokens. */
1860-
class StringContent extends @json_token_string_content, Token {
1867+
/** A class representing `string_content` nodes. */
1868+
class StringContent extends @json_string_content, AstNode {
18611869
/** Gets the name of the primary QL class for this element. */
18621870
final override string getAPrimaryQlClass() { result = "StringContent" }
1871+
1872+
/** Gets the `i`th child of this node. */
1873+
final EscapeSequence getChild(int i) { json_string_content_child(this, i, result) }
1874+
1875+
/** Gets a field or child node of this node. */
1876+
final override AstNode getAFieldOrChild() { json_string_content_child(this, _, result) }
18631877
}
18641878

18651879
/** A class representing `true` tokens. */
18661880
class True extends @json_token_true, Token {
18671881
/** Gets the name of the primary QL class for this element. */
18681882
final override string getAPrimaryQlClass() { result = "True" }
18691883
}
1870-
1871-
class Value extends @json_value, AstNode { }
18721884
}

ql/ql/src/ql.dbscheme

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,11 +1239,13 @@ blame_ast_node_parent(
12391239
);
12401240

12411241
/*- JSON dbscheme -*/
1242+
@json_underscore_value = @json_array | @json_object | @json_string__ | @json_token_false | @json_token_null | @json_token_number | @json_token_true
1243+
12421244
#keyset[json_array, index]
12431245
json_array_child(
12441246
int json_array: @json_array ref,
12451247
int index: int ref,
1246-
unique int child: @json_value ref
1248+
unique int child: @json_underscore_value ref
12471249
);
12481250

12491251
json_array_def(
@@ -1254,7 +1256,7 @@ json_array_def(
12541256
json_document_child(
12551257
int json_document: @json_document ref,
12561258
int index: int ref,
1257-
unique int child: @json_value ref
1259+
unique int child: @json_underscore_value ref
12581260
);
12591261

12601262
json_document_def(
@@ -1272,24 +1274,31 @@ json_object_def(
12721274
unique int id: @json_object
12731275
);
12741276

1275-
@json_pair_key_type = @json_string__ | @json_token_number
1276-
12771277
json_pair_def(
12781278
unique int id: @json_pair,
1279-
int key__: @json_pair_key_type ref,
1280-
int value: @json_value ref
1279+
int key__: @json_string__ ref,
1280+
int value: @json_underscore_value ref
12811281
);
12821282

12831283
json_string_child(
12841284
unique int json_string__: @json_string__ ref,
1285-
unique int child: @json_token_string_content ref
1285+
unique int child: @json_string_content ref
12861286
);
12871287

12881288
json_string_def(
12891289
unique int id: @json_string__
12901290
);
12911291

1292-
@json_value = @json_array | @json_object | @json_string__ | @json_token_false | @json_token_null | @json_token_number | @json_token_true
1292+
#keyset[json_string_content, index]
1293+
json_string_content_child(
1294+
int json_string_content: @json_string_content ref,
1295+
int index: int ref,
1296+
unique int child: @json_token_escape_sequence ref
1297+
);
1298+
1299+
json_string_content_def(
1300+
unique int id: @json_string_content
1301+
);
12931302

12941303
json_tokeninfo(
12951304
unique int id: @json_token,
@@ -1300,15 +1309,15 @@ json_tokeninfo(
13001309
case @json_token.kind of
13011310
0 = @json_reserved_word
13021311
| 1 = @json_token_comment
1303-
| 2 = @json_token_false
1304-
| 3 = @json_token_null
1305-
| 4 = @json_token_number
1306-
| 5 = @json_token_string_content
1312+
| 2 = @json_token_escape_sequence
1313+
| 3 = @json_token_false
1314+
| 4 = @json_token_null
1315+
| 5 = @json_token_number
13071316
| 6 = @json_token_true
13081317
;
13091318

13101319

1311-
@json_ast_node = @json_array | @json_document | @json_object | @json_pair | @json_string__ | @json_token
1320+
@json_ast_node = @json_array | @json_document | @json_object | @json_pair | @json_string__ | @json_string_content | @json_token
13121321

13131322
json_ast_node_location(
13141323
unique int node: @json_ast_node ref,

ql/rust-toolchain.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
# extractor. It is set to the lowest version of Rust we want to support.
33

44
[toolchain]
5-
channel = "1.68"
5+
channel = "1.70"
66
profile = "minimal"
7-
components = [ "rustfmt" ]
7+
components = [ "rustfmt" ]

0 commit comments

Comments
 (0)