From 07280aa12c9a2d65c9bab52ba0f949aa441dd844 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 31 Dec 2025 17:01:10 +0000 Subject: [PATCH 1/4] Update Rust crate tree-sitter to 0.26 --- tools/cpp_code_analyzer/Cargo.lock | 60 +++++++++++++++++++----------- tools/cpp_code_analyzer/Cargo.toml | 2 +- 2 files changed, 40 insertions(+), 22 deletions(-) diff --git a/tools/cpp_code_analyzer/Cargo.lock b/tools/cpp_code_analyzer/Cargo.lock index c62a961..d0c6d92 100644 --- a/tools/cpp_code_analyzer/Cargo.lock +++ b/tools/cpp_code_analyzer/Cargo.lock @@ -63,10 +63,11 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.27" +version = "1.2.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc" +checksum = "7a0aeaff4ff1a90589618835a598e545176939b97874f7abc7851caa0618f203" dependencies = [ + "find-msvc-tools", "shlex", ] @@ -176,6 +177,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" +[[package]] +name = "find-msvc-tools" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645cbb3a84e60b7531617d5ae4e57f7e27308f6445f5abf653209ea76dec8dff" + [[package]] name = "hashbrown" version = "0.15.4" @@ -303,9 +310,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.11.1" +version = "1.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" dependencies = [ "aho-corasick", "memchr", @@ -315,9 +322,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.9" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" dependencies = [ "aho-corasick", "memchr", @@ -326,30 +333,34 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.5" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" [[package]] -name = "ryu" -version = "1.0.20" +name = "serde" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] [[package]] -name = "serde" -version = "1.0.219" +name = "serde_core" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.219" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", @@ -358,15 +369,16 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.140" +version = "1.0.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +checksum = "3084b546a1dd6289475996f182a22aba973866ea8e8b02c51d9f46b1336a22da" dependencies = [ "indexmap", "itoa", "memchr", - "ryu", "serde", + "serde_core", + "zmij", ] [[package]] @@ -409,9 +421,9 @@ dependencies = [ [[package]] name = "tree-sitter" -version = "0.25.10" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78f873475d258561b06f1c595d93308a7ed124d9977cb26b148c2084a4a3cc87" +checksum = "974d205cc395652cfa8b37daa053fe56eebd429acf8dc055503fee648dae981e" dependencies = [ "cc", "regex", @@ -542,3 +554,9 @@ name = "yansi" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" + +[[package]] +name = "zmij" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3280a1b827474fcd5dbef4b35a674deb52ba5c312363aef9135317df179d81b" diff --git a/tools/cpp_code_analyzer/Cargo.toml b/tools/cpp_code_analyzer/Cargo.toml index 8e1e71c..12d0009 100644 --- a/tools/cpp_code_analyzer/Cargo.toml +++ b/tools/cpp_code_analyzer/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] clap = { version = "4.5.40", features = ["derive"] } codespan-reporting = "0.13" -tree-sitter = "0.25" +tree-sitter = "0.26" tree-sitter-cpp = "0.23" layout-rs = "0.1" log = "0.4" From 7f4884f4724e95a1552b8c2f57c7bec12a8c7dea Mon Sep 17 00:00:00 2001 From: Benjamin Kober Date: Thu, 1 Jan 2026 10:26:26 +0200 Subject: [PATCH 2/4] Update parser.rs --- tools/cpp_code_analyzer/src/parser.rs | 50 +++++++++++++-------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/tools/cpp_code_analyzer/src/parser.rs b/tools/cpp_code_analyzer/src/parser.rs index da5b44d..1004bc8 100644 --- a/tools/cpp_code_analyzer/src/parser.rs +++ b/tools/cpp_code_analyzer/src/parser.rs @@ -20,7 +20,7 @@ pub fn parse_cpp_chunc(name: &str, input: &str) -> AST { } fn parse_global_codechunk(base: &mut AST, cl: &Node, code: &str) { - for idx in 0..cl.child_count() { + for idx in 0..cl.child_count() as u32 { let child = cl.child(idx).unwrap(); match child.kind() { "class_specifier" => base.children.push(extract_class(&child, code)), @@ -57,7 +57,7 @@ fn parse_include(node: &Node, code: &str) -> AST { let mut children = vec![]; let mut name = ""; - for idx in 0..node.child_count() { + for idx in 0..node.child_count() as u32 { let child = node.child(idx).unwrap(); match child.kind() { "string_literal"|"system_lib_string" => { @@ -91,7 +91,7 @@ fn extract_class(cl: &Node, code: &str) -> AST { find_lint_instructions(cl, code, &mut instructions, &mut children); - for idx in 0..cl.child_count() { + for idx in 0..cl.child_count() as u32 { let child = cl.child(idx).unwrap(); match child.kind() { "field_declaration_list" => { @@ -155,7 +155,7 @@ fn extract_class_fields(fields: &Node, code: &str) -> Vec { let mut children = vec![]; let mut access_specifier = "public"; - for idx in 0..fields.child_count() { + for idx in 0..fields.child_count() as u32 { let child = fields.child(idx).unwrap(); let range = child.byte_range(); match child.kind() { @@ -182,7 +182,7 @@ fn extract_derives(fields: &Node, code: &str, class_name: &str) -> (Vec, Ve let mut derived_from = vec![]; let mut errors = vec![]; - for idx in 0..fields.child_count() { + for idx in 0..fields.child_count() as u32 { let child = fields.child(idx).unwrap(); let range = child.byte_range(); match child.kind() { @@ -235,7 +235,7 @@ fn is_default_destructor(node: &Node) -> bool { let mut is_destructor = false; let mut is_default = false; - for idx in 0..node.child_count() { + for idx in 0..node.child_count() as u32 { let child = node.child(idx).unwrap(); match child.kind() { "function_declarator" => is_destructor = check_is_destructor(&child), @@ -248,7 +248,7 @@ fn is_default_destructor(node: &Node) -> bool { } fn check_is_destructor(node: &Node) -> bool { - for idx in 0..node.child_count() { + for idx in 0..node.child_count() as u32 { let child = node.child(idx).unwrap(); match child.kind() { "destructor_name" => return true, @@ -262,7 +262,7 @@ fn check_is_destructor(node: &Node) -> bool { fn extract_declaration(field: &Node, code: &str, access_specifier: &str) -> Vec { let mut children = vec![]; - for idx in 0..field.child_count() { + for idx in 0..field.child_count() as u32 { let child = field.child(idx).unwrap(); let range = child.byte_range(); match child.kind() { @@ -349,7 +349,7 @@ fn extract_function(field: &Node, code: &str, access_specifier: &str) -> AST { let mut dependencies = vec![]; let mut children = vec![]; - for idx in 0..field.child_count() { + for idx in 0..field.child_count() as u32 { let child = field.child(idx).unwrap(); match child.kind() { x if is_primitive_type(x) => dependencies.push(AST { @@ -392,7 +392,7 @@ fn extract_function(field: &Node, code: &str, access_specifier: &str) -> AST { fn extract_statement(node: &Node, code: &str) -> Vec { let mut children = vec![]; - for idx in 0..node.child_count() { + for idx in 0..node.child_count() as u32 { let child = node.child(idx).unwrap(); let range = child.byte_range(); match child.kind() { @@ -430,7 +430,7 @@ fn extract_statement(node: &Node, code: &str) -> Vec { fn extract_update_expression(node: &Node, code: &str) -> Vec { let mut children = vec![]; - for idx in 0..node.child_count() { + for idx in 0..node.child_count() as u32 { let child = node.child(idx).unwrap(); let range = child.byte_range(); match child.kind() { @@ -471,7 +471,7 @@ fn extract_update_expression(node: &Node, code: &str) -> Vec { fn extract_call_expression(node: &Node, code: &str) -> Vec { let mut children = vec![]; - for idx in 0..node.child_count() { + for idx in 0..node.child_count() as u32 { let child = node.child(idx).unwrap(); let range = child.byte_range(); match child.kind() { @@ -500,7 +500,7 @@ fn extract_call_expression(node: &Node, code: &str) -> Vec { fn extract_template_type(node: &Node, code: &str) -> Vec { let mut dependencies = vec![]; - for idx in 0..node.child_count() { + for idx in 0..node.child_count() as u32 { let child = node.child(idx).unwrap(); let range = child.byte_range(); match child.kind() { @@ -525,7 +525,7 @@ fn extract_template_type(node: &Node, code: &str) -> Vec { fn extract_template_arguments(node: &Node, code: &str) -> Vec { let mut dependencies = vec![]; - for idx in 0..node.child_count() { + for idx in 0..node.child_count() as u32 { let child = node.child(idx).unwrap(); let range = child.byte_range(); match child.kind() { @@ -553,7 +553,7 @@ fn extract_template_arguments(node: &Node, code: &str) -> Vec { fn extract_field_expression(node: &Node, code: &str) -> Vec { let mut children = vec![]; - for idx in 0..node.child_count() { + for idx in 0..node.child_count() as u32 { let child = node.child(idx).unwrap(); let range = child.byte_range(); match child.kind() { @@ -582,7 +582,7 @@ fn extract_field_expression(node: &Node, code: &str) -> Vec { fn extract_parameters(node: &Node, code: &str) -> Vec { let mut children = vec![]; - for idx in 0..node.child_count() { + for idx in 0..node.child_count() as u32 { let child = node.child(idx).unwrap(); match child.kind() { "parameter_declaration"|"optional_parameter_declaration" => children.append(&mut extract_param(&child, code)), @@ -606,7 +606,7 @@ fn extract_parameters(node: &Node, code: &str) -> Vec { fn extract_arguments(node: &Node, code: &str) -> Vec { let mut children = vec![]; - for idx in 0..node.child_count() { + for idx in 0..node.child_count() as u32 { let child = node.child(idx).unwrap(); let range = child.byte_range(); match child.kind() { @@ -647,7 +647,7 @@ fn extract_param(node: &Node, code: &str) -> Vec { let mut children = vec![]; let mut name = "".to_string(); - for idx in 0..node.child_count() { + for idx in 0..node.child_count() as u32 { let child = node.child(idx).unwrap(); let range = child.byte_range(); match child.kind() { @@ -693,7 +693,7 @@ fn parse_enum(node: &Node, code: &str) -> Vec { let mut children = vec![]; let mut name = ""; - for idx in 0..node.child_count() { + for idx in 0..node.child_count() as u32 { let child = node.child(idx).unwrap(); let range = child.byte_range(); match child.kind() { @@ -722,7 +722,7 @@ fn parse_enum(node: &Node, code: &str) -> Vec { fn parse_enum_variant(node: &Node, code: &str, namespace: &str) -> Vec { let mut children = vec![]; - for idx in 0..node.child_count() { + for idx in 0..node.child_count() as u32 { let child = node.child(idx).unwrap(); let range = child.byte_range(); match child.kind() { @@ -765,7 +765,7 @@ fn parse_struct(node: &Node, code: &str) -> AST { let mut children = vec![]; let mut name = ""; - for idx in 0..node.child_count() { + for idx in 0..node.child_count() as u32 { let child = node.child(idx).unwrap(); match child.kind() { "type_identifier" => { @@ -795,7 +795,7 @@ fn parse_alias(node: &Node, code: &str) -> AST { let mut children = vec![]; let mut name = ""; - for idx in 0..node.child_count() { + for idx in 0..node.child_count() as u32 { let child = node.child(idx).unwrap(); match child.kind() { "type_identifier" => { @@ -821,7 +821,7 @@ fn parse_alias(node: &Node, code: &str) -> AST { } fn get_class_name(node: &Node, code: &str) -> String { - for idx in 0..node.child_count() { + for idx in 0..node.child_count() as u32 { let child = node.child(idx).unwrap(); let range = child.byte_range(); match child.kind() { @@ -871,7 +871,7 @@ fn get_variable_name(node: &Node, code: &str) -> String { fn get_function_name(node: &Node, code: &str) -> (String, Option) { let mut namespace = None; - for idx in 0..node.child_count() { + for idx in 0..node.child_count() as u32 { let child = node.child(idx).unwrap(); let range = child.byte_range(); match child.kind() { @@ -896,7 +896,7 @@ fn get_function_name(node: &Node, code: &str) -> (String, Option) { } fn check_is_const(node: &Node, code: &str) -> bool { - for idx in 0..node.child_count() { + for idx in 0..node.child_count() as u32 { let child = node.child(idx).unwrap(); let range = child.byte_range(); match child.kind() { From 0352531b7af57846b8f45a5914f927c1fca1800a Mon Sep 17 00:00:00 2001 From: Benjamin Kober Date: Thu, 1 Jan 2026 10:29:47 +0200 Subject: [PATCH 3/4] Update parser.rs --- tools/cpp_code_analyzer/src/parser.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cpp_code_analyzer/src/parser.rs b/tools/cpp_code_analyzer/src/parser.rs index 1004bc8..b46bcde 100644 --- a/tools/cpp_code_analyzer/src/parser.rs +++ b/tools/cpp_code_analyzer/src/parser.rs @@ -848,7 +848,7 @@ fn get_variable_name(node: &Node, code: &str) -> String { }, "array_declarator"|"enumerator"|"pointer_declarator" |"reference_declarator" => { - for idx in 0..node.child_count() { + for idx in 0..node.child_count() as u32 { let child = node.child(idx).unwrap(); match child.kind() { "identifier"|"field_identifier"|"qualified_identifier" From 8ae1648caf1e0194d2576f95d2537ba8a701c3f6 Mon Sep 17 00:00:00 2001 From: Benjamin Kober Date: Thu, 1 Jan 2026 10:30:54 +0200 Subject: [PATCH 4/4] Update derive_interface.rs --- tools/cpp_code_analyzer/src/fix/derive_interface.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/cpp_code_analyzer/src/fix/derive_interface.rs b/tools/cpp_code_analyzer/src/fix/derive_interface.rs index a6d92cf..7d6d67e 100644 --- a/tools/cpp_code_analyzer/src/fix/derive_interface.rs +++ b/tools/cpp_code_analyzer/src/fix/derive_interface.rs @@ -25,7 +25,7 @@ pub fn modify_to_derive_from_interface(class: &AST, content: &str) -> String { fn find_derive_position(node: &Node) -> usize { let mut pos = 0; - for idx in 0..node.child_count() { + for idx in 0..node.child_count() as u32 { let child = node.child(idx).unwrap(); match child.kind() { @@ -43,7 +43,7 @@ fn find_derive_position(node: &Node) -> usize { } fn find_include_position(node: &Node) -> usize { - for idx in 0..node.child_count() { + for idx in 0..node.child_count() as u32 { let child = node.child(idx).unwrap(); match child.kind() {