@aroman22/codegraph-vba-darwin-arm64 1.5.1 → 1.6.0
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/bin/codegraph.d.ts +1 -1
- package/lib/dist/bin/codegraph.d.ts.map +1 -1
- package/lib/dist/bin/codegraph.js +307 -81
- package/lib/dist/bin/codegraph.js.map +1 -1
- package/lib/dist/bin/command-supervision.d.ts +38 -1
- package/lib/dist/bin/command-supervision.d.ts.map +1 -1
- package/lib/dist/bin/command-supervision.js +22 -3
- package/lib/dist/bin/command-supervision.js.map +1 -1
- package/lib/dist/db/index.d.ts +84 -5
- package/lib/dist/db/index.d.ts.map +1 -1
- package/lib/dist/db/index.js +209 -12
- 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 +80 -3
- package/lib/dist/db/migrations.js.map +1 -1
- package/lib/dist/db/queries.d.ts +127 -4
- package/lib/dist/db/queries.d.ts.map +1 -1
- package/lib/dist/db/queries.js +317 -7
- package/lib/dist/db/queries.js.map +1 -1
- package/lib/dist/db/schema.sql +43 -1
- package/lib/dist/db/wal-valve.d.ts +106 -0
- package/lib/dist/db/wal-valve.d.ts.map +1 -0
- package/lib/dist/db/wal-valve.js +208 -0
- package/lib/dist/db/wal-valve.js.map +1 -0
- package/lib/dist/directory.d.ts +9 -5
- package/lib/dist/directory.d.ts.map +1 -1
- package/lib/dist/directory.js +210 -19
- package/lib/dist/directory.js.map +1 -1
- package/lib/dist/extraction/cfml-extractor.d.ts +107 -0
- package/lib/dist/extraction/cfml-extractor.d.ts.map +1 -0
- package/lib/dist/extraction/cfml-extractor.js +494 -0
- package/lib/dist/extraction/cfml-extractor.js.map +1 -0
- package/lib/dist/extraction/grammars.d.ts +25 -1
- package/lib/dist/extraction/grammars.d.ts.map +1 -1
- package/lib/dist/extraction/grammars.js +177 -23
- package/lib/dist/extraction/grammars.js.map +1 -1
- package/lib/dist/extraction/index.d.ts +47 -2
- package/lib/dist/extraction/index.d.ts.map +1 -1
- package/lib/dist/extraction/index.js +568 -51
- package/lib/dist/extraction/index.js.map +1 -1
- package/lib/dist/extraction/languages/arkts.d.ts +3 -0
- package/lib/dist/extraction/languages/arkts.d.ts.map +1 -0
- package/lib/dist/extraction/languages/arkts.js +127 -0
- package/lib/dist/extraction/languages/arkts.js.map +1 -0
- package/lib/dist/extraction/languages/c-cpp.d.ts +98 -0
- package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -1
- package/lib/dist/extraction/languages/c-cpp.js +563 -1
- package/lib/dist/extraction/languages/c-cpp.js.map +1 -1
- package/lib/dist/extraction/languages/cfquery.d.ts +12 -0
- package/lib/dist/extraction/languages/cfquery.d.ts.map +1 -0
- package/lib/dist/extraction/languages/cfquery.js +28 -0
- package/lib/dist/extraction/languages/cfquery.js.map +1 -0
- package/lib/dist/extraction/languages/cfscript.d.ts +3 -0
- package/lib/dist/extraction/languages/cfscript.d.ts.map +1 -0
- package/lib/dist/extraction/languages/cfscript.js +73 -0
- package/lib/dist/extraction/languages/cfscript.js.map +1 -0
- package/lib/dist/extraction/languages/cobol.d.ts +33 -0
- package/lib/dist/extraction/languages/cobol.d.ts.map +1 -0
- package/lib/dist/extraction/languages/cobol.js +499 -0
- package/lib/dist/extraction/languages/cobol.js.map +1 -0
- package/lib/dist/extraction/languages/erlang.d.ts +3 -0
- package/lib/dist/extraction/languages/erlang.d.ts.map +1 -0
- package/lib/dist/extraction/languages/erlang.js +350 -0
- package/lib/dist/extraction/languages/erlang.js.map +1 -0
- package/lib/dist/extraction/languages/index.d.ts.map +1 -1
- package/lib/dist/extraction/languages/index.js +18 -0
- package/lib/dist/extraction/languages/index.js.map +1 -1
- package/lib/dist/extraction/languages/nix.d.ts +3 -0
- package/lib/dist/extraction/languages/nix.d.ts.map +1 -0
- package/lib/dist/extraction/languages/nix.js +294 -0
- package/lib/dist/extraction/languages/nix.js.map +1 -0
- package/lib/dist/extraction/languages/solidity.d.ts +3 -0
- package/lib/dist/extraction/languages/solidity.d.ts.map +1 -0
- package/lib/dist/extraction/languages/solidity.js +293 -0
- package/lib/dist/extraction/languages/solidity.js.map +1 -0
- package/lib/dist/extraction/languages/terraform.d.ts +3 -0
- package/lib/dist/extraction/languages/terraform.d.ts.map +1 -0
- package/lib/dist/extraction/languages/terraform.js +641 -0
- package/lib/dist/extraction/languages/terraform.js.map +1 -0
- package/lib/dist/extraction/languages/vbnet.d.ts +11 -0
- package/lib/dist/extraction/languages/vbnet.d.ts.map +1 -0
- package/lib/dist/extraction/languages/vbnet.js +141 -0
- package/lib/dist/extraction/languages/vbnet.js.map +1 -0
- package/lib/dist/extraction/mybatis-extractor.d.ts +30 -10
- package/lib/dist/extraction/mybatis-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/mybatis-extractor.js +140 -38
- package/lib/dist/extraction/mybatis-extractor.js.map +1 -1
- package/lib/dist/extraction/parse-pool.d.ts +28 -1
- package/lib/dist/extraction/parse-pool.d.ts.map +1 -1
- package/lib/dist/extraction/parse-pool.js +76 -7
- package/lib/dist/extraction/parse-pool.js.map +1 -1
- package/lib/dist/extraction/parse-worker.js +11 -4
- package/lib/dist/extraction/parse-worker.js.map +1 -1
- package/lib/dist/extraction/tree-sitter-helpers.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter-helpers.js +1 -0
- package/lib/dist/extraction/tree-sitter-helpers.js.map +1 -1
- package/lib/dist/extraction/tree-sitter-types.d.ts +20 -1
- package/lib/dist/extraction/tree-sitter-types.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter.d.ts +60 -1
- package/lib/dist/extraction/tree-sitter.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter.js +905 -20
- package/lib/dist/extraction/tree-sitter.js.map +1 -1
- package/lib/dist/extraction/vba/call-sweep.d.ts +3 -0
- package/lib/dist/extraction/vba/call-sweep.d.ts.map +1 -0
- package/lib/dist/extraction/vba/call-sweep.js +206 -0
- package/lib/dist/extraction/vba/call-sweep.js.map +1 -0
- package/lib/dist/extraction/vba/calls.d.ts +55 -0
- package/lib/dist/extraction/vba/calls.d.ts.map +1 -0
- package/lib/dist/extraction/vba/calls.js +439 -0
- package/lib/dist/extraction/vba/calls.js.map +1 -0
- package/lib/dist/extraction/vba/constants.d.ts +42 -0
- package/lib/dist/extraction/vba/constants.d.ts.map +1 -0
- package/lib/dist/extraction/vba/constants.js +112 -0
- package/lib/dist/extraction/vba/constants.js.map +1 -0
- package/lib/dist/extraction/vba/context.d.ts +175 -0
- package/lib/dist/extraction/vba/context.d.ts.map +1 -0
- package/lib/dist/extraction/vba/context.js +268 -0
- package/lib/dist/extraction/vba/context.js.map +1 -0
- package/lib/dist/extraction/vba/controls.d.ts +24 -0
- package/lib/dist/extraction/vba/controls.d.ts.map +1 -0
- package/lib/dist/extraction/vba/controls.js +89 -0
- package/lib/dist/extraction/vba/controls.js.map +1 -0
- package/lib/dist/extraction/vba/declarations.d.ts +3 -0
- package/lib/dist/extraction/vba/declarations.d.ts.map +1 -0
- package/lib/dist/extraction/vba/declarations.js +154 -0
- package/lib/dist/extraction/vba/declarations.js.map +1 -0
- package/lib/dist/extraction/vba/dims.d.ts +3 -0
- package/lib/dist/extraction/vba/dims.d.ts.map +1 -0
- package/lib/dist/extraction/vba/dims.js +186 -0
- package/lib/dist/extraction/vba/dims.js.map +1 -0
- package/lib/dist/extraction/vba/docmd.d.ts +16 -0
- package/lib/dist/extraction/vba/docmd.d.ts.map +1 -0
- package/lib/dist/extraction/vba/docmd.js +179 -0
- package/lib/dist/extraction/vba/docmd.js.map +1 -0
- package/lib/dist/extraction/vba/enums-consts.d.ts +15 -0
- package/lib/dist/extraction/vba/enums-consts.d.ts.map +1 -0
- package/lib/dist/extraction/vba/enums-consts.js +178 -0
- package/lib/dist/extraction/vba/enums-consts.js.map +1 -0
- package/lib/dist/extraction/vba/implements.d.ts +3 -0
- package/lib/dist/extraction/vba/implements.d.ts.map +1 -0
- package/lib/dist/extraction/vba/implements.js +52 -0
- package/lib/dist/extraction/vba/implements.js.map +1 -0
- package/lib/dist/extraction/vba/procedures.d.ts +3 -0
- package/lib/dist/extraction/vba/procedures.d.ts.map +1 -0
- package/lib/dist/extraction/vba/procedures.js +239 -0
- package/lib/dist/extraction/vba/procedures.js.map +1 -0
- package/lib/dist/extraction/vba/sql-wrapper.d.ts +17 -0
- package/lib/dist/extraction/vba/sql-wrapper.d.ts.map +1 -0
- package/lib/dist/extraction/vba/sql-wrapper.js +212 -0
- package/lib/dist/extraction/vba/sql-wrapper.js.map +1 -0
- package/lib/dist/extraction/vba/tempvars.d.ts +10 -0
- package/lib/dist/extraction/vba/tempvars.d.ts.map +1 -0
- package/lib/dist/extraction/vba/tempvars.js +138 -0
- package/lib/dist/extraction/vba/tempvars.js.map +1 -0
- package/lib/dist/extraction/vba/text-utils.d.ts +73 -0
- package/lib/dist/extraction/vba/text-utils.d.ts.map +1 -0
- package/lib/dist/extraction/vba/text-utils.js +195 -0
- package/lib/dist/extraction/vba/text-utils.js.map +1 -0
- package/lib/dist/extraction/vba-extractor.d.ts +3 -951
- package/lib/dist/extraction/vba-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/vba-extractor.js +46 -2934
- package/lib/dist/extraction/vba-extractor.js.map +1 -1
- package/lib/dist/extraction/vba-preprocess.d.ts +1 -1
- package/lib/dist/extraction/vba-preprocess.d.ts.map +1 -1
- package/lib/dist/extraction/vba-preprocess.js +300 -88
- package/lib/dist/extraction/vba-preprocess.js.map +1 -1
- package/lib/dist/extraction/wasm/tree-sitter-arkts.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-cfml.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-cfquery.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-cfscript.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-cobol.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-erlang.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-nix.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-terraform.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-vbnet.wasm +0 -0
- package/lib/dist/graph/traversal.d.ts.map +1 -1
- package/lib/dist/graph/traversal.js +76 -17
- package/lib/dist/graph/traversal.js.map +1 -1
- package/lib/dist/index.d.ts +81 -1
- package/lib/dist/index.d.ts.map +1 -1
- package/lib/dist/index.js +467 -10
- package/lib/dist/index.js.map +1 -1
- package/lib/dist/installer/index.d.ts +42 -0
- package/lib/dist/installer/index.d.ts.map +1 -1
- package/lib/dist/installer/index.js +97 -2
- package/lib/dist/installer/index.js.map +1 -1
- package/lib/dist/mcp/daemon.d.ts +35 -3
- package/lib/dist/mcp/daemon.d.ts.map +1 -1
- package/lib/dist/mcp/daemon.js +101 -9
- package/lib/dist/mcp/daemon.js.map +1 -1
- package/lib/dist/mcp/dynamic-boundaries.d.ts.map +1 -1
- package/lib/dist/mcp/dynamic-boundaries.js +2 -1
- package/lib/dist/mcp/dynamic-boundaries.js.map +1 -1
- package/lib/dist/mcp/early-ppid.d.ts +26 -0
- package/lib/dist/mcp/early-ppid.d.ts.map +1 -0
- package/lib/dist/mcp/early-ppid.js +29 -0
- package/lib/dist/mcp/early-ppid.js.map +1 -0
- package/lib/dist/mcp/index.d.ts.map +1 -1
- package/lib/dist/mcp/index.js +29 -4
- package/lib/dist/mcp/index.js.map +1 -1
- package/lib/dist/mcp/liveness-watchdog.d.ts +18 -1
- package/lib/dist/mcp/liveness-watchdog.d.ts.map +1 -1
- package/lib/dist/mcp/liveness-watchdog.js +73 -13
- package/lib/dist/mcp/liveness-watchdog.js.map +1 -1
- package/lib/dist/mcp/proxy.d.ts.map +1 -1
- package/lib/dist/mcp/proxy.js +30 -4
- package/lib/dist/mcp/proxy.js.map +1 -1
- package/lib/dist/mcp/query-pool.d.ts +14 -0
- package/lib/dist/mcp/query-pool.d.ts.map +1 -1
- package/lib/dist/mcp/query-pool.js +18 -0
- package/lib/dist/mcp/query-pool.js.map +1 -1
- package/lib/dist/mcp/session.d.ts +14 -0
- package/lib/dist/mcp/session.d.ts.map +1 -1
- package/lib/dist/mcp/session.js +28 -1
- package/lib/dist/mcp/session.js.map +1 -1
- package/lib/dist/mcp/startup-handshake.d.ts +44 -0
- package/lib/dist/mcp/startup-handshake.d.ts.map +1 -0
- package/lib/dist/mcp/startup-handshake.js +73 -0
- package/lib/dist/mcp/startup-handshake.js.map +1 -0
- package/lib/dist/mcp/tools.d.ts +22 -0
- package/lib/dist/mcp/tools.d.ts.map +1 -1
- package/lib/dist/mcp/tools.js +289 -23
- package/lib/dist/mcp/tools.js.map +1 -1
- package/lib/dist/mcp/transport.d.ts.map +1 -1
- package/lib/dist/mcp/transport.js +18 -0
- package/lib/dist/mcp/transport.js.map +1 -1
- package/lib/dist/project-config.d.ts +44 -0
- package/lib/dist/project-config.d.ts.map +1 -1
- package/lib/dist/project-config.js +151 -2
- package/lib/dist/project-config.js.map +1 -1
- package/lib/dist/resolution/c-fnptr-synthesizer.d.ts +2 -1
- package/lib/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -1
- package/lib/dist/resolution/c-fnptr-synthesizer.js +170 -146
- package/lib/dist/resolution/c-fnptr-synthesizer.js.map +1 -1
- package/lib/dist/resolution/callback-synthesizer.d.ts +1 -1
- package/lib/dist/resolution/callback-synthesizer.d.ts.map +1 -1
- package/lib/dist/resolution/callback-synthesizer.js +1109 -97
- package/lib/dist/resolution/callback-synthesizer.js.map +1 -1
- package/lib/dist/resolution/cooperative-yield.d.ts +32 -0
- package/lib/dist/resolution/cooperative-yield.d.ts.map +1 -0
- package/lib/dist/resolution/cooperative-yield.js +42 -0
- package/lib/dist/resolution/cooperative-yield.js.map +1 -0
- package/lib/dist/resolution/frameworks/cics.d.ts +20 -0
- package/lib/dist/resolution/frameworks/cics.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/cics.js +90 -0
- package/lib/dist/resolution/frameworks/cics.js.map +1 -0
- package/lib/dist/resolution/frameworks/index.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/index.js +6 -0
- 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 +14 -6
- package/lib/dist/resolution/frameworks/java.js.map +1 -1
- package/lib/dist/resolution/frameworks/terraform.d.ts +38 -0
- package/lib/dist/resolution/frameworks/terraform.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/terraform.js +277 -0
- package/lib/dist/resolution/frameworks/terraform.js.map +1 -0
- package/lib/dist/resolution/goframe-synthesizer.d.ts +2 -1
- package/lib/dist/resolution/goframe-synthesizer.d.ts.map +1 -1
- package/lib/dist/resolution/goframe-synthesizer.js +8 -3
- package/lib/dist/resolution/goframe-synthesizer.js.map +1 -1
- package/lib/dist/resolution/import-resolver.d.ts +7 -0
- package/lib/dist/resolution/import-resolver.d.ts.map +1 -1
- package/lib/dist/resolution/import-resolver.js +129 -4
- package/lib/dist/resolution/import-resolver.js.map +1 -1
- package/lib/dist/resolution/index.d.ts +85 -2
- package/lib/dist/resolution/index.d.ts.map +1 -1
- package/lib/dist/resolution/index.js +535 -58
- package/lib/dist/resolution/index.js.map +1 -1
- package/lib/dist/resolution/name-matcher.d.ts +22 -3
- package/lib/dist/resolution/name-matcher.d.ts.map +1 -1
- package/lib/dist/resolution/name-matcher.js +613 -39
- package/lib/dist/resolution/name-matcher.js.map +1 -1
- package/lib/dist/resolution/strip-comments.d.ts +1 -1
- package/lib/dist/resolution/strip-comments.d.ts.map +1 -1
- package/lib/dist/resolution/strip-comments.js +49 -0
- package/lib/dist/resolution/strip-comments.js.map +1 -1
- package/lib/dist/resolution/types.d.ts +29 -0
- package/lib/dist/resolution/types.d.ts.map +1 -1
- package/lib/dist/resolution/workspace-packages.d.ts +10 -0
- package/lib/dist/resolution/workspace-packages.d.ts.map +1 -1
- package/lib/dist/resolution/workspace-packages.js +142 -4
- package/lib/dist/resolution/workspace-packages.js.map +1 -1
- package/lib/dist/search/identifier-segments.d.ts +60 -0
- package/lib/dist/search/identifier-segments.d.ts.map +1 -0
- package/lib/dist/search/identifier-segments.js +176 -0
- package/lib/dist/search/identifier-segments.js.map +1 -0
- package/lib/dist/sync/git-hooks.d.ts.map +1 -1
- package/lib/dist/sync/git-hooks.js +2 -0
- package/lib/dist/sync/git-hooks.js.map +1 -1
- package/lib/dist/sync/watcher.d.ts +10 -5
- package/lib/dist/sync/watcher.d.ts.map +1 -1
- package/lib/dist/sync/watcher.js +51 -14
- package/lib/dist/sync/watcher.js.map +1 -1
- package/lib/dist/sync/worktree.d.ts +9 -0
- package/lib/dist/sync/worktree.d.ts.map +1 -1
- package/lib/dist/sync/worktree.js +45 -0
- package/lib/dist/sync/worktree.js.map +1 -1
- package/lib/dist/types.d.ts +25 -2
- package/lib/dist/types.d.ts.map +1 -1
- package/lib/dist/types.js +10 -0
- package/lib/dist/types.js.map +1 -1
- package/lib/dist/upgrade/index.d.ts +32 -0
- package/lib/dist/upgrade/index.d.ts.map +1 -1
- package/lib/dist/upgrade/index.js +163 -14
- package/lib/dist/upgrade/index.js.map +1 -1
- package/lib/dist/upgrade/remove-binary.d.ts +87 -0
- package/lib/dist/upgrade/remove-binary.d.ts.map +1 -0
- package/lib/dist/upgrade/remove-binary.js +289 -0
- package/lib/dist/upgrade/remove-binary.js.map +1 -0
- package/lib/dist/upgrade/update-check.d.ts +92 -0
- package/lib/dist/upgrade/update-check.d.ts.map +1 -0
- package/lib/dist/upgrade/update-check.js +258 -0
- package/lib/dist/upgrade/update-check.js.map +1 -0
- package/lib/node_modules/.modules.yaml +1 -1
- package/lib/node_modules/.pnpm-workspace-state-v1.json +1 -1
- package/lib/package.json +1 -1
- package/package.json +1 -1
- package/lib/dist/reasoning/config.d.ts +0 -45
- package/lib/dist/reasoning/config.d.ts.map +0 -1
- package/lib/dist/reasoning/config.js +0 -171
- package/lib/dist/reasoning/config.js.map +0 -1
- package/lib/dist/reasoning/credentials.d.ts +0 -5
- package/lib/dist/reasoning/credentials.d.ts.map +0 -1
- package/lib/dist/reasoning/credentials.js +0 -83
- package/lib/dist/reasoning/credentials.js.map +0 -1
- package/lib/dist/reasoning/login.d.ts +0 -21
- package/lib/dist/reasoning/login.d.ts.map +0 -1
- package/lib/dist/reasoning/login.js +0 -85
- package/lib/dist/reasoning/login.js.map +0 -1
- package/lib/dist/reasoning/reasoner.d.ts +0 -43
- package/lib/dist/reasoning/reasoner.d.ts.map +0 -1
- package/lib/dist/reasoning/reasoner.js +0 -308
- package/lib/dist/reasoning/reasoner.js.map +0 -1
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sweepEnumsAndConsts = sweepEnumsAndConsts;
|
|
4
|
+
/**
|
|
5
|
+
* Enum / Const sweep (REQ-CODE-12, REQ-CODE-13). Emits `enum` + `enum_member`
|
|
6
|
+
* nodes and module-level `constant` nodes, while tracking proc scope so
|
|
7
|
+
* proc-local Consts populate the per-scope resolution bucket (issue #52)
|
|
8
|
+
* without emitting a spurious module-level `constant` node.
|
|
9
|
+
*/
|
|
10
|
+
const tree_sitter_helpers_1 = require("../tree-sitter-helpers");
|
|
11
|
+
const constants_1 = require("./constants");
|
|
12
|
+
const text_utils_1 = require("./text-utils");
|
|
13
|
+
/** `[visibility] Enum <Name>` — opens an enum block. */
|
|
14
|
+
const ENUM_START_RE = /^\s*(?:(Public|Private|Friend|Global)\s+)?Enum\s+(\p{L}[\p{L}\p{N}_]*)/iu;
|
|
15
|
+
/** `End Enum` — closes the current enum block. */
|
|
16
|
+
const ENUM_END_RE = /^\s*End\s+Enum\b/i;
|
|
17
|
+
/**
|
|
18
|
+
* An enum member line: a leading identifier optionally followed by `=
|
|
19
|
+
* <value>`. Runs only inside an open Enum block, on the (already
|
|
20
|
+
* comment-stripped) source, so a trailing `'comment` never reaches here.
|
|
21
|
+
* `\p{L}` covers accented member names (e.g. `Sí`).
|
|
22
|
+
*/
|
|
23
|
+
const ENUM_MEMBER_RE = /^\s*(\p{L}[\p{L}\p{N}_]*)\s*(?:=|$)/u;
|
|
24
|
+
/** `[visibility] Const <decls>` — captures visibility (1) and the rest (2). */
|
|
25
|
+
const CONST_DECL_RE = /^\s*(?:(Public|Private|Friend|Global)\s+)?Const\s+(.+)$/i;
|
|
26
|
+
/**
|
|
27
|
+
* Walk the (uncommented, line-joined) source and emit:
|
|
28
|
+
* - one `enum` node per `Enum <Name>` block, with one `enum_member` node
|
|
29
|
+
* per member and a `contains` edge enum→member;
|
|
30
|
+
* - one `constant` node per name declared on a `Const` line (multi-name
|
|
31
|
+
* lines emit one node per name);
|
|
32
|
+
* - a `contains` edge from the module/class node to each enum and constant
|
|
33
|
+
* (held in `pendingModuleOrClassSource` until the module node exists).
|
|
34
|
+
*
|
|
35
|
+
* Returns the number of top-level symbols (enums + constants) emitted so
|
|
36
|
+
* the caller can flip `hasAnySymbols`.
|
|
37
|
+
*/
|
|
38
|
+
function sweepEnumsAndConsts(ctx, src) {
|
|
39
|
+
const lines = src.split('\n');
|
|
40
|
+
let count = 0;
|
|
41
|
+
let currentEnum = null;
|
|
42
|
+
// Issue #52: reset the shared scope stack + lookup key so leftover
|
|
43
|
+
// state from a previous extract() (impossible in production but
|
|
44
|
+
// possible in unit tests that construct a fresh extractor and run
|
|
45
|
+
// twice) never leaks across sweeps. The walk below updates both
|
|
46
|
+
// every iteration; `sweepCallsAndSql` resets again at its own
|
|
47
|
+
// start, before any OpenForm/OpenQuery reader consults them.
|
|
48
|
+
ctx.procStack.length = 0;
|
|
49
|
+
ctx.currentProcKey = 'module';
|
|
50
|
+
for (let i = 0; i < lines.length; i++) {
|
|
51
|
+
const line = lines[i] ?? '';
|
|
52
|
+
const lineNum = i + 1;
|
|
53
|
+
// Issue #52: track proc scope so Const declarations on this line
|
|
54
|
+
// can decide whether they belong to the module (currentProcKey
|
|
55
|
+
// === 'module') or to the top-most procedure (write the per-proc
|
|
56
|
+
// bucket, skip the module-level `constant` node emission).
|
|
57
|
+
//
|
|
58
|
+
// PROC_RE cannot overlap with CONST_DECL_RE on the same physical
|
|
59
|
+
// line (different leading keywords), so it is safe to advance the
|
|
60
|
+
// stack here and then fall through to the rest of the body.
|
|
61
|
+
const procStart = constants_1.PROC_RE.exec(line);
|
|
62
|
+
if (procStart) {
|
|
63
|
+
ctx.procStack.push(lineNum);
|
|
64
|
+
ctx.currentProcKey = String(lineNum);
|
|
65
|
+
}
|
|
66
|
+
else if (constants_1.PROCEDURE_END_RE.test(line) && ctx.procStack.length > 0) {
|
|
67
|
+
ctx.procStack.pop();
|
|
68
|
+
ctx.currentProcKey =
|
|
69
|
+
ctx.procStack.length > 0
|
|
70
|
+
? String(ctx.procStack[ctx.procStack.length - 1])
|
|
71
|
+
: 'module';
|
|
72
|
+
}
|
|
73
|
+
if (currentEnum) {
|
|
74
|
+
if (ENUM_END_RE.test(line)) {
|
|
75
|
+
currentEnum = null;
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
const mm = ENUM_MEMBER_RE.exec(line);
|
|
79
|
+
if (mm) {
|
|
80
|
+
const memberName = mm[1] ?? '';
|
|
81
|
+
if (memberName) {
|
|
82
|
+
const memberId = (0, tree_sitter_helpers_1.generateNodeId)(ctx.filePath, 'enum_member', memberName, lineNum);
|
|
83
|
+
ctx.nodes.push({
|
|
84
|
+
id: memberId,
|
|
85
|
+
kind: 'enum_member',
|
|
86
|
+
name: memberName,
|
|
87
|
+
qualifiedName: `${currentEnum.name}.${memberName}`,
|
|
88
|
+
filePath: ctx.filePath,
|
|
89
|
+
language: 'vba',
|
|
90
|
+
startLine: lineNum,
|
|
91
|
+
endLine: lineNum,
|
|
92
|
+
startColumn: 0,
|
|
93
|
+
endColumn: line.length,
|
|
94
|
+
updatedAt: Date.now(),
|
|
95
|
+
});
|
|
96
|
+
// enum → member: source is known, emit directly (not pending).
|
|
97
|
+
ctx.edges.push({
|
|
98
|
+
source: currentEnum.id,
|
|
99
|
+
target: memberId,
|
|
100
|
+
kind: 'contains',
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
const enumStart = ENUM_START_RE.exec(line);
|
|
107
|
+
if (enumStart) {
|
|
108
|
+
const visibility = (0, text_utils_1.foldVisibility)(enumStart[1] ?? '');
|
|
109
|
+
const name = enumStart[2] ?? '';
|
|
110
|
+
if (!name)
|
|
111
|
+
continue;
|
|
112
|
+
const enumId = (0, tree_sitter_helpers_1.generateNodeId)(ctx.filePath, 'enum', name, lineNum);
|
|
113
|
+
ctx.nodes.push({
|
|
114
|
+
id: enumId,
|
|
115
|
+
kind: 'enum',
|
|
116
|
+
name,
|
|
117
|
+
qualifiedName: name,
|
|
118
|
+
filePath: ctx.filePath,
|
|
119
|
+
language: 'vba',
|
|
120
|
+
startLine: lineNum,
|
|
121
|
+
endLine: lineNum,
|
|
122
|
+
startColumn: 0,
|
|
123
|
+
endColumn: line.length,
|
|
124
|
+
visibility,
|
|
125
|
+
updatedAt: Date.now(),
|
|
126
|
+
});
|
|
127
|
+
ctx.pushContainsFromModule(enumId);
|
|
128
|
+
currentEnum = { id: enumId, name };
|
|
129
|
+
count++;
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
const constDecl = CONST_DECL_RE.exec(line);
|
|
133
|
+
if (constDecl) {
|
|
134
|
+
const visibility = (0, text_utils_1.foldVisibility)(constDecl[1] ?? '');
|
|
135
|
+
const body = constDecl[2] ?? '';
|
|
136
|
+
const declarations = (0, text_utils_1.parseConstDeclarations)(body);
|
|
137
|
+
for (const declaration of declarations) {
|
|
138
|
+
const constName = declaration.name;
|
|
139
|
+
if (!constName)
|
|
140
|
+
continue;
|
|
141
|
+
// Issue #52: every Const line (module-level or proc-local)
|
|
142
|
+
// writes into a per-scope resolution bucket so
|
|
143
|
+
// `DoCmd.OpenForm FORM_X` later resolves correctly; module-level
|
|
144
|
+
// Consts additionally emit a `constant` graph node + the
|
|
145
|
+
// module→constant `contains` edge. Proc-local Consts skip both
|
|
146
|
+
// (the const is not a module symbol, so the wrong-containment
|
|
147
|
+
// node + edge the pre-fix code emitted are gone), but the
|
|
148
|
+
// per-proc bucket keeps OpenForm/OpenQuery argument
|
|
149
|
+
// resolution working exactly as before.
|
|
150
|
+
if (declaration.value !== null) {
|
|
151
|
+
ctx.setLocalConstInScope(ctx.currentProcKey, constName, declaration.value);
|
|
152
|
+
}
|
|
153
|
+
if (ctx.procStack.length > 0)
|
|
154
|
+
continue;
|
|
155
|
+
const constId = (0, tree_sitter_helpers_1.generateNodeId)(ctx.filePath, 'constant', constName, lineNum);
|
|
156
|
+
ctx.nodes.push({
|
|
157
|
+
id: constId,
|
|
158
|
+
kind: 'constant',
|
|
159
|
+
name: constName,
|
|
160
|
+
qualifiedName: constName,
|
|
161
|
+
filePath: ctx.filePath,
|
|
162
|
+
language: 'vba',
|
|
163
|
+
startLine: lineNum,
|
|
164
|
+
endLine: lineNum,
|
|
165
|
+
startColumn: 0,
|
|
166
|
+
endColumn: line.length,
|
|
167
|
+
visibility,
|
|
168
|
+
metadata: declaration.value !== null ? { value: declaration.value } : undefined,
|
|
169
|
+
updatedAt: Date.now(),
|
|
170
|
+
});
|
|
171
|
+
ctx.pushContainsFromModule(constId);
|
|
172
|
+
count++;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return count;
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=enums-consts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enums-consts.js","sourceRoot":"","sources":["../../../src/extraction/vba/enums-consts.ts"],"names":[],"mappings":";;AA0CA,kDAuJC;AAjMD;;;;;GAKG;AACH,gEAAwD;AACxD,2CAAwD;AACxD,6CAAsE;AAGtE,wDAAwD;AACxD,MAAM,aAAa,GACj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EAAE,CAAC,CAAC,CAAC,SAAS;oBAC/E,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;iBACtB,CAAC,CAAC;gBACH,GAAG,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;gBACpC,KAAK,EAAE,CAAC;YACV,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"implements.d.ts","sourceRoot":"","sources":["../../../src/extraction/vba/implements.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAKhD,wBAAgB,eAAe,CAAC,GAAG,EAAE,mBAAmB,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CA+C7E"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sweepImplements = sweepImplements;
|
|
4
|
+
const tree_sitter_helpers_1 = require("../tree-sitter-helpers");
|
|
5
|
+
/** Implements regex. */
|
|
6
|
+
const IMPLEMENTS_RE = /^\s*Implements\s+(\p{L}[\p{L}\p{N}_]*)/iu;
|
|
7
|
+
function sweepImplements(ctx, src) {
|
|
8
|
+
const lines = src.split('\n');
|
|
9
|
+
let count = 0;
|
|
10
|
+
for (let i = 0; i < lines.length; i++) {
|
|
11
|
+
const line = lines[i] ?? '';
|
|
12
|
+
const m = IMPLEMENTS_RE.exec(line);
|
|
13
|
+
if (!m)
|
|
14
|
+
continue;
|
|
15
|
+
const name = m[1] ?? '';
|
|
16
|
+
if (!name)
|
|
17
|
+
continue;
|
|
18
|
+
const lineNum = i + 1;
|
|
19
|
+
const targetId = (0, tree_sitter_helpers_1.generateNodeId)(ctx.filePath, 'interface', name, lineNum);
|
|
20
|
+
ctx.nodes.push({
|
|
21
|
+
id: targetId,
|
|
22
|
+
kind: 'interface',
|
|
23
|
+
name,
|
|
24
|
+
qualifiedName: name,
|
|
25
|
+
filePath: ctx.filePath,
|
|
26
|
+
language: 'vba',
|
|
27
|
+
startLine: lineNum,
|
|
28
|
+
endLine: lineNum,
|
|
29
|
+
startColumn: 0,
|
|
30
|
+
endColumn: line.length,
|
|
31
|
+
updatedAt: Date.now(),
|
|
32
|
+
});
|
|
33
|
+
const edge = {
|
|
34
|
+
source: '', // placeholder; rewritten after module node exists
|
|
35
|
+
target: targetId,
|
|
36
|
+
kind: 'implements',
|
|
37
|
+
// S4 fix: `Implements IFoo` is a static, source-declared fact —
|
|
38
|
+
// not a guess. Use the `parser` provenance (generalizes
|
|
39
|
+
// `tree-sitter` for non-tree-sitter extractors like our regex
|
|
40
|
+
// sweepers) instead of `heuristic`, which is reserved for
|
|
41
|
+
// guessed/inferred edges.
|
|
42
|
+
provenance: 'parser',
|
|
43
|
+
line: lineNum,
|
|
44
|
+
column: 0,
|
|
45
|
+
};
|
|
46
|
+
ctx.edges.push(edge);
|
|
47
|
+
ctx.pendingModuleOrClassSource.push(edge);
|
|
48
|
+
count++;
|
|
49
|
+
}
|
|
50
|
+
return count;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=implements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"implements.js","sourceRoot":"","sources":["../../../src/extraction/vba/implements.ts"],"names":[],"mappings":";;AAYA,0CA+CC;AArDD,gEAAwD;AAGxD,wBAAwB;AACxB,MAAM,aAAa,GAAG,0CAA0C,CAAC;AAEjE,SAAgB,eAAe,CAAC,GAAwB,EAAE,GAAW;IACnE,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,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{"version":3,"file":"procedures.d.ts","sourceRoot":"","sources":["../../../src/extraction/vba/procedures.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1D,wBAAgB,eAAe,CAAC,GAAG,EAAE,mBAAmB,EAAE,GAAG,EAAE,MAAM,GAAG,QAAQ,EAAE,CAqMjF"}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.sweepProcedures = sweepProcedures;
|
|
37
|
+
/**
|
|
38
|
+
* Procedure sweep: emit one `function` node per `Sub` / `Function` /
|
|
39
|
+
* `Property Get|Let|Set` declaration, record each proc in `localProcs` for
|
|
40
|
+
* same-file call resolution, and synthesize the Access `<Control>_<Event>`
|
|
41
|
+
* event-handler edge for form/report code-behind classes (hueco 3 / issue #41).
|
|
42
|
+
*/
|
|
43
|
+
const path = __importStar(require("path"));
|
|
44
|
+
const tree_sitter_helpers_1 = require("../tree-sitter-helpers");
|
|
45
|
+
const constants_1 = require("./constants");
|
|
46
|
+
const text_utils_1 = require("./text-utils");
|
|
47
|
+
function sweepProcedures(ctx, src) {
|
|
48
|
+
const procs = [];
|
|
49
|
+
const lines = src.split('\n');
|
|
50
|
+
for (let i = 0; i < lines.length; i++) {
|
|
51
|
+
const line = lines[i] ?? '';
|
|
52
|
+
const m = constants_1.PROC_RE.exec(line);
|
|
53
|
+
if (!m)
|
|
54
|
+
continue;
|
|
55
|
+
const visibilityRaw = (m[1] ?? '').trim();
|
|
56
|
+
const kindRaw = (m[2] ?? '').trim().toLowerCase();
|
|
57
|
+
const name = m[3] ?? '';
|
|
58
|
+
if (!name)
|
|
59
|
+
continue;
|
|
60
|
+
const lineNum = i + 1;
|
|
61
|
+
// Normalize the visibility. VBA's "Static" keyword is a storage
|
|
62
|
+
// specifier, not visibility, so we treat bare-static declarations as
|
|
63
|
+
// 'Public' (the default) per spec R1. "Friend" is not in the Node
|
|
64
|
+
// visibility enum; treat it as 'Public' since it's the closest
|
|
65
|
+
// broader-than-private modifier.
|
|
66
|
+
let visibility;
|
|
67
|
+
switch (visibilityRaw.toLowerCase()) {
|
|
68
|
+
case 'private':
|
|
69
|
+
visibility = 'private';
|
|
70
|
+
break;
|
|
71
|
+
case 'public':
|
|
72
|
+
case 'static':
|
|
73
|
+
case 'friend':
|
|
74
|
+
case '':
|
|
75
|
+
default:
|
|
76
|
+
visibility = 'public';
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
const kind = kindRaw.startsWith('sub')
|
|
80
|
+
? 'sub'
|
|
81
|
+
: kindRaw.startsWith('function')
|
|
82
|
+
? 'function'
|
|
83
|
+
: 'property';
|
|
84
|
+
const proc = {
|
|
85
|
+
name,
|
|
86
|
+
// B3 (hueco 5): when this file is a `.cls`, prefix the
|
|
87
|
+
// qualifiedName with the resolved class name so cross-class
|
|
88
|
+
// queries (e.g. `Form_Load`) match only the owning class.
|
|
89
|
+
// `.bas` files leave `qualifiedName === name`.
|
|
90
|
+
qualifiedName: ctx.classNamePrefix
|
|
91
|
+
? `${ctx.classNamePrefix}.${name}`
|
|
92
|
+
: name,
|
|
93
|
+
kind,
|
|
94
|
+
visibility,
|
|
95
|
+
startLine: lineNum,
|
|
96
|
+
};
|
|
97
|
+
procs.push(proc);
|
|
98
|
+
const bucket = ctx.localProcs.get(name);
|
|
99
|
+
if (bucket)
|
|
100
|
+
bucket.push(proc);
|
|
101
|
+
else
|
|
102
|
+
ctx.localProcs.set(name, [proc]);
|
|
103
|
+
const nodeId = (0, tree_sitter_helpers_1.generateNodeId)(ctx.filePath, 'function', name, lineNum);
|
|
104
|
+
const fnNode = {
|
|
105
|
+
id: nodeId,
|
|
106
|
+
kind: 'function',
|
|
107
|
+
name,
|
|
108
|
+
// B3 (hueco 5): same prefix rule as the ProcInfo above — class
|
|
109
|
+
// methods get `${className}.${name}`, module-level Subs keep
|
|
110
|
+
// their bare name.
|
|
111
|
+
qualifiedName: ctx.classNamePrefix
|
|
112
|
+
? `${ctx.classNamePrefix}.${name}`
|
|
113
|
+
: name,
|
|
114
|
+
filePath: ctx.filePath,
|
|
115
|
+
language: 'vba',
|
|
116
|
+
startLine: lineNum,
|
|
117
|
+
endLine: lineNum,
|
|
118
|
+
startColumn: 0,
|
|
119
|
+
endColumn: line.length,
|
|
120
|
+
visibility,
|
|
121
|
+
updatedAt: Date.now(),
|
|
122
|
+
};
|
|
123
|
+
ctx.nodes.push(fnNode);
|
|
124
|
+
// Cache the first node emitted for this name — `findFunctionNodeByName`
|
|
125
|
+
// (audit S2) becomes O(1) instead of O(n) per call site.
|
|
126
|
+
if (!ctx.functionNodeByName.has(name)) {
|
|
127
|
+
ctx.functionNodeByName.set(name, fnNode);
|
|
128
|
+
}
|
|
129
|
+
// Fix 1: also index by startLine so Property Get/Let/Set with the same
|
|
130
|
+
// name can each be found by their exact declaration line.
|
|
131
|
+
ctx.functionNodeByStartLine.set(lineNum, fnNode);
|
|
132
|
+
// Hueco 3: synthesize the event-handler edge for Access naming
|
|
133
|
+
// convention `<ControlName>_<EventName>` (e.g. `ComandoAltaPM_Click`,
|
|
134
|
+
// `MotivoBorrado_AfterUpdate`). The `<X>_<Y>` shape is split on the
|
|
135
|
+
// LAST underscore so multi-word events like `BeforeDelConfirm` parse
|
|
136
|
+
// correctly. Form-level events (`Form_Load`, `Form_Open`,
|
|
137
|
+
// `Form_Unload`, …) are NOT control handlers — they fire on the
|
|
138
|
+
// form object itself, not on a control — so they are skipped here
|
|
139
|
+
// (the form module node is the conceptual source for those).
|
|
140
|
+
//
|
|
141
|
+
// Scope guard: only emit when this .cls looks like a form code-
|
|
142
|
+
// behind (`Form_*.cls`). Without this guard, regular service classes
|
|
143
|
+
// whose methods happen to have underscores in their names
|
|
144
|
+
// (e.g. `InformeRiesgoPDFServicio.cls` declares
|
|
145
|
+
// `GenerarHTML_Principal`, `GetEstilosCSS_PDF`,
|
|
146
|
+
// `Class_Initialize`) would synthesize ~550 spurious
|
|
147
|
+
// `form-instance-control` stubs in real Dysflow projects. The
|
|
148
|
+
// `Form_` prefix is the canonical Access code-behind naming
|
|
149
|
+
// convention and matches the .form.txt siblings' basename.
|
|
150
|
+
//
|
|
151
|
+
// Cross-file synthesis caveat: the edge's source is a
|
|
152
|
+
// `form-instance-control` node that lives in the sibling .form.txt,
|
|
153
|
+
// not this .cls file. Two consequences:
|
|
154
|
+
// 1. We also emit a STUB form-instance-control node locally with
|
|
155
|
+
// the deterministic id so the per-file edge filter
|
|
156
|
+
// (`insertedIds.has(source)`) accepts the edge. When the
|
|
157
|
+
// sibling .form.txt is later indexed, VbaFormExtractor emits
|
|
158
|
+
// the real form-instance-control node with the same id; the
|
|
159
|
+
// `INSERT OR REPLACE` semantics in queries.ts:insertNode
|
|
160
|
+
// overwrite the stub with the real one (preserving the
|
|
161
|
+
// metadata.controlType, filePath, line range, etc.).
|
|
162
|
+
// 2. When the .form.txt is processed FIRST (alphabetically
|
|
163
|
+
// unlikely but possible), the real node exists in the DB
|
|
164
|
+
// before this edge is committed; insertEdges's DB-level
|
|
165
|
+
// endpoint check passes the edge naturally without the stub.
|
|
166
|
+
// Either order converges on the same final state.
|
|
167
|
+
// See vba-form-extractor.ts:findControlName for the matching real
|
|
168
|
+
// form-instance-control node emission.
|
|
169
|
+
const handler = (0, text_utils_1.parseEventHandlerName)(name);
|
|
170
|
+
// Prefix-driven sibling binding (issue #41). Both `Form_*.cls` and
|
|
171
|
+
// `Report_*.cls` Dysflow code-behind files share the same code path;
|
|
172
|
+
// only the sibling extension differs (`.form.txt` vs `.report.txt`).
|
|
173
|
+
// The check is on the BASENAME prefix so a class called
|
|
174
|
+
// `FormularioVentas.cls` or `ReportingHelper.cls` (no trailing
|
|
175
|
+
// underscore) does not match — the trailing `_` is the discriminator.
|
|
176
|
+
// Any other `.cls` (e.g. `InformeRiesgoPDFServicio.cls` with methods
|
|
177
|
+
// like `GenerarHTML_Principal`) gets `codeBehindExt === null` and is
|
|
178
|
+
// skipped, preserving the original Form_-only guard's behaviour for
|
|
179
|
+
// non-form classes.
|
|
180
|
+
const basename = path.basename(ctx.filePath).toLowerCase();
|
|
181
|
+
const codeBehindExt = basename.startsWith('report_')
|
|
182
|
+
? '.report.txt'
|
|
183
|
+
: basename.startsWith('form_')
|
|
184
|
+
? '.form.txt'
|
|
185
|
+
: null;
|
|
186
|
+
const isFormCodeBehind = codeBehindExt !== null;
|
|
187
|
+
if (handler && isFormCodeBehind) {
|
|
188
|
+
const siblingPath = ctx.filePath.replace(/\.cls$/i, codeBehindExt);
|
|
189
|
+
const controlNodeId = (0, tree_sitter_helpers_1.generateNodeId)(siblingPath, 'form-instance-control', handler.controlName, 0);
|
|
190
|
+
// Stub form-instance-control: local so the per-file edge filter
|
|
191
|
+
// passes the event-handler edge. Overwritten by the real node
|
|
192
|
+
// emitted from the sibling .form.txt (or .report.txt) at index time
|
|
193
|
+
// (same id, same schema, INSERT OR REPLACE). No metadata.controlType
|
|
194
|
+
// here — the sibling side carries the real control type.
|
|
195
|
+
ctx.nodes.push({
|
|
196
|
+
id: controlNodeId,
|
|
197
|
+
kind: 'form-instance-control',
|
|
198
|
+
name: handler.controlName,
|
|
199
|
+
qualifiedName: `${siblingPath}::${handler.controlName}`,
|
|
200
|
+
filePath: siblingPath,
|
|
201
|
+
language: 'vba',
|
|
202
|
+
startLine: 0,
|
|
203
|
+
endLine: 0,
|
|
204
|
+
startColumn: 0,
|
|
205
|
+
endColumn: 0,
|
|
206
|
+
updatedAt: Date.now(),
|
|
207
|
+
});
|
|
208
|
+
ctx.edges.push({
|
|
209
|
+
source: nodeId,
|
|
210
|
+
target: controlNodeId,
|
|
211
|
+
kind: 'event-handler',
|
|
212
|
+
provenance: 'heuristic',
|
|
213
|
+
metadata: { eventName: handler.eventName },
|
|
214
|
+
line: lineNum,
|
|
215
|
+
column: 0,
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
if (ctx.moduleOrClassNode) {
|
|
219
|
+
ctx.edges.push({
|
|
220
|
+
source: ctx.moduleOrClassNode.id,
|
|
221
|
+
target: nodeId,
|
|
222
|
+
kind: 'contains',
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
// Module/class node is created lazily (see extract). Hold the edge in
|
|
227
|
+
// pending so its source can be rewritten once the module exists.
|
|
228
|
+
const edge = {
|
|
229
|
+
source: '',
|
|
230
|
+
target: nodeId,
|
|
231
|
+
kind: 'contains',
|
|
232
|
+
};
|
|
233
|
+
ctx.edges.push(edge);
|
|
234
|
+
ctx.pendingModuleOrClassSource.push(edge);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
return procs;
|
|
238
|
+
}
|
|
239
|
+
//# sourceMappingURL=procedures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"procedures.js","sourceRoot":"","sources":["../../../src/extraction/vba/procedures.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,0CAqMC;AAlND;;;;;GAKG;AACH,2CAA6B;AAE7B,gEAAwD;AACxD,2CAAsC;AACtC,6CAAqD;AAGrD,SAAgB,eAAe,CAAC,GAAwB,EAAE,GAAW;IACnE,MAAM,KAAK,GAAe,EAAE,CAAC;IAC7B,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAC5B,MAAM,CAAC,GAAG,mBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7B,IAAI,CAAC,CAAC;YAAE,SAAS;QACjB,MAAM,aAAa,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QAC1C,MAAM,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAClD,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,C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tractorContext, line: string, lineNum: number, dedupe: Set<string>, sqlVariables: Map<string, string>): void;
|
|
3
|
+
/**
|
|
4
|
+
* #13 fix: `sql = sql & "..."` (self-referential concatenation) must
|
|
5
|
+
* ACCUMULATE the new fragment onto whatever was already tracked for
|
|
6
|
+
* `varName`, not overwrite it. Overwriting silently dropped earlier
|
|
7
|
+
* fragments' tables — typically the initial `FROM <table>` in
|
|
8
|
+
* `sql = "SELECT * FROM tblA"` followed by `sql = sql & " WHERE x=1"`.
|
|
9
|
+
*
|
|
10
|
+
* Detection: the RHS (`m[2]`, trimmed) starts with `<varName> &`,
|
|
11
|
+
* case-insensitively — matching VBA's case-insensitive identifiers (`Sql`
|
|
12
|
+
* and `sql` are the same variable). A genuine fresh assignment (RHS does
|
|
13
|
+
* NOT start with the self-reference) still RESETS tracking — that
|
|
14
|
+
* behavior is unchanged.
|
|
15
|
+
*/
|
|
16
|
+
export declare function trackSqlVariableAssignment(lines: string[], lineIndex: number, sqlVariables: Map<string, string>): void;
|
|
17
|
+
//# sourceMappingURL=sql-wrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sql-wrapper.d.ts","sourceRoot":"","sources":["../../../src/extraction/vba/sql-wrapper.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAwGhD,wBAAgB,aAAa,CAC3B,GAAG,EAAE,mBAAmB,EACxB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,EACnB,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAChC,IAAI,CA+CN;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,MAAM,EAAE,EACf,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAChC,IAAI,CAiBN"}
|