@colbymchenry/codegraph-win32-arm64 1.6.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/codegraph +5 -0
- package/lib/dist/.test-build-engine.json +1 -0
- package/lib/dist/.test-build-viewer.json +1 -0
- package/lib/dist/bin/codegraph.d.ts +1 -0
- package/lib/dist/bin/codegraph.d.ts.map +1 -1
- package/lib/dist/bin/codegraph.js +599 -291
- package/lib/dist/bin/codegraph.js.map +1 -1
- package/lib/dist/bin/viewer-gate.d.ts +17 -0
- package/lib/dist/bin/viewer-gate.d.ts.map +1 -0
- package/lib/dist/bin/viewer-gate.js +31 -0
- package/lib/dist/bin/viewer-gate.js.map +1 -0
- package/lib/dist/context/index.d.ts.map +1 -1
- package/lib/dist/context/index.js +43 -2
- package/lib/dist/context/index.js.map +1 -1
- package/lib/dist/db/index.d.ts +21 -2
- package/lib/dist/db/index.d.ts.map +1 -1
- package/lib/dist/db/index.js +86 -31
- package/lib/dist/db/index.js.map +1 -1
- package/lib/dist/db/migrations.d.ts +1 -1
- package/lib/dist/db/migrations.d.ts.map +1 -1
- package/lib/dist/db/migrations.js +40 -1
- package/lib/dist/db/migrations.js.map +1 -1
- package/lib/dist/db/queries.d.ts +423 -3
- package/lib/dist/db/queries.d.ts.map +1 -1
- package/lib/dist/db/queries.js +1026 -33
- package/lib/dist/db/queries.js.map +1 -1
- package/lib/dist/db/schema.sql +11 -1
- package/lib/dist/db/sqlite-adapter.d.ts +2 -0
- package/lib/dist/db/sqlite-adapter.d.ts.map +1 -1
- package/lib/dist/db/sqlite-adapter.js +56 -7
- package/lib/dist/db/sqlite-adapter.js.map +1 -1
- package/lib/dist/db/synthesis-stage.d.ts +12 -0
- package/lib/dist/db/synthesis-stage.d.ts.map +1 -0
- package/lib/dist/db/synthesis-stage.js +89 -0
- package/lib/dist/db/synthesis-stage.js.map +1 -0
- package/lib/dist/db/wal-valve.d.ts +32 -12
- package/lib/dist/db/wal-valve.d.ts.map +1 -1
- package/lib/dist/db/wal-valve.js +65 -22
- package/lib/dist/db/wal-valve.js.map +1 -1
- package/lib/dist/db/wsl-shared-index.d.ts +53 -0
- package/lib/dist/db/wsl-shared-index.d.ts.map +1 -0
- package/lib/dist/db/wsl-shared-index.js +121 -0
- package/lib/dist/db/wsl-shared-index.js.map +1 -0
- package/lib/dist/directory.d.ts +101 -2
- package/lib/dist/directory.d.ts.map +1 -1
- package/lib/dist/directory.js +254 -23
- package/lib/dist/directory.js.map +1 -1
- package/lib/dist/errors.d.ts +14 -0
- package/lib/dist/errors.d.ts.map +1 -1
- package/lib/dist/errors.js +16 -1
- package/lib/dist/errors.js.map +1 -1
- package/lib/dist/extraction/cfml-extractor.d.ts +1 -0
- package/lib/dist/extraction/cfml-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/cfml-extractor.js +15 -3
- package/lib/dist/extraction/cfml-extractor.js.map +1 -1
- package/lib/dist/extraction/dfm-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/dfm-extractor.js +14 -10
- package/lib/dist/extraction/dfm-extractor.js.map +1 -1
- package/lib/dist/extraction/extraction-version.d.ts +1 -1
- package/lib/dist/extraction/extraction-version.js +1 -1
- package/lib/dist/extraction/function-ref.d.ts +6 -4
- package/lib/dist/extraction/function-ref.d.ts.map +1 -1
- package/lib/dist/extraction/function-ref.js +35 -14
- package/lib/dist/extraction/function-ref.js.map +1 -1
- package/lib/dist/extraction/grammars.d.ts +38 -0
- package/lib/dist/extraction/grammars.d.ts.map +1 -1
- package/lib/dist/extraction/grammars.js +77 -1
- package/lib/dist/extraction/grammars.js.map +1 -1
- package/lib/dist/extraction/index.d.ts +113 -15
- package/lib/dist/extraction/index.d.ts.map +1 -1
- package/lib/dist/extraction/index.js +599 -132
- package/lib/dist/extraction/index.js.map +1 -1
- package/lib/dist/extraction/languages/c-cpp.d.ts +58 -0
- package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -1
- package/lib/dist/extraction/languages/c-cpp.js +291 -15
- package/lib/dist/extraction/languages/c-cpp.js.map +1 -1
- package/lib/dist/extraction/languages/dart.d.ts.map +1 -1
- package/lib/dist/extraction/languages/dart.js +8 -3
- package/lib/dist/extraction/languages/dart.js.map +1 -1
- package/lib/dist/extraction/languages/javascript.js +1 -1
- package/lib/dist/extraction/languages/javascript.js.map +1 -1
- package/lib/dist/extraction/languages/kotlin.d.ts.map +1 -1
- package/lib/dist/extraction/languages/kotlin.js +169 -36
- package/lib/dist/extraction/languages/kotlin.js.map +1 -1
- package/lib/dist/extraction/languages/lua.d.ts.map +1 -1
- package/lib/dist/extraction/languages/lua.js +4 -1
- package/lib/dist/extraction/languages/lua.js.map +1 -1
- package/lib/dist/extraction/languages/python.d.ts.map +1 -1
- package/lib/dist/extraction/languages/python.js +71 -0
- package/lib/dist/extraction/languages/python.js.map +1 -1
- package/lib/dist/extraction/languages/rust.d.ts.map +1 -1
- package/lib/dist/extraction/languages/rust.js +3 -0
- package/lib/dist/extraction/languages/rust.js.map +1 -1
- package/lib/dist/extraction/languages/scala.d.ts.map +1 -1
- package/lib/dist/extraction/languages/scala.js +18 -3
- package/lib/dist/extraction/languages/scala.js.map +1 -1
- package/lib/dist/extraction/languages/typescript.d.ts.map +1 -1
- package/lib/dist/extraction/languages/typescript.js +9 -2
- package/lib/dist/extraction/languages/typescript.js.map +1 -1
- package/lib/dist/extraction/liquid-extractor.d.ts +18 -0
- package/lib/dist/extraction/liquid-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/liquid-extractor.js +98 -22
- package/lib/dist/extraction/liquid-extractor.js.map +1 -1
- package/lib/dist/extraction/mybatis-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/mybatis-extractor.js +6 -4
- package/lib/dist/extraction/mybatis-extractor.js.map +1 -1
- package/lib/dist/extraction/syntax-tokens.d.ts +103 -0
- package/lib/dist/extraction/syntax-tokens.d.ts.map +1 -0
- package/lib/dist/extraction/syntax-tokens.js +381 -0
- package/lib/dist/extraction/syntax-tokens.js.map +1 -0
- package/lib/dist/extraction/tree-sitter-helpers.d.ts +5 -0
- package/lib/dist/extraction/tree-sitter-helpers.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter-helpers.js +17 -0
- package/lib/dist/extraction/tree-sitter-helpers.js.map +1 -1
- package/lib/dist/extraction/tree-sitter-types.d.ts +29 -3
- package/lib/dist/extraction/tree-sitter-types.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter.d.ts +96 -17
- package/lib/dist/extraction/tree-sitter.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter.js +820 -82
- package/lib/dist/extraction/tree-sitter.js.map +1 -1
- package/lib/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
- package/lib/dist/file-limits.d.ts +40 -0
- package/lib/dist/file-limits.d.ts.map +1 -0
- package/lib/dist/file-limits.js +147 -0
- package/lib/dist/file-limits.js.map +1 -0
- package/lib/dist/graph/branch-guards.d.ts +248 -0
- package/lib/dist/graph/branch-guards.d.ts.map +1 -0
- package/lib/dist/graph/branch-guards.js +2231 -0
- package/lib/dist/graph/branch-guards.js.map +1 -0
- package/lib/dist/graph/dead-code.d.ts +251 -0
- package/lib/dist/graph/dead-code.d.ts.map +1 -0
- package/lib/dist/graph/dead-code.js +776 -0
- package/lib/dist/graph/dead-code.js.map +1 -0
- package/lib/dist/graph/dynamic-boundary-report.d.ts +121 -0
- package/lib/dist/graph/dynamic-boundary-report.d.ts.map +1 -0
- package/lib/dist/graph/dynamic-boundary-report.js +283 -0
- package/lib/dist/graph/dynamic-boundary-report.js.map +1 -0
- package/lib/dist/graph/index.d.ts +4 -0
- package/lib/dist/graph/index.d.ts.map +1 -1
- package/lib/dist/graph/index.js +16 -1
- package/lib/dist/graph/index.js.map +1 -1
- package/lib/dist/graph/named-symbol-flow.d.ts +125 -0
- package/lib/dist/graph/named-symbol-flow.d.ts.map +1 -0
- package/lib/dist/graph/named-symbol-flow.js +552 -0
- package/lib/dist/graph/named-symbol-flow.js.map +1 -0
- package/lib/dist/graph/symbol-lookup.d.ts +83 -0
- package/lib/dist/graph/symbol-lookup.d.ts.map +1 -0
- package/lib/dist/graph/symbol-lookup.js +181 -0
- package/lib/dist/graph/symbol-lookup.js.map +1 -0
- package/lib/dist/graph/traversal.d.ts +9 -0
- package/lib/dist/graph/traversal.d.ts.map +1 -1
- package/lib/dist/graph/traversal.js +61 -35
- package/lib/dist/graph/traversal.js.map +1 -1
- package/lib/dist/graph/type-hierarchy.d.ts +155 -0
- package/lib/dist/graph/type-hierarchy.d.ts.map +1 -0
- package/lib/dist/graph/type-hierarchy.js +382 -0
- package/lib/dist/graph/type-hierarchy.js.map +1 -0
- package/lib/dist/index.d.ts +251 -11
- package/lib/dist/index.d.ts.map +1 -1
- package/lib/dist/index.js +395 -34
- package/lib/dist/index.js.map +1 -1
- package/lib/dist/installer/index.d.ts.map +1 -1
- package/lib/dist/installer/index.js +3 -2
- package/lib/dist/installer/index.js.map +1 -1
- package/lib/dist/installer/targets/antigravity.d.ts.map +1 -1
- package/lib/dist/installer/targets/antigravity.js +14 -2
- package/lib/dist/installer/targets/antigravity.js.map +1 -1
- package/lib/dist/installer/targets/claude.d.ts +3 -0
- package/lib/dist/installer/targets/claude.d.ts.map +1 -1
- package/lib/dist/installer/targets/claude.js +35 -7
- package/lib/dist/installer/targets/claude.js.map +1 -1
- package/lib/dist/installer/targets/codex.d.ts +2 -1
- package/lib/dist/installer/targets/codex.d.ts.map +1 -1
- package/lib/dist/installer/targets/codex.js +14 -4
- package/lib/dist/installer/targets/codex.js.map +1 -1
- package/lib/dist/installer/targets/copilot-cli.d.ts.map +1 -1
- package/lib/dist/installer/targets/copilot-cli.js +7 -1
- package/lib/dist/installer/targets/copilot-cli.js.map +1 -1
- package/lib/dist/installer/targets/opencode.d.ts +16 -5
- package/lib/dist/installer/targets/opencode.d.ts.map +1 -1
- package/lib/dist/installer/targets/opencode.js +73 -22
- package/lib/dist/installer/targets/opencode.js.map +1 -1
- package/lib/dist/installer/targets/shared.d.ts +14 -3
- package/lib/dist/installer/targets/shared.d.ts.map +1 -1
- package/lib/dist/installer/targets/shared.js +39 -11
- package/lib/dist/installer/targets/shared.js.map +1 -1
- package/lib/dist/installer/targets/types.d.ts +7 -0
- package/lib/dist/installer/targets/types.d.ts.map +1 -1
- package/lib/dist/mcp/answer-freshness.d.ts +10 -0
- package/lib/dist/mcp/answer-freshness.d.ts.map +1 -0
- package/lib/dist/mcp/answer-freshness.js +68 -0
- package/lib/dist/mcp/answer-freshness.js.map +1 -0
- package/lib/dist/mcp/daemon-manager.d.ts.map +1 -1
- package/lib/dist/mcp/daemon-manager.js +16 -0
- package/lib/dist/mcp/daemon-manager.js.map +1 -1
- package/lib/dist/mcp/daemon-paths.d.ts +2 -0
- package/lib/dist/mcp/daemon-paths.d.ts.map +1 -1
- package/lib/dist/mcp/daemon-paths.js +12 -3
- package/lib/dist/mcp/daemon-paths.js.map +1 -1
- package/lib/dist/mcp/daemon-registry.d.ts +7 -4
- package/lib/dist/mcp/daemon-registry.d.ts.map +1 -1
- package/lib/dist/mcp/daemon-registry.js +91 -29
- package/lib/dist/mcp/daemon-registry.js.map +1 -1
- package/lib/dist/mcp/daemon.d.ts +17 -7
- package/lib/dist/mcp/daemon.d.ts.map +1 -1
- package/lib/dist/mcp/daemon.js +116 -24
- package/lib/dist/mcp/daemon.js.map +1 -1
- package/lib/dist/mcp/dynamic-boundaries.d.ts +1 -10
- package/lib/dist/mcp/dynamic-boundaries.d.ts.map +1 -1
- package/lib/dist/mcp/dynamic-boundaries.js +46 -42
- package/lib/dist/mcp/dynamic-boundaries.js.map +1 -1
- package/lib/dist/mcp/engine.d.ts +28 -9
- package/lib/dist/mcp/engine.d.ts.map +1 -1
- package/lib/dist/mcp/engine.js +146 -62
- package/lib/dist/mcp/engine.js.map +1 -1
- package/lib/dist/mcp/explore-dedup.d.ts +5 -2
- package/lib/dist/mcp/explore-dedup.d.ts.map +1 -1
- package/lib/dist/mcp/explore-dedup.js +8 -5
- package/lib/dist/mcp/explore-dedup.js.map +1 -1
- package/lib/dist/mcp/index-freshness-worker.d.ts +2 -0
- package/lib/dist/mcp/index-freshness-worker.d.ts.map +1 -0
- package/lib/dist/mcp/index-freshness-worker.js +30 -0
- package/lib/dist/mcp/index-freshness-worker.js.map +1 -0
- package/lib/dist/mcp/index-freshness.d.ts +7 -0
- package/lib/dist/mcp/index-freshness.d.ts.map +1 -0
- package/lib/dist/mcp/index-freshness.js +94 -0
- package/lib/dist/mcp/index-freshness.js.map +1 -0
- package/lib/dist/mcp/index.d.ts +3 -1
- package/lib/dist/mcp/index.d.ts.map +1 -1
- package/lib/dist/mcp/index.js +95 -11
- package/lib/dist/mcp/index.js.map +1 -1
- package/lib/dist/mcp/liveness-watchdog.d.ts +4 -1
- package/lib/dist/mcp/liveness-watchdog.d.ts.map +1 -1
- package/lib/dist/mcp/liveness-watchdog.js +11 -2
- package/lib/dist/mcp/liveness-watchdog.js.map +1 -1
- package/lib/dist/mcp/project-lifecycle.d.ts +9 -0
- package/lib/dist/mcp/project-lifecycle.d.ts.map +1 -0
- package/lib/dist/mcp/project-lifecycle.js +181 -0
- package/lib/dist/mcp/project-lifecycle.js.map +1 -0
- package/lib/dist/mcp/proxy.d.ts.map +1 -1
- package/lib/dist/mcp/proxy.js +9 -0
- package/lib/dist/mcp/proxy.js.map +1 -1
- package/lib/dist/mcp/query-pool.d.ts +2 -2
- package/lib/dist/mcp/query-pool.d.ts.map +1 -1
- package/lib/dist/mcp/query-pool.js +9 -7
- package/lib/dist/mcp/query-pool.js.map +1 -1
- package/lib/dist/mcp/query-worker.js +2 -2
- package/lib/dist/mcp/query-worker.js.map +1 -1
- package/lib/dist/mcp/server-instructions.d.ts +1 -1
- package/lib/dist/mcp/server-instructions.d.ts.map +1 -1
- package/lib/dist/mcp/server-instructions.js +6 -3
- package/lib/dist/mcp/server-instructions.js.map +1 -1
- package/lib/dist/mcp/startup-handshake.d.ts +3 -1
- package/lib/dist/mcp/startup-handshake.d.ts.map +1 -1
- package/lib/dist/mcp/startup-handshake.js +10 -2
- package/lib/dist/mcp/startup-handshake.js.map +1 -1
- package/lib/dist/mcp/tools.d.ts +276 -36
- package/lib/dist/mcp/tools.d.ts.map +1 -1
- package/lib/dist/mcp/tools.js +2295 -980
- package/lib/dist/mcp/tools.js.map +1 -1
- package/lib/dist/mcp/writer-lock.d.ts +61 -0
- package/lib/dist/mcp/writer-lock.d.ts.map +1 -0
- package/lib/dist/mcp/writer-lock.js +260 -0
- package/lib/dist/mcp/writer-lock.js.map +1 -0
- package/lib/dist/resolution/alias-binding.d.ts +56 -0
- package/lib/dist/resolution/alias-binding.d.ts.map +1 -0
- package/lib/dist/resolution/alias-binding.js +127 -0
- package/lib/dist/resolution/alias-binding.js.map +1 -0
- package/lib/dist/resolution/callback-synthesizer.d.ts +23 -1
- package/lib/dist/resolution/callback-synthesizer.d.ts.map +1 -1
- package/lib/dist/resolution/callback-synthesizer.js +291 -143
- package/lib/dist/resolution/callback-synthesizer.js.map +1 -1
- package/lib/dist/resolution/cpp-constructor.d.ts +4 -0
- package/lib/dist/resolution/cpp-constructor.d.ts.map +1 -0
- package/lib/dist/resolution/cpp-constructor.js +123 -0
- package/lib/dist/resolution/cpp-constructor.js.map +1 -0
- package/lib/dist/resolution/cpp-macro-visibility.d.ts +12 -0
- package/lib/dist/resolution/cpp-macro-visibility.d.ts.map +1 -0
- package/lib/dist/resolution/cpp-macro-visibility.js +342 -0
- package/lib/dist/resolution/cpp-macro-visibility.js.map +1 -0
- package/lib/dist/resolution/expo-router-synthesizer.d.ts +32 -0
- package/lib/dist/resolution/expo-router-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/expo-router-synthesizer.js +189 -0
- package/lib/dist/resolution/expo-router-synthesizer.js.map +1 -0
- package/lib/dist/resolution/frameworks/csharp.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/csharp.js +96 -2
- package/lib/dist/resolution/frameworks/csharp.js.map +1 -1
- package/lib/dist/resolution/frameworks/expo-router.d.ts +189 -0
- package/lib/dist/resolution/frameworks/expo-router.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/expo-router.js +785 -0
- package/lib/dist/resolution/frameworks/expo-router.js.map +1 -0
- package/lib/dist/resolution/frameworks/express.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/express.js +251 -16
- package/lib/dist/resolution/frameworks/express.js.map +1 -1
- package/lib/dist/resolution/frameworks/index.d.ts +5 -0
- package/lib/dist/resolution/frameworks/index.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/index.js +29 -1
- package/lib/dist/resolution/frameworks/index.js.map +1 -1
- package/lib/dist/resolution/frameworks/java.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/java.js +79 -47
- package/lib/dist/resolution/frameworks/java.js.map +1 -1
- package/lib/dist/resolution/frameworks/nestjs.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/nestjs.js +6 -14
- package/lib/dist/resolution/frameworks/nestjs.js.map +1 -1
- package/lib/dist/resolution/frameworks/nextjs.d.ts +76 -0
- package/lib/dist/resolution/frameworks/nextjs.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/nextjs.js +328 -0
- package/lib/dist/resolution/frameworks/nextjs.js.map +1 -0
- package/lib/dist/resolution/frameworks/object-literal.d.ts +32 -0
- package/lib/dist/resolution/frameworks/object-literal.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/object-literal.js +139 -0
- package/lib/dist/resolution/frameworks/object-literal.js.map +1 -0
- package/lib/dist/resolution/frameworks/package-deps.d.ts +14 -0
- package/lib/dist/resolution/frameworks/package-deps.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/package-deps.js +78 -0
- package/lib/dist/resolution/frameworks/package-deps.js.map +1 -0
- package/lib/dist/resolution/frameworks/python.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/python.js +166 -0
- package/lib/dist/resolution/frameworks/python.js.map +1 -1
- package/lib/dist/resolution/frameworks/react-native.d.ts +26 -0
- package/lib/dist/resolution/frameworks/react-native.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/react-native.js +153 -14
- package/lib/dist/resolution/frameworks/react-native.js.map +1 -1
- package/lib/dist/resolution/frameworks/react-router.d.ts +46 -0
- package/lib/dist/resolution/frameworks/react-router.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/react-router.js +187 -0
- package/lib/dist/resolution/frameworks/react-router.js.map +1 -0
- package/lib/dist/resolution/frameworks/react.d.ts +2 -1
- package/lib/dist/resolution/frameworks/react.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/react.js +188 -139
- package/lib/dist/resolution/frameworks/react.js.map +1 -1
- package/lib/dist/resolution/frameworks/svelte.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/svelte.js +6 -1
- package/lib/dist/resolution/frameworks/svelte.js.map +1 -1
- package/lib/dist/resolution/frameworks/sveltekit-router.d.ts +36 -0
- package/lib/dist/resolution/frameworks/sveltekit-router.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/sveltekit-router.js +156 -0
- package/lib/dist/resolution/frameworks/sveltekit-router.js.map +1 -0
- package/lib/dist/resolution/frameworks/tanstack-router.d.ts +84 -0
- package/lib/dist/resolution/frameworks/tanstack-router.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/tanstack-router.js +437 -0
- package/lib/dist/resolution/frameworks/tanstack-router.js.map +1 -0
- package/lib/dist/resolution/frameworks/vue-router.d.ts +82 -0
- package/lib/dist/resolution/frameworks/vue-router.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/vue-router.js +377 -0
- package/lib/dist/resolution/frameworks/vue-router.js.map +1 -0
- package/lib/dist/resolution/import-resolver.d.ts +38 -0
- package/lib/dist/resolution/import-resolver.d.ts.map +1 -1
- package/lib/dist/resolution/import-resolver.js +376 -26
- package/lib/dist/resolution/import-resolver.js.map +1 -1
- package/lib/dist/resolution/index.d.ts +89 -25
- package/lib/dist/resolution/index.d.ts.map +1 -1
- package/lib/dist/resolution/index.js +552 -145
- package/lib/dist/resolution/index.js.map +1 -1
- package/lib/dist/resolution/js-builtins.d.ts +13 -0
- package/lib/dist/resolution/js-builtins.d.ts.map +1 -0
- package/lib/dist/resolution/js-builtins.js +46 -0
- package/lib/dist/resolution/js-builtins.js.map +1 -0
- package/lib/dist/resolution/name-matcher.d.ts +69 -22
- package/lib/dist/resolution/name-matcher.d.ts.map +1 -1
- package/lib/dist/resolution/name-matcher.js +1902 -87
- package/lib/dist/resolution/name-matcher.js.map +1 -1
- package/lib/dist/resolution/next-router-synthesizer.d.ts +27 -0
- package/lib/dist/resolution/next-router-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/next-router-synthesizer.js +113 -0
- package/lib/dist/resolution/next-router-synthesizer.js.map +1 -0
- package/lib/dist/resolution/react-router-synthesizer.d.ts +33 -0
- package/lib/dist/resolution/react-router-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/react-router-synthesizer.js +126 -0
- package/lib/dist/resolution/react-router-synthesizer.js.map +1 -0
- package/lib/dist/resolution/resolver-pool.d.ts +2 -0
- package/lib/dist/resolution/resolver-pool.d.ts.map +1 -1
- package/lib/dist/resolution/resolver-pool.js +4 -0
- package/lib/dist/resolution/resolver-pool.js.map +1 -1
- package/lib/dist/resolution/strip-comments.d.ts +6 -0
- package/lib/dist/resolution/strip-comments.d.ts.map +1 -1
- package/lib/dist/resolution/strip-comments.js +58 -0
- package/lib/dist/resolution/strip-comments.js.map +1 -1
- package/lib/dist/resolution/sveltekit-synthesizer.d.ts +58 -0
- package/lib/dist/resolution/sveltekit-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/sveltekit-synthesizer.js +173 -0
- package/lib/dist/resolution/sveltekit-synthesizer.js.map +1 -0
- package/lib/dist/resolution/synth-utils.d.ts +26 -0
- package/lib/dist/resolution/synth-utils.d.ts.map +1 -0
- package/lib/dist/resolution/synth-utils.js +75 -0
- package/lib/dist/resolution/synth-utils.js.map +1 -0
- package/lib/dist/resolution/tanstack-router-synthesizer.d.ts +31 -0
- package/lib/dist/resolution/tanstack-router-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/tanstack-router-synthesizer.js +114 -0
- package/lib/dist/resolution/tanstack-router-synthesizer.js.map +1 -0
- package/lib/dist/resolution/tier-synthesizer.d.ts +49 -0
- package/lib/dist/resolution/tier-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/tier-synthesizer.js +931 -0
- package/lib/dist/resolution/tier-synthesizer.js.map +1 -0
- package/lib/dist/resolution/types.d.ts +78 -2
- package/lib/dist/resolution/types.d.ts.map +1 -1
- package/lib/dist/resolution/types.js +64 -0
- package/lib/dist/resolution/types.js.map +1 -1
- package/lib/dist/resolution/vue-router-synthesizer.d.ts +30 -0
- package/lib/dist/resolution/vue-router-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/vue-router-synthesizer.js +115 -0
- package/lib/dist/resolution/vue-router-synthesizer.js.map +1 -0
- package/lib/dist/search/query-paths.d.ts +50 -1
- package/lib/dist/search/query-paths.d.ts.map +1 -1
- package/lib/dist/search/query-paths.js +227 -12
- package/lib/dist/search/query-paths.js.map +1 -1
- package/lib/dist/search/query-utils.d.ts +15 -0
- package/lib/dist/search/query-utils.d.ts.map +1 -1
- package/lib/dist/search/query-utils.js +35 -7
- package/lib/dist/search/query-utils.js.map +1 -1
- package/lib/dist/sync/watch-policy.d.ts +14 -0
- package/lib/dist/sync/watch-policy.d.ts.map +1 -1
- package/lib/dist/sync/watch-policy.js +19 -0
- package/lib/dist/sync/watch-policy.js.map +1 -1
- package/lib/dist/sync/watcher.d.ts +52 -35
- package/lib/dist/sync/watcher.d.ts.map +1 -1
- package/lib/dist/sync/watcher.js +236 -100
- package/lib/dist/sync/watcher.js.map +1 -1
- package/lib/dist/telemetry/index.d.ts +4 -2
- package/lib/dist/telemetry/index.d.ts.map +1 -1
- package/lib/dist/telemetry/index.js +92 -41
- package/lib/dist/telemetry/index.js.map +1 -1
- package/lib/dist/types.d.ts +1 -1
- package/lib/dist/types.d.ts.map +1 -1
- package/lib/dist/types.js +1 -0
- package/lib/dist/types.js.map +1 -1
- package/lib/dist/ui-server/api/deadcode.d.ts +84 -0
- package/lib/dist/ui-server/api/deadcode.d.ts.map +1 -0
- package/lib/dist/ui-server/api/deadcode.js +136 -0
- package/lib/dist/ui-server/api/deadcode.js.map +1 -0
- package/lib/dist/ui-server/api/effects.d.ts +87 -0
- package/lib/dist/ui-server/api/effects.d.ts.map +1 -0
- package/lib/dist/ui-server/api/effects.js +499 -0
- package/lib/dist/ui-server/api/effects.js.map +1 -0
- package/lib/dist/ui-server/api/entrypoints.d.ts +86 -0
- package/lib/dist/ui-server/api/entrypoints.d.ts.map +1 -0
- package/lib/dist/ui-server/api/entrypoints.js +279 -0
- package/lib/dist/ui-server/api/entrypoints.js.map +1 -0
- package/lib/dist/ui-server/api/events.d.ts +183 -0
- package/lib/dist/ui-server/api/events.d.ts.map +1 -0
- package/lib/dist/ui-server/api/events.js +430 -0
- package/lib/dist/ui-server/api/events.js.map +1 -0
- package/lib/dist/ui-server/api/file.d.ts +66 -0
- package/lib/dist/ui-server/api/file.d.ts.map +1 -0
- package/lib/dist/ui-server/api/file.js +235 -0
- package/lib/dist/ui-server/api/file.js.map +1 -0
- package/lib/dist/ui-server/api/filecode.d.ts +126 -0
- package/lib/dist/ui-server/api/filecode.d.ts.map +1 -0
- package/lib/dist/ui-server/api/filecode.js +205 -0
- package/lib/dist/ui-server/api/filecode.js.map +1 -0
- package/lib/dist/ui-server/api/flow.d.ts +226 -0
- package/lib/dist/ui-server/api/flow.d.ts.map +1 -0
- package/lib/dist/ui-server/api/flow.js +612 -0
- package/lib/dist/ui-server/api/flow.js.map +1 -0
- package/lib/dist/ui-server/api/hierarchy.d.ts +81 -0
- package/lib/dist/ui-server/api/hierarchy.d.ts.map +1 -0
- package/lib/dist/ui-server/api/hierarchy.js +92 -0
- package/lib/dist/ui-server/api/hierarchy.js.map +1 -0
- package/lib/dist/ui-server/api/index.d.ts +90 -0
- package/lib/dist/ui-server/api/index.d.ts.map +1 -0
- package/lib/dist/ui-server/api/index.js +332 -0
- package/lib/dist/ui-server/api/index.js.map +1 -0
- package/lib/dist/ui-server/api/map.d.ts +238 -0
- package/lib/dist/ui-server/api/map.d.ts.map +1 -0
- package/lib/dist/ui-server/api/map.js +681 -0
- package/lib/dist/ui-server/api/map.js.map +1 -0
- package/lib/dist/ui-server/api/node.d.ts +81 -0
- package/lib/dist/ui-server/api/node.d.ts.map +1 -0
- package/lib/dist/ui-server/api/node.js +388 -0
- package/lib/dist/ui-server/api/node.js.map +1 -0
- package/lib/dist/ui-server/api/nodes.d.ts +25 -0
- package/lib/dist/ui-server/api/nodes.d.ts.map +1 -0
- package/lib/dist/ui-server/api/nodes.js +45 -0
- package/lib/dist/ui-server/api/nodes.js.map +1 -0
- package/lib/dist/ui-server/api/program.d.ts +139 -0
- package/lib/dist/ui-server/api/program.d.ts.map +1 -0
- package/lib/dist/ui-server/api/program.js +315 -0
- package/lib/dist/ui-server/api/program.js.map +1 -0
- package/lib/dist/ui-server/api/respond.d.ts +76 -0
- package/lib/dist/ui-server/api/respond.d.ts.map +1 -0
- package/lib/dist/ui-server/api/respond.js +186 -0
- package/lib/dist/ui-server/api/respond.js.map +1 -0
- package/lib/dist/ui-server/api/route-roots.d.ts +39 -0
- package/lib/dist/ui-server/api/route-roots.d.ts.map +1 -0
- package/lib/dist/ui-server/api/route-roots.js +96 -0
- package/lib/dist/ui-server/api/route-roots.js.map +1 -0
- package/lib/dist/ui-server/api/routes.d.ts +59 -0
- package/lib/dist/ui-server/api/routes.d.ts.map +1 -0
- package/lib/dist/ui-server/api/routes.js +108 -0
- package/lib/dist/ui-server/api/routes.js.map +1 -0
- package/lib/dist/ui-server/api/screens.d.ts +117 -0
- package/lib/dist/ui-server/api/screens.d.ts.map +1 -0
- package/lib/dist/ui-server/api/screens.js +611 -0
- package/lib/dist/ui-server/api/screens.js.map +1 -0
- package/lib/dist/ui-server/api/search.d.ts +29 -0
- package/lib/dist/ui-server/api/search.d.ts.map +1 -0
- package/lib/dist/ui-server/api/search.js +232 -0
- package/lib/dist/ui-server/api/search.js.map +1 -0
- package/lib/dist/ui-server/api/session.d.ts +52 -0
- package/lib/dist/ui-server/api/session.d.ts.map +1 -0
- package/lib/dist/ui-server/api/session.js +196 -0
- package/lib/dist/ui-server/api/session.js.map +1 -0
- package/lib/dist/ui-server/api/source.d.ts +200 -0
- package/lib/dist/ui-server/api/source.d.ts.map +1 -0
- package/lib/dist/ui-server/api/source.js +422 -0
- package/lib/dist/ui-server/api/source.js.map +1 -0
- package/lib/dist/ui-server/api/stats.d.ts +27 -0
- package/lib/dist/ui-server/api/stats.d.ts.map +1 -0
- package/lib/dist/ui-server/api/stats.js +164 -0
- package/lib/dist/ui-server/api/stats.js.map +1 -0
- package/lib/dist/ui-server/api/steps.d.ts +274 -0
- package/lib/dist/ui-server/api/steps.d.ts.map +1 -0
- package/lib/dist/ui-server/api/steps.js +1446 -0
- package/lib/dist/ui-server/api/steps.js.map +1 -0
- package/lib/dist/ui-server/api/trail-store.d.ts +142 -0
- package/lib/dist/ui-server/api/trail-store.d.ts.map +1 -0
- package/lib/dist/ui-server/api/trail-store.js +323 -0
- package/lib/dist/ui-server/api/trail-store.js.map +1 -0
- package/lib/dist/ui-server/api/trails.d.ts +163 -0
- package/lib/dist/ui-server/api/trails.d.ts.map +1 -0
- package/lib/dist/ui-server/api/trails.js +369 -0
- package/lib/dist/ui-server/api/trails.js.map +1 -0
- package/lib/dist/ui-server/api/when.d.ts +125 -0
- package/lib/dist/ui-server/api/when.d.ts.map +1 -0
- package/lib/dist/ui-server/api/when.js +251 -0
- package/lib/dist/ui-server/api/when.js.map +1 -0
- package/lib/dist/ui-server/api/wire.d.ts +179 -0
- package/lib/dist/ui-server/api/wire.d.ts.map +1 -0
- package/lib/dist/ui-server/api/wire.js +231 -0
- package/lib/dist/ui-server/api/wire.js.map +1 -0
- package/lib/dist/ui-server/assets.d.ts +40 -0
- package/lib/dist/ui-server/assets.d.ts.map +1 -0
- package/lib/dist/ui-server/assets.js +110 -0
- package/lib/dist/ui-server/assets.js.map +1 -0
- package/lib/dist/ui-server/constants.d.ts +32 -0
- package/lib/dist/ui-server/constants.d.ts.map +1 -0
- package/lib/dist/ui-server/constants.js +35 -0
- package/lib/dist/ui-server/constants.js.map +1 -0
- package/lib/dist/ui-server/highlight/index.d.ts +113 -0
- package/lib/dist/ui-server/highlight/index.d.ts.map +1 -0
- package/lib/dist/ui-server/highlight/index.js +307 -0
- package/lib/dist/ui-server/highlight/index.js.map +1 -0
- package/lib/dist/ui-server/highlight/languages.d.ts +36 -0
- package/lib/dist/ui-server/highlight/languages.d.ts.map +1 -0
- package/lib/dist/ui-server/highlight/languages.js +50 -0
- package/lib/dist/ui-server/highlight/languages.js.map +1 -0
- package/lib/dist/ui-server/index.d.ts +92 -0
- package/lib/dist/ui-server/index.d.ts.map +1 -0
- package/lib/dist/ui-server/index.js +399 -0
- package/lib/dist/ui-server/index.js.map +1 -0
- package/lib/dist/ui-server/open-browser.d.ts +31 -0
- package/lib/dist/ui-server/open-browser.d.ts.map +1 -0
- package/lib/dist/ui-server/open-browser.js +79 -0
- package/lib/dist/ui-server/open-browser.js.map +1 -0
- package/lib/dist/ui-server/security.d.ts +127 -0
- package/lib/dist/ui-server/security.d.ts.map +1 -0
- package/lib/dist/ui-server/security.js +332 -0
- package/lib/dist/ui-server/security.js.map +1 -0
- package/lib/dist/ui-server/static.d.ts +45 -0
- package/lib/dist/ui-server/static.d.ts.map +1 -0
- package/lib/dist/ui-server/static.js +165 -0
- package/lib/dist/ui-server/static.js.map +1 -0
- package/lib/dist/utils.d.ts +14 -2
- package/lib/dist/utils.d.ts.map +1 -1
- package/lib/dist/utils.js +25 -10
- package/lib/dist/utils.js.map +1 -1
- package/lib/dist/viewer/assets/archivo-latin-ext-wght-normal-C4zznr8T.woff2 +0 -0
- package/lib/dist/viewer/assets/archivo-latin-wght-normal-E0tuGl4L.woff2 +0 -0
- package/lib/dist/viewer/assets/archivo-vietnamese-wght-normal-XAtsl5Q_.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-400-italic-2syK4fUT.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-400-italic-CBJ8pzag.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-600-normal-CTOM6hUh.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-600-normal-fLZuRloM.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-italic-B4oTjJdl.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-italic-CBjNughH.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-600-normal-9HEixskS.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-600-normal-V-xxqcpd.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-400-italic-66oory27.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-400-italic-BqAiT5Ww.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-600-normal-BgSNZQsw.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-600-normal-DWFSQ4vo.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-400-italic-B7_fu1kp.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-400-italic-Bg0ZHwF4.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-600-normal-D38SheWl.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-600-normal-DmB0ttJJ.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-400-italic-D6eaYXMU.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-400-italic-DRuN92E5.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-600-normal-D2EvbN8M.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-600-normal-iLQfcSjf.woff +0 -0
- package/lib/dist/viewer/assets/index-CF9yvio6.css +1 -0
- package/lib/dist/viewer/assets/index-D4S7YUPf.js +97 -0
- package/lib/dist/viewer/index.html +16 -0
- package/lib/kernel/codegraph-kernel.node +2 -2
- package/lib/node_modules/.package-lock.json +4 -4
- package/lib/node_modules/picomatch/README.md +56 -51
- package/lib/node_modules/picomatch/lib/constants.js +4 -0
- package/lib/node_modules/picomatch/lib/parse.js +341 -1
- package/lib/node_modules/picomatch/lib/picomatch.js +25 -5
- package/lib/node_modules/picomatch/lib/scan.js +30 -18
- package/lib/node_modules/picomatch/package.json +4 -4
- package/lib/package.json +9 -2
- package/package.json +1 -1
|
@@ -3,10 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.cppExtractor = exports.cExtractor = void 0;
|
|
4
4
|
exports.normalizeCppReturnType = normalizeCppReturnType;
|
|
5
5
|
exports.stripCppTemplateArgs = stripCppTemplateArgs;
|
|
6
|
+
exports.isCppPureVirtualMethodDecl = isCppPureVirtualMethodDecl;
|
|
6
7
|
exports.blankCppExportMacros = blankCppExportMacros;
|
|
7
8
|
exports.blankCppInlineMacros = blankCppInlineMacros;
|
|
8
9
|
exports.recoverMangledCppName = recoverMangledCppName;
|
|
9
10
|
exports.blankMetalAttributes = blankMetalAttributes;
|
|
11
|
+
exports.maskCppRawStrings = maskCppRawStrings;
|
|
10
12
|
exports.blankCppAnnotationMacroCalls = blankCppAnnotationMacroCalls;
|
|
11
13
|
exports.blankLoneMacroLines = blankLoneMacroLines;
|
|
12
14
|
exports.blankCppApiPrefixMacros = blankCppApiPrefixMacros;
|
|
@@ -25,6 +27,8 @@ exports.blankCFileScopePrefixedDeclMacros = blankCFileScopePrefixedDeclMacros;
|
|
|
25
27
|
exports.rewriteCPrefixedDeclMacroInitializers = rewriteCPrefixedDeclMacroInitializers;
|
|
26
28
|
exports.blankCVaArgQualifiedTypeArgs = blankCVaArgQualifiedTypeArgs;
|
|
27
29
|
exports.blankCNamedVariadicDefineDots = blankCNamedVariadicDefineDots;
|
|
30
|
+
exports.blankCDesignatedMacroArgs = blankCDesignatedMacroArgs;
|
|
31
|
+
exports.isCppConstructorDeclaration = isCppConstructorDeclaration;
|
|
28
32
|
const tree_sitter_helpers_1 = require("../tree-sitter-helpers");
|
|
29
33
|
/**
|
|
30
34
|
* Find the function NAME's `qualified_identifier` (`Foo::bar`) inside a
|
|
@@ -51,6 +55,67 @@ function findDeclaratorQualifiedId(declarator) {
|
|
|
51
55
|
}
|
|
52
56
|
return undefined;
|
|
53
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Single-argument macros are ambiguous without their definition (#1373).
|
|
60
|
+
* Require a preceding local #define whose replacement uses its sole parameter
|
|
61
|
+
* as the function declarator; registration, token-pasting, and K&R forms stay
|
|
62
|
+
* untouched. Walk enclosing scopes, but never guess across conditional macros.
|
|
63
|
+
*/
|
|
64
|
+
function recoverSingleArgMacroDefinedName(node, source) {
|
|
65
|
+
if (node.type !== 'function_definition')
|
|
66
|
+
return undefined;
|
|
67
|
+
const declarator = (0, tree_sitter_helpers_1.getChildByField)(node, 'declarator');
|
|
68
|
+
let macro = null;
|
|
69
|
+
let argument = null;
|
|
70
|
+
if (declarator?.type === 'parenthesized_declarator' && declarator.namedChildCount === 1) {
|
|
71
|
+
// C: NATIVE_FN is parsed as the return type, (name) as the declarator.
|
|
72
|
+
macro = (0, tree_sitter_helpers_1.getChildByField)(node, 'type');
|
|
73
|
+
argument = declarator.namedChild(0);
|
|
74
|
+
if (macro?.type !== 'type_identifier' || argument?.type !== 'identifier')
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
else if (declarator?.type === 'function_declarator' && !(0, tree_sitter_helpers_1.getChildByField)(node, 'type')) {
|
|
78
|
+
// C++: NATIVE_FN(name) is parsed as an implicit-return-type function.
|
|
79
|
+
macro = (0, tree_sitter_helpers_1.getChildByField)(declarator, 'declarator');
|
|
80
|
+
const params = (0, tree_sitter_helpers_1.getChildByField)(declarator, 'parameters');
|
|
81
|
+
const param = params?.namedChild(0);
|
|
82
|
+
if (macro?.type !== 'identifier' || params?.namedChildCount !== 1 ||
|
|
83
|
+
param?.type !== 'parameter_declaration' || param.namedChildCount !== 1)
|
|
84
|
+
return undefined;
|
|
85
|
+
argument = param.namedChild(0);
|
|
86
|
+
if (argument?.type !== 'type_identifier')
|
|
87
|
+
return undefined;
|
|
88
|
+
}
|
|
89
|
+
if (!macro || !argument)
|
|
90
|
+
return undefined;
|
|
91
|
+
const macroName = (0, tree_sitter_helpers_1.getNodeText)(macro, source);
|
|
92
|
+
for (let scope = node; scope; scope = scope.parent) {
|
|
93
|
+
if (scope.type === 'preproc_else' || scope.type.startsWith('preproc_elif'))
|
|
94
|
+
return undefined;
|
|
95
|
+
for (let prev = scope.previousNamedSibling; prev; prev = prev.previousNamedSibling) {
|
|
96
|
+
if (prev.type.startsWith('preproc_if'))
|
|
97
|
+
return undefined;
|
|
98
|
+
if (prev.type === 'preproc_call' && (0, tree_sitter_helpers_1.getChildByField)(prev, 'directive')?.text === '#undef' &&
|
|
99
|
+
(0, tree_sitter_helpers_1.getChildByField)(prev, 'argument')?.text.trim() === macroName)
|
|
100
|
+
return undefined;
|
|
101
|
+
if (prev.type !== 'preproc_function_def' && prev.type !== 'preproc_def')
|
|
102
|
+
continue;
|
|
103
|
+
if ((0, tree_sitter_helpers_1.getChildByField)(prev, 'name')?.text !== macroName)
|
|
104
|
+
continue;
|
|
105
|
+
const params = (0, tree_sitter_helpers_1.getChildByField)(prev, 'parameters');
|
|
106
|
+
const param = params?.namedChild(0);
|
|
107
|
+
const value = (0, tree_sitter_helpers_1.getChildByField)(prev, 'value');
|
|
108
|
+
if (params?.namedChildCount !== 1 || param?.type !== 'identifier' || !value)
|
|
109
|
+
return undefined;
|
|
110
|
+
const replacement = (0, tree_sitter_helpers_1.getNodeText)(value, source).replace(/\\\r?\n/g, ' ').trim();
|
|
111
|
+
const match = replacement.match(/^(?:[A-Za-z_][A-Za-z0-9_:]*\s+)+[*&\s]*([A-Za-z_]\w*)\s*\([^(){};#]*\)\s*$/);
|
|
112
|
+
if (!match || /\btypedef\b/.test(replacement) || match[1] !== param.text)
|
|
113
|
+
return undefined;
|
|
114
|
+
return (0, tree_sitter_helpers_1.getNodeText)(argument, source);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return undefined;
|
|
118
|
+
}
|
|
54
119
|
/**
|
|
55
120
|
* Recover the real function name from the macro-definition idiom
|
|
56
121
|
* `MACRO_NAME(real_name, typed args…) { body }` — flash-attention's
|
|
@@ -102,7 +167,7 @@ function recoverCppMacroDefinedName(node, source) {
|
|
|
102
167
|
return name;
|
|
103
168
|
}
|
|
104
169
|
function extractCppQualifiedMethodName(node, source) {
|
|
105
|
-
const macroDefined = recoverCppMacroDefinedName(node, source);
|
|
170
|
+
const macroDefined = recoverSingleArgMacroDefinedName(node, source) ?? recoverCppMacroDefinedName(node, source);
|
|
106
171
|
if (macroDefined)
|
|
107
172
|
return macroDefined;
|
|
108
173
|
const declarator = (0, tree_sitter_helpers_1.getChildByField)(node, 'declarator');
|
|
@@ -208,6 +273,32 @@ function stripCppTemplateArgs(name) {
|
|
|
208
273
|
}
|
|
209
274
|
return out.trim();
|
|
210
275
|
}
|
|
276
|
+
/**
|
|
277
|
+
* Is this C++ `field_declaration` a pure-virtual method (`virtual int read(int key) = 0;`)?
|
|
278
|
+
* tree-sitter-cpp shapes those as a field_declaration whose declarator unwraps to a
|
|
279
|
+
* `function_declarator`, with the pure-virtual `= 0` as a DIRECT `number_literal` "0"
|
|
280
|
+
* child of the field_declaration (default-arg `= 0` lives inside parameter_declaration
|
|
281
|
+
* and must not match). Bodiless method prototypes (`int foo();`) and data members
|
|
282
|
+
* (`int x = 0;`) are excluded — prototypes usually have an out-of-line definition that
|
|
283
|
+
* already mints the method node; pure virtuals never do (#1727).
|
|
284
|
+
*/
|
|
285
|
+
function isCppPureVirtualMethodDecl(node) {
|
|
286
|
+
if (node.type !== 'field_declaration')
|
|
287
|
+
return false;
|
|
288
|
+
let declarator = (0, tree_sitter_helpers_1.getChildByField)(node, 'declarator');
|
|
289
|
+
if (!declarator)
|
|
290
|
+
return false;
|
|
291
|
+
while (declarator.type === 'pointer_declarator' ||
|
|
292
|
+
declarator.type === 'reference_declarator') {
|
|
293
|
+
const inner = (0, tree_sitter_helpers_1.getChildByField)(declarator, 'declarator') || declarator.namedChild(0);
|
|
294
|
+
if (!inner)
|
|
295
|
+
return false;
|
|
296
|
+
declarator = inner;
|
|
297
|
+
}
|
|
298
|
+
if (declarator.type !== 'function_declarator')
|
|
299
|
+
return false;
|
|
300
|
+
return node.namedChildren.some((c) => c.type === 'number_literal' && c.text === '0');
|
|
301
|
+
}
|
|
211
302
|
/**
|
|
212
303
|
* A function/method's return type lives in the `function_definition`'s `type`
|
|
213
304
|
* field (`Metrics& Metrics::instance()` → `Metrics`). Constructors, destructors,
|
|
@@ -220,6 +311,7 @@ function extractCppReturnType(node, source) {
|
|
|
220
311
|
return normalizeCppReturnType((0, tree_sitter_helpers_1.getNodeText)(typeNode, source));
|
|
221
312
|
}
|
|
222
313
|
exports.cExtractor = {
|
|
314
|
+
resolveName: recoverSingleArgMacroDefinedName,
|
|
223
315
|
// CUDA in C-detected headers (content-gated blank; see preParseCSource).
|
|
224
316
|
preParse: preParseCSource,
|
|
225
317
|
// Universal net: recover a real name from any macro-mangled function name.
|
|
@@ -487,6 +579,58 @@ function blankMetalAttributes(source) {
|
|
|
487
579
|
return source;
|
|
488
580
|
return source.replace(METAL_ATTRIBUTE_RE, (m) => ' '.repeat(m.length));
|
|
489
581
|
}
|
|
582
|
+
/**
|
|
583
|
+
* Hide C++ raw literals from the offset-preserving preParse scans (#1505).
|
|
584
|
+
* Neither macro-shaped text in a raw body nor its `)delim"` closer is code.
|
|
585
|
+
* Mask the whole literal with non-whitespace, non-paren tokens, keeping line
|
|
586
|
+
* endings, so even line-based scanners treat a multiline raw argument as opaque.
|
|
587
|
+
* Restore untouched bytes afterward; a real enclosing annotation can still be
|
|
588
|
+
* removed in full. The pipeline masks once, and individual paren blankers also
|
|
589
|
+
* use this helper so they are safe when called directly.
|
|
590
|
+
*/
|
|
591
|
+
function maskCppRawStrings(source) {
|
|
592
|
+
const unchanged = { source, restore: (blanked) => blanked };
|
|
593
|
+
if (source.indexOf('R"') === -1)
|
|
594
|
+
return unchanged;
|
|
595
|
+
// Skip comments and ordinary literals before looking for a raw opener. The
|
|
596
|
+
// char-literal boundary leaves numeric digit separators (1'000) alone.
|
|
597
|
+
const re = /\/\/[^\r\n]*|\/\*[\s\S]*?(?:\*\/|$)|\b(?:u8|[LuU])?R"([^ \t\v\f\r\n()\\]{0,16})\(|"(?:\\[\s\S]|[^"\\])*(?:"|$)|(?<!\w)(?:u8|[LuU])?'(?:\\[\s\S]|[^'\\])*(?:'|$)/g;
|
|
598
|
+
const spans = [];
|
|
599
|
+
const parts = [];
|
|
600
|
+
let last = 0;
|
|
601
|
+
let m;
|
|
602
|
+
while ((m = re.exec(source)) !== null) {
|
|
603
|
+
if (m[1] === undefined)
|
|
604
|
+
continue;
|
|
605
|
+
const closer = `)${m[1]}"`;
|
|
606
|
+
const close = source.indexOf(closer, re.lastIndex);
|
|
607
|
+
// An unterminated raw literal owns the rest of the file too.
|
|
608
|
+
const end = close < 0 ? source.length : close + closer.length;
|
|
609
|
+
spans.push({ start: m.index, end });
|
|
610
|
+
parts.push(source.slice(last, m.index), source.slice(m.index, end).replace(/[^\r\n]/g, '\0'));
|
|
611
|
+
last = re.lastIndex = end;
|
|
612
|
+
}
|
|
613
|
+
if (spans.length === 0)
|
|
614
|
+
return unchanged;
|
|
615
|
+
parts.push(source.slice(last));
|
|
616
|
+
const masked = parts.join('');
|
|
617
|
+
return {
|
|
618
|
+
source: masked,
|
|
619
|
+
restore(blanked) {
|
|
620
|
+
// A length-changing rewrite cannot be restored at the original offsets.
|
|
621
|
+
if (blanked === masked || blanked.length !== source.length)
|
|
622
|
+
return source;
|
|
623
|
+
const chars = blanked.split('');
|
|
624
|
+
for (const { start, end } of spans) {
|
|
625
|
+
for (let i = start; i < end; i++) {
|
|
626
|
+
if (chars[i] === '\0')
|
|
627
|
+
chars[i] = source[i];
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
return chars.join('');
|
|
631
|
+
},
|
|
632
|
+
};
|
|
633
|
+
}
|
|
490
634
|
/**
|
|
491
635
|
* Blank annotation-style macro invocations that decorate a declaration but carry
|
|
492
636
|
* NO terminating semicolon — the pervasive Unreal-Engine reflection markup
|
|
@@ -527,6 +671,8 @@ function blankMetalAttributes(source) {
|
|
|
527
671
|
function blankCppAnnotationMacroCalls(source) {
|
|
528
672
|
if (!/^[ \t]*[A-Z][A-Z0-9_]{2,}\s*\(/m.test(source))
|
|
529
673
|
return source;
|
|
674
|
+
const rawStrings = maskCppRawStrings(source);
|
|
675
|
+
source = rawStrings.source;
|
|
530
676
|
const chars = source.split('');
|
|
531
677
|
const re = /^([ \t]*)([A-Z][A-Z0-9_]{2,})(\s*)\(/gm;
|
|
532
678
|
let m;
|
|
@@ -573,7 +719,7 @@ function blankCppAnnotationMacroCalls(source) {
|
|
|
573
719
|
}
|
|
574
720
|
re.lastIndex = end;
|
|
575
721
|
}
|
|
576
|
-
return chars.join('');
|
|
722
|
+
return rawStrings.restore(chars.join(''));
|
|
577
723
|
}
|
|
578
724
|
/**
|
|
579
725
|
* Blank a macro that is the ONLY token on its line — no parens, no semicolon:
|
|
@@ -693,6 +839,8 @@ const CPP_INLINE_ANNOTATION_RE = /\b(?:UMETA|UPARAM|UE_DEPRECATED\w*)\s*\(/g;
|
|
|
693
839
|
function blankCppInlineAnnotationMacros(source) {
|
|
694
840
|
if (!/\b(?:UMETA|UPARAM|UE_DEPRECATED)/.test(source))
|
|
695
841
|
return source;
|
|
842
|
+
const rawStrings = maskCppRawStrings(source);
|
|
843
|
+
source = rawStrings.source;
|
|
696
844
|
const chars = source.split('');
|
|
697
845
|
const re = new RegExp(CPP_INLINE_ANNOTATION_RE.source, 'g');
|
|
698
846
|
let m;
|
|
@@ -730,7 +878,7 @@ function blankCppInlineAnnotationMacros(source) {
|
|
|
730
878
|
}
|
|
731
879
|
re.lastIndex = end;
|
|
732
880
|
}
|
|
733
|
-
return chars.join('');
|
|
881
|
+
return rawStrings.restore(chars.join(''));
|
|
734
882
|
}
|
|
735
883
|
/**
|
|
736
884
|
* Blank CUDA-specific constructs before parsing `.cu`/`.cuh` files (parsed with
|
|
@@ -842,6 +990,32 @@ function restoreDirectiveLines(original, blanked) {
|
|
|
842
990
|
}
|
|
843
991
|
return changed ? b.join('\n') : blanked;
|
|
844
992
|
}
|
|
993
|
+
/** Recover MSVC's COM alias only at type-definition sites. Match on a lexical
|
|
994
|
+
* mask so comments, literals and directives cannot supply declaration evidence;
|
|
995
|
+
* replace just the keyword, preserving source offsets on both parser arms. */
|
|
996
|
+
function normalizeCppComInterfaces(source) {
|
|
997
|
+
if (!source.includes('interface'))
|
|
998
|
+
return source;
|
|
999
|
+
// Raw strings have already been masked by preParseCppSource.
|
|
1000
|
+
let code = source.replace(/\/\/(?:\\\r?\n|[^\r\n])*|\/\*[\s\S]*?(?:\*\/|$)|"(?:\\[\s\S]|[^"\\])*(?:"|$)|(?<!\w)(?:u8|[LuU])?'(?:\\[\s\S]|[^'\\])*(?:'|$)/g, (m) => m.replace(/[^\r\n]/g, ' '));
|
|
1001
|
+
const hasAlias = /^[ \t]*#[ \t]*define[ \t]+interface[ \t]+struct\b/m.test(code);
|
|
1002
|
+
code = code.replace(/^[ \t]*#(?:\\\r?\n|[^\r\n])*/gm, (m) => m.replace(/[^\r\n]/g, '\0'));
|
|
1003
|
+
const declaration = /(^|[;{}])\s*\binterface\s+[A-Za-z_]\w*\s*(:[^;{}]+)?\{/gm;
|
|
1004
|
+
const offsets = [];
|
|
1005
|
+
let match;
|
|
1006
|
+
while ((match = declaration.exec(code)) !== null) {
|
|
1007
|
+
const bodyEnd = code.indexOf('}', declaration.lastIndex);
|
|
1008
|
+
const hasVirtual = /\bvirtual\b/.test(code.slice(declaration.lastIndex, bodyEnd < 0 ? code.length : bodyEnd));
|
|
1009
|
+
if (!hasAlias && !match[2] && !hasVirtual)
|
|
1010
|
+
continue;
|
|
1011
|
+
offsets.push(match.index + match[0].indexOf('interface'));
|
|
1012
|
+
declaration.lastIndex--; // allow the opening brace to start a nested declaration
|
|
1013
|
+
}
|
|
1014
|
+
for (const offset of offsets) {
|
|
1015
|
+
source = source.slice(0, offset) + 'struct ' + source.slice(offset + 9);
|
|
1016
|
+
}
|
|
1017
|
+
return source;
|
|
1018
|
+
}
|
|
845
1019
|
/** C/C++ source pre-processing before tree-sitter: recover macro-annotated class
|
|
846
1020
|
* definitions, macro-prefixed function definitions, macro-prefixed members, and
|
|
847
1021
|
* macro-decorated members (Unreal-Engine reflection markup) — plus the non-C++
|
|
@@ -850,10 +1024,12 @@ function restoreDirectiveLines(original, blanked) {
|
|
|
850
1024
|
* or by content, for CUDA living in `.h`/`.hpp` headers). Offset-preserving;
|
|
851
1025
|
* directive lines are restored at the end (see restoreDirectiveLines). */
|
|
852
1026
|
function preParseCppSource(source, filePath) {
|
|
1027
|
+
const rawStrings = maskCppRawStrings(source);
|
|
1028
|
+
source = rawStrings.source;
|
|
853
1029
|
// blankCLeadingAttrMacros runs AFTER the api-prefix blank so a stacked
|
|
854
1030
|
// `FMT_NORETURN FMT_API void f(…)` reduces to the `MACRO Ret name(` shape
|
|
855
1031
|
// it matches (the _API token is already spaces by then).
|
|
856
|
-
let blanked = blankLoneMacroLines(blankCLeadingAttrMacros(blankCppAnnotationMacroCalls(blankCppInlineAnnotationMacros(blankCppApiPrefixMacros(blankCppInlineMacros(blankCppExportMacros(source)))))));
|
|
1032
|
+
let blanked = blankLoneMacroLines(blankCLeadingAttrMacros(blankCppAnnotationMacroCalls(blankCppInlineAnnotationMacros(blankCppApiPrefixMacros(blankCppInlineMacros(blankCppExportMacros(normalizeCppComInterfaces(source))))))));
|
|
857
1033
|
const lower = filePath ? filePath.toLowerCase() : '';
|
|
858
1034
|
if (lower.endsWith('.metal')) {
|
|
859
1035
|
blanked = blankMetalAttributes(blanked);
|
|
@@ -861,7 +1037,7 @@ function preParseCppSource(source, filePath) {
|
|
|
861
1037
|
else if (lower.endsWith('.cu') || lower.endsWith('.cuh') || looksLikeCudaSource(source)) {
|
|
862
1038
|
blanked = blankCudaConstructs(blanked);
|
|
863
1039
|
}
|
|
864
|
-
return restoreDirectiveLines(source, blanked);
|
|
1040
|
+
return rawStrings.restore(restoreDirectiveLines(source, blanked));
|
|
865
1041
|
}
|
|
866
1042
|
/**
|
|
867
1043
|
* Blank an unknown attribute macro sitting in front of a C function
|
|
@@ -985,6 +1161,8 @@ const C_STMT_MACRO_KEYWORDS = new Set([
|
|
|
985
1161
|
'if', 'while', 'for', 'switch', 'return', 'do', 'else', 'sizeof',
|
|
986
1162
|
]);
|
|
987
1163
|
function blankCStatementMacroCalls(source) {
|
|
1164
|
+
const rawStrings = maskCppRawStrings(source);
|
|
1165
|
+
source = rawStrings.source;
|
|
988
1166
|
const lines = source.split('\n');
|
|
989
1167
|
let changed = false;
|
|
990
1168
|
const content = (l) => l.replace(/\r$/, '').trim();
|
|
@@ -1101,7 +1279,7 @@ function blankCStatementMacroCalls(source) {
|
|
|
1101
1279
|
}
|
|
1102
1280
|
changed = true;
|
|
1103
1281
|
}
|
|
1104
|
-
return changed ? lines.join('\n') : source;
|
|
1282
|
+
return rawStrings.restore(changed ? lines.join('\n') : source);
|
|
1105
1283
|
}
|
|
1106
1284
|
/**
|
|
1107
1285
|
* Blank a lowercase compiler-annotation word SANDWICHED between a storage
|
|
@@ -1254,9 +1432,8 @@ const C_PARAM_ANNOTATION_RE = new RegExp(`\\b(${[...C_PARAMETERIZED_ANNOTATIONS]
|
|
|
1254
1432
|
function blankCParameterizedAnnotationMacros(source) {
|
|
1255
1433
|
if (source.indexOf('__') === -1)
|
|
1256
1434
|
return source;
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
return source;
|
|
1435
|
+
const rawStrings = maskCppRawStrings(source);
|
|
1436
|
+
source = rawStrings.source;
|
|
1260
1437
|
C_PARAM_ANNOTATION_RE.lastIndex = 0;
|
|
1261
1438
|
let result = '';
|
|
1262
1439
|
let last = 0;
|
|
@@ -1277,7 +1454,7 @@ function blankCParameterizedAnnotationMacros(source) {
|
|
|
1277
1454
|
result += source.slice(last, start) + source.slice(start, end).replace(/[^\n\r]/g, ' ');
|
|
1278
1455
|
last = end;
|
|
1279
1456
|
}
|
|
1280
|
-
return result + source.slice(last);
|
|
1457
|
+
return rawStrings.restore(result + source.slice(last));
|
|
1281
1458
|
}
|
|
1282
1459
|
/**
|
|
1283
1460
|
* Blank a bare `struct`/`union`/`enum` TYPE-keyword argument inside a macro
|
|
@@ -1320,6 +1497,8 @@ const C_TYPE_ARG_SCAN_CAP = 600;
|
|
|
1320
1497
|
function blankCTypeKeywordArgs(source) {
|
|
1321
1498
|
if (!/\b(?:struct|union|enum)[ \t\r\n]/.test(source))
|
|
1322
1499
|
return source;
|
|
1500
|
+
const rawStrings = maskCppRawStrings(source);
|
|
1501
|
+
source = rawStrings.source;
|
|
1323
1502
|
let chars = null;
|
|
1324
1503
|
C_TYPE_ARG_HEAD_RE.lastIndex = 0;
|
|
1325
1504
|
let m;
|
|
@@ -1397,7 +1576,7 @@ function blankCTypeKeywordArgs(source) {
|
|
|
1397
1576
|
atArgStart = false;
|
|
1398
1577
|
}
|
|
1399
1578
|
}
|
|
1400
|
-
return chars ? chars.join('') : source;
|
|
1579
|
+
return rawStrings.restore(chars ? chars.join('') : source);
|
|
1401
1580
|
}
|
|
1402
1581
|
/**
|
|
1403
1582
|
* Blank a file-scope `static`/`extern`-prefixed ALL-CAPS declaration macro —
|
|
@@ -1425,6 +1604,8 @@ const C_PREFIXED_DECL_MACRO_RE = /^[ \t]*(?:static|extern)[ \t]+[A-Z][A-Z0-9_]{2
|
|
|
1425
1604
|
function blankCFileScopePrefixedDeclMacros(source) {
|
|
1426
1605
|
if (!/^[ \t]*(?:static|extern)[ \t]+[A-Z]/m.test(source))
|
|
1427
1606
|
return source;
|
|
1607
|
+
const rawStrings = maskCppRawStrings(source);
|
|
1608
|
+
source = rawStrings.source;
|
|
1428
1609
|
const lines = source.split('\n');
|
|
1429
1610
|
let changed = false;
|
|
1430
1611
|
for (let i = 0; i < lines.length; i++) {
|
|
@@ -1464,7 +1645,7 @@ function blankCFileScopePrefixedDeclMacros(source) {
|
|
|
1464
1645
|
lines[i] = line.replace(/[^\n\r]/g, ' ');
|
|
1465
1646
|
changed = true;
|
|
1466
1647
|
}
|
|
1467
|
-
return changed ? lines.join('\n') : source;
|
|
1648
|
+
return rawStrings.restore(changed ? lines.join('\n') : source);
|
|
1468
1649
|
}
|
|
1469
1650
|
/**
|
|
1470
1651
|
* REWRITE (the one non-blank pass in this family — it moves a token) a
|
|
@@ -1575,14 +1756,84 @@ function blankCNamedVariadicDefineDots(source) {
|
|
|
1575
1756
|
* C-detected headers in CUDA projects (llm.c keeps `__device__` helpers and
|
|
1576
1757
|
* kernel prototypes in plain `.h`) — the same content-gated CUDA blank as
|
|
1577
1758
|
* C++. Offset-preserving. */
|
|
1759
|
+
/**
|
|
1760
|
+
* Blank the argument list of a statement-level `MACRO( … );` call whose
|
|
1761
|
+
* arguments are designated initializers — betaflight's
|
|
1762
|
+
*
|
|
1763
|
+
* RESET_CONFIG(pidProfile_t, pidProfile,
|
|
1764
|
+
* .pid = { [PID_ROLL] = PID_ROLL_DEFAULT, … },
|
|
1765
|
+
* .pidSumLimit = PIDSUM_LIMIT,
|
|
1766
|
+
* …
|
|
1767
|
+
* );
|
|
1768
|
+
*
|
|
1769
|
+
* tree-sitter-c has no rule for `.field = value` as a call argument. Even a
|
|
1770
|
+
* small statement-level `M(a, b, .x = 1, .y = { 1, 2 },);` with a trailing
|
|
1771
|
+
* comma recovers by extending the enclosing `function_definition` to EOF —
|
|
1772
|
+
* the next function vanishes and later ones nest under the first (#1729 —
|
|
1773
|
+
* 310 functions in 73 files on a betaflight tree, which name matching then
|
|
1774
|
+
* treated as unreachable closures). Emptying the argument list to spaces,
|
|
1775
|
+
* newlines kept, leaves `RESET_CONFIG(\n\n…\n);` — a call the grammar parses
|
|
1776
|
+
* cleanly — at the cost of the references inside the initializer, which the
|
|
1777
|
+
* broken parse was not yielding either. Statement-level only (`);` follows),
|
|
1778
|
+
* macro-cased name only, offsets preserved. Runs before the kernel route
|
|
1779
|
+
* point, so both the wasm and kernel C arms see the same bytes.
|
|
1780
|
+
*/
|
|
1781
|
+
function blankCDesignatedMacroArgs(source) {
|
|
1782
|
+
if (source.indexOf('=') === -1)
|
|
1783
|
+
return source;
|
|
1784
|
+
const rawStrings = maskCppRawStrings(source);
|
|
1785
|
+
source = rawStrings.source;
|
|
1786
|
+
const out = source.split('');
|
|
1787
|
+
const re = /^[ \t]*([A-Z_][A-Z0-9_]*)\s*\(/gm;
|
|
1788
|
+
let m;
|
|
1789
|
+
while ((m = re.exec(source))) {
|
|
1790
|
+
const open = m.index + m[0].length - 1;
|
|
1791
|
+
let depth = 1;
|
|
1792
|
+
let i = open + 1;
|
|
1793
|
+
for (; i < source.length && depth > 0; i++) {
|
|
1794
|
+
const c = source[i];
|
|
1795
|
+
if (c === '(')
|
|
1796
|
+
depth++;
|
|
1797
|
+
else if (c === ')')
|
|
1798
|
+
depth--;
|
|
1799
|
+
}
|
|
1800
|
+
if (depth !== 0)
|
|
1801
|
+
continue;
|
|
1802
|
+
const close = i - 1;
|
|
1803
|
+
const args = source.slice(open + 1, close);
|
|
1804
|
+
// A designator at argument depth: `.name =` or `[index] =`.
|
|
1805
|
+
if (!/(^|[,{(\s])(\.[A-Za-z_]\w*|\[[^\]]+\])\s*=[^=]/.test(args))
|
|
1806
|
+
continue;
|
|
1807
|
+
if (!/^\s*;/.test(source.slice(close + 1)))
|
|
1808
|
+
continue;
|
|
1809
|
+
for (let k = open + 1; k < close; k++)
|
|
1810
|
+
if (out[k] !== '\n')
|
|
1811
|
+
out[k] = ' ';
|
|
1812
|
+
re.lastIndex = close;
|
|
1813
|
+
}
|
|
1814
|
+
return rawStrings.restore(out.join(''));
|
|
1815
|
+
}
|
|
1578
1816
|
function preParseCSource(source) {
|
|
1579
|
-
const
|
|
1817
|
+
const rawStrings = maskCppRawStrings(source);
|
|
1818
|
+
source = rawStrings.source;
|
|
1819
|
+
const inner = blankCDesignatedMacroArgs(blankCKernelAnnotations(blankCCplusplusGuardBodies(source)));
|
|
1580
1820
|
let blanked = blankCLeadingAttrMacros(blankLoneMacroLines(blankCStatementMacroCalls(blankCTrailingParamAttrMacros(blankCppAnnotationMacroCalls(rewriteCPrefixedDeclMacroInitializers(blankCFileScopePrefixedDeclMacros(blankCVaArgQualifiedTypeArgs(blankCTypeKeywordArgs(blankCParameterizedAnnotationMacros(blankCAutoInference(blankCSandwichedAnnotations(inner))))))))))));
|
|
1581
1821
|
if (looksLikeCudaSource(blanked))
|
|
1582
1822
|
blanked = blankCudaConstructs(blanked);
|
|
1583
1823
|
// The named-variadic `#define` pass runs AFTER the directive restore — it
|
|
1584
1824
|
// deliberately edits directive lines (see its doc comment).
|
|
1585
|
-
return blankCNamedVariadicDefineDots(restoreDirectiveLines(source, blanked));
|
|
1825
|
+
return rawStrings.restore(blankCNamedVariadicDefineDots(restoreDirectiveLines(source, blanked)));
|
|
1826
|
+
}
|
|
1827
|
+
/** A constructor prototype carries defaults even when its body is in another file. */
|
|
1828
|
+
function isCppConstructorDeclaration(node) {
|
|
1829
|
+
if (node.type !== 'declaration' || (0, tree_sitter_helpers_1.getChildByField)(node, 'type'))
|
|
1830
|
+
return false;
|
|
1831
|
+
const owner = node.parent?.parent;
|
|
1832
|
+
if (!owner || !['class_specifier', 'struct_specifier', 'union_specifier'].includes(owner.type))
|
|
1833
|
+
return false;
|
|
1834
|
+
const declarator = (0, tree_sitter_helpers_1.getChildByField)(node, 'declarator');
|
|
1835
|
+
return declarator?.type === 'function_declarator'
|
|
1836
|
+
&& (0, tree_sitter_helpers_1.getChildByField)(declarator, 'declarator')?.text === (0, tree_sitter_helpers_1.getChildByField)(owner, 'name')?.text;
|
|
1586
1837
|
}
|
|
1587
1838
|
exports.cppExtractor = {
|
|
1588
1839
|
// Recover macro-annotated class/struct definitions (`class MYMODULE_API Foo : Base`,
|
|
@@ -1599,7 +1850,18 @@ exports.cppExtractor = {
|
|
|
1599
1850
|
// get picked as the blast-radius representative over — the single real
|
|
1600
1851
|
// definition, exactly as bodiless struct/enum specifiers are already skipped. (#1093)
|
|
1601
1852
|
skipBodilessClass: true,
|
|
1602
|
-
|
|
1853
|
+
// `function_definition` covers inline / out-of-line bodies; `field_declaration`
|
|
1854
|
+
// covers pure-virtual methods (`virtual int read(int key) = 0;`), which have no
|
|
1855
|
+
// body and would otherwise mint no node — so calls through the abstract base and
|
|
1856
|
+
// cpp-override synthesis had nothing to attach to (#1727). classifyMethodNode
|
|
1857
|
+
// keeps ordinary data members / prototypes on the children-walk path.
|
|
1858
|
+
methodTypes: ['function_definition', 'field_declaration'],
|
|
1859
|
+
classifyMethodNode: (node) => {
|
|
1860
|
+
if (node.type !== 'field_declaration')
|
|
1861
|
+
return 'method';
|
|
1862
|
+
return isCppPureVirtualMethodDecl(node) ? 'method' : 'skip';
|
|
1863
|
+
},
|
|
1864
|
+
isAbstract: (node) => (isCppPureVirtualMethodDecl(node) ? true : undefined),
|
|
1603
1865
|
interfaceTypes: [],
|
|
1604
1866
|
structTypes: ['struct_specifier'],
|
|
1605
1867
|
// C++ unions additionally carry member functions, which extract through the
|
|
@@ -1617,6 +1879,20 @@ exports.cppExtractor = {
|
|
|
1617
1879
|
resolveName: extractCppQualifiedMethodName,
|
|
1618
1880
|
getReceiverType: extractCppReceiverType,
|
|
1619
1881
|
getReturnType: extractCppReturnType,
|
|
1882
|
+
// Constructors (definitions and class-body declarations) carry their
|
|
1883
|
+
// parameter list as the signature; a trailing semicolon marks a prototype, so a local `T obj(args)` can be matched
|
|
1884
|
+
// to the one overload with a compatible arity (#1839). Macro-shaped
|
|
1885
|
+
// definitions whose real name was recovered from an argument are excluded:
|
|
1886
|
+
// their "parameters" are macro arguments. Mirrored in the kernel.
|
|
1887
|
+
getSignature: (node, source) => {
|
|
1888
|
+
if ((node.type !== 'function_definition' && !isCppConstructorDeclaration(node)) || (0, tree_sitter_helpers_1.getChildByField)(node, 'type'))
|
|
1889
|
+
return undefined;
|
|
1890
|
+
if (recoverCppMacroDefinedName(node, source))
|
|
1891
|
+
return undefined;
|
|
1892
|
+
const declarator = (0, tree_sitter_helpers_1.getChildByField)(node, 'declarator');
|
|
1893
|
+
const parameters = declarator && (0, tree_sitter_helpers_1.getChildByField)(declarator, 'parameters');
|
|
1894
|
+
return parameters ? (0, tree_sitter_helpers_1.getNodeText)(parameters, source) + (node.type === 'declaration' ? ';' : '') : undefined;
|
|
1895
|
+
},
|
|
1620
1896
|
getVisibility: (node) => {
|
|
1621
1897
|
// Check for access specifier in parent
|
|
1622
1898
|
const parent = node.parent;
|