From 29558e5d7ba838f8fd4f4dc9521a06f8174fdf16 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 8 Mar 2026 05:17:28 +0000 Subject: [PATCH 1/2] chore(deps-dev): bump tree-sitter-go from 0.23.4 to 0.25.0 Bumps [tree-sitter-go](https://github.com/tree-sitter/tree-sitter-go) from 0.23.4 to 0.25.0. - [Release notes](https://github.com/tree-sitter/tree-sitter-go/releases) - [Commits](https://github.com/tree-sitter/tree-sitter-go/compare/v0.23.4...v0.25.0) --- updated-dependencies: - dependency-name: tree-sitter-go dependency-version: 0.25.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index aacdaf0..46bd07b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,7 +29,7 @@ "husky": "^9.1", "tree-sitter-c-sharp": "^0.23.1", "tree-sitter-cli": "^0.26.5", - "tree-sitter-go": "^0.23.4", + "tree-sitter-go": "^0.25.0", "tree-sitter-java": "^0.23.5", "tree-sitter-javascript": "^0.25.0", "tree-sitter-php": "^0.24.2", @@ -7301,18 +7301,18 @@ } }, "node_modules/tree-sitter-go": { - "version": "0.23.4", - "resolved": "https://registry.npmjs.org/tree-sitter-go/-/tree-sitter-go-0.23.4.tgz", - "integrity": "sha512-iQaHEs4yMa/hMo/ZCGqLfG61F0miinULU1fFh+GZreCRtKylFLtvn798ocCZjO2r/ungNZgAY1s1hPFyAwkc7w==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/tree-sitter-go/-/tree-sitter-go-0.25.0.tgz", + "integrity": "sha512-APBc/Dq3xz/e35Xpkhb1blu5UgW+2E3RyGWawZSCNcbGwa7jhSQPS8KsUupuzBla8PCo8+lz9W/JDJjmfRa2tw==", "dev": true, "hasInstallScript": true, "license": "MIT", "dependencies": { - "node-addon-api": "^8.2.1", - "node-gyp-build": "^4.8.2" + "node-addon-api": "^8.3.1", + "node-gyp-build": "^4.8.4" }, "peerDependencies": { - "tree-sitter": "^0.21.1" + "tree-sitter": "^0.25.0" }, "peerDependenciesMeta": { "tree-sitter": { diff --git a/package.json b/package.json index be8238c..4a208a0 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,7 @@ "husky": "^9.1", "tree-sitter-c-sharp": "^0.23.1", "tree-sitter-cli": "^0.26.5", - "tree-sitter-go": "^0.23.4", + "tree-sitter-go": "^0.25.0", "tree-sitter-java": "^0.23.5", "tree-sitter-javascript": "^0.25.0", "tree-sitter-php": "^0.24.2", From 3fac3a90b6fed3009b2e4ca39204e5176467872e Mon Sep 17 00:00:00 2001 From: carlos-alm <127798846+carlos-alm@users.noreply.github.com> Date: Sun, 8 Mar 2026 03:30:11 -0600 Subject: [PATCH 2/2] fix(cfg): handle statement_list wrapper in tree-sitter-go 0.25.0 tree-sitter-go 0.25.0 wraps block and case body contents in a statement_list node. Update getStatements() and switch case extraction to unwrap these transparently, fixing Go CFG tests for if/else, for loops, break/continue, and switch statements. Impact: 3 functions changed, 0 affected --- src/cfg.js | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/src/cfg.js b/src/cfg.js index d0f4d2e..c9cc54e 100644 --- a/src/cfg.js +++ b/src/cfg.js @@ -327,11 +327,23 @@ export function buildFunctionCFG(functionNode, langId) { */ function getStatements(node) { if (!node) return []; - // Block-like nodes: extract named children - if (node.type === rules.blockNode || rules.blockNodes?.has(node.type)) { + // Block-like nodes (including statement_list wrappers from tree-sitter-go 0.25+) + if ( + node.type === 'statement_list' || + node.type === rules.blockNode || + rules.blockNodes?.has(node.type) + ) { const stmts = []; for (let i = 0; i < node.namedChildCount; i++) { - stmts.push(node.namedChild(i)); + const child = node.namedChild(i); + if (child.type === 'statement_list') { + // Unwrap nested statement_list (block → statement_list → stmts) + for (let j = 0; j < child.namedChildCount; j++) { + stmts.push(child.namedChild(j)); + } + } else { + stmts.push(child); + } } return stmts; } @@ -888,7 +900,14 @@ export function buildFunctionCFG(functionNode, langId) { for (let j = 0; j < caseClause.namedChildCount; j++) { const child = caseClause.namedChild(j); if (child !== valueNode && child !== patternNode && child.type !== 'switch_label') { - caseStmts.push(child); + if (child.type === 'statement_list') { + // Unwrap statement_list (tree-sitter-go 0.25+) + for (let k = 0; k < child.namedChildCount; k++) { + caseStmts.push(child.namedChild(k)); + } + } else { + caseStmts.push(child); + } } } }