@aroman22/codegraph-vba-darwin-arm64 1.14.0 → 1.16.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/lib/dist/bin/codegraph.js +13 -7
- package/lib/dist/bin/codegraph.js.map +1 -1
- package/lib/dist/bin/daemon-release.d.ts +7 -0
- package/lib/dist/bin/daemon-release.d.ts.map +1 -0
- package/lib/dist/bin/daemon-release.js +18 -0
- package/lib/dist/bin/daemon-release.js.map +1 -0
- package/lib/dist/db/queries.d.ts +30 -0
- package/lib/dist/db/queries.d.ts.map +1 -1
- package/lib/dist/db/queries.js +51 -1
- package/lib/dist/db/queries.js.map +1 -1
- package/lib/dist/extraction/access-erd-extractor.d.ts +57 -0
- package/lib/dist/extraction/access-erd-extractor.d.ts.map +1 -0
- package/lib/dist/extraction/access-erd-extractor.js +389 -0
- package/lib/dist/extraction/access-erd-extractor.js.map +1 -0
- package/lib/dist/extraction/extraction-version.d.ts +1 -1
- package/lib/dist/extraction/extraction-version.js +1 -1
- package/lib/dist/extraction/grammars.d.ts +20 -0
- package/lib/dist/extraction/grammars.d.ts.map +1 -1
- package/lib/dist/extraction/grammars.js +34 -0
- package/lib/dist/extraction/grammars.js.map +1 -1
- package/lib/dist/extraction/index.d.ts +1 -0
- package/lib/dist/extraction/index.d.ts.map +1 -1
- package/lib/dist/extraction/index.js +371 -351
- package/lib/dist/extraction/index.js.map +1 -1
- package/lib/dist/extraction/parse-pool.d.ts +8 -3
- package/lib/dist/extraction/parse-pool.d.ts.map +1 -1
- package/lib/dist/extraction/parse-pool.js +1 -2
- package/lib/dist/extraction/parse-pool.js.map +1 -1
- package/lib/dist/extraction/parse-worker.js +7 -6
- package/lib/dist/extraction/parse-worker.js.map +1 -1
- package/lib/dist/extraction/sql-query-extractor.d.ts +16 -14
- package/lib/dist/extraction/sql-query-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/sql-query-extractor.js +43 -31
- package/lib/dist/extraction/sql-query-extractor.js.map +1 -1
- package/lib/dist/extraction/sql-table-scan.d.ts +184 -0
- package/lib/dist/extraction/sql-table-scan.d.ts.map +1 -0
- package/lib/dist/extraction/sql-table-scan.js +288 -0
- package/lib/dist/extraction/sql-table-scan.js.map +1 -0
- package/lib/dist/extraction/tree-sitter.d.ts +10 -1
- package/lib/dist/extraction/tree-sitter.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter.js +34 -3
- package/lib/dist/extraction/tree-sitter.js.map +1 -1
- package/lib/dist/extraction/vba/call-sweep.d.ts +2 -7
- package/lib/dist/extraction/vba/call-sweep.d.ts.map +1 -1
- package/lib/dist/extraction/vba/call-sweep.js +144 -90
- package/lib/dist/extraction/vba/call-sweep.js.map +1 -1
- package/lib/dist/extraction/vba/calls.d.ts +24 -4
- package/lib/dist/extraction/vba/calls.d.ts.map +1 -1
- package/lib/dist/extraction/vba/calls.js +42 -12
- package/lib/dist/extraction/vba/calls.js.map +1 -1
- package/lib/dist/extraction/vba/constants.d.ts +7 -14
- package/lib/dist/extraction/vba/constants.d.ts.map +1 -1
- package/lib/dist/extraction/vba/constants.js +8 -36
- package/lib/dist/extraction/vba/constants.js.map +1 -1
- package/lib/dist/extraction/vba/context.d.ts +443 -7
- package/lib/dist/extraction/vba/context.d.ts.map +1 -1
- package/lib/dist/extraction/vba/context.js +325 -29
- package/lib/dist/extraction/vba/context.js.map +1 -1
- package/lib/dist/extraction/vba/controls.d.ts +18 -1
- package/lib/dist/extraction/vba/controls.d.ts.map +1 -1
- package/lib/dist/extraction/vba/controls.js +99 -27
- package/lib/dist/extraction/vba/controls.js.map +1 -1
- package/lib/dist/extraction/vba/declarations.d.ts +1 -6
- package/lib/dist/extraction/vba/declarations.d.ts.map +1 -1
- package/lib/dist/extraction/vba/declarations.js +5 -39
- package/lib/dist/extraction/vba/declarations.js.map +1 -1
- package/lib/dist/extraction/vba/dims.d.ts +11 -7
- package/lib/dist/extraction/vba/dims.d.ts.map +1 -1
- package/lib/dist/extraction/vba/dims.js +265 -29
- package/lib/dist/extraction/vba/dims.js.map +1 -1
- package/lib/dist/extraction/vba/docmd.d.ts +29 -2
- package/lib/dist/extraction/vba/docmd.d.ts.map +1 -1
- package/lib/dist/extraction/vba/docmd.js +297 -18
- package/lib/dist/extraction/vba/docmd.js.map +1 -1
- package/lib/dist/extraction/vba/enums-consts.d.ts +7 -14
- package/lib/dist/extraction/vba/enums-consts.d.ts.map +1 -1
- package/lib/dist/extraction/vba/enums-consts.js +11 -45
- package/lib/dist/extraction/vba/enums-consts.js.map +1 -1
- package/lib/dist/extraction/vba/error-channel.d.ts +57 -0
- package/lib/dist/extraction/vba/error-channel.d.ts.map +1 -0
- package/lib/dist/extraction/vba/error-channel.js +128 -0
- package/lib/dist/extraction/vba/error-channel.js.map +1 -0
- package/lib/dist/extraction/vba/errors.d.ts +64 -0
- package/lib/dist/extraction/vba/errors.d.ts.map +1 -0
- package/lib/dist/extraction/vba/errors.js +775 -0
- package/lib/dist/extraction/vba/errors.js.map +1 -0
- package/lib/dist/extraction/vba/filesystem-statements.d.ts +23 -0
- package/lib/dist/extraction/vba/filesystem-statements.d.ts.map +1 -0
- package/lib/dist/extraction/vba/filesystem-statements.js +70 -0
- package/lib/dist/extraction/vba/filesystem-statements.js.map +1 -0
- package/lib/dist/extraction/vba/implements.d.ts +1 -6
- package/lib/dist/extraction/vba/implements.d.ts.map +1 -1
- package/lib/dist/extraction/vba/implements.js +1 -22
- package/lib/dist/extraction/vba/implements.js.map +1 -1
- package/lib/dist/extraction/vba/labels.d.ts +26 -0
- package/lib/dist/extraction/vba/labels.d.ts.map +1 -0
- package/lib/dist/extraction/vba/labels.js +180 -0
- package/lib/dist/extraction/vba/labels.js.map +1 -0
- package/lib/dist/extraction/vba/module-vars.d.ts +36 -0
- package/lib/dist/extraction/vba/module-vars.d.ts.map +1 -0
- package/lib/dist/extraction/vba/module-vars.js +145 -0
- package/lib/dist/extraction/vba/module-vars.js.map +1 -0
- package/lib/dist/extraction/vba/options.d.ts +88 -0
- package/lib/dist/extraction/vba/options.d.ts.map +1 -0
- package/lib/dist/extraction/vba/options.js +39 -0
- package/lib/dist/extraction/vba/options.js.map +1 -0
- package/lib/dist/extraction/vba/parameters.d.ts +35 -0
- package/lib/dist/extraction/vba/parameters.d.ts.map +1 -0
- package/lib/dist/extraction/vba/parameters.js +110 -0
- package/lib/dist/extraction/vba/parameters.js.map +1 -0
- package/lib/dist/extraction/vba/procedures.d.ts +1 -9
- package/lib/dist/extraction/vba/procedures.d.ts.map +1 -1
- package/lib/dist/extraction/vba/procedures.js +174 -112
- package/lib/dist/extraction/vba/procedures.js.map +1 -1
- package/lib/dist/extraction/vba/rules.d.ts +10 -5
- package/lib/dist/extraction/vba/rules.d.ts.map +1 -1
- package/lib/dist/extraction/vba/rules.js +19 -0
- package/lib/dist/extraction/vba/rules.js.map +1 -1
- package/lib/dist/extraction/vba/runtime-objects.d.ts +59 -0
- package/lib/dist/extraction/vba/runtime-objects.d.ts.map +1 -0
- package/lib/dist/extraction/vba/runtime-objects.js +106 -0
- package/lib/dist/extraction/vba/runtime-objects.js.map +1 -0
- package/lib/dist/extraction/vba/signature.d.ts +57 -0
- package/lib/dist/extraction/vba/signature.d.ts.map +1 -0
- package/lib/dist/extraction/vba/signature.js +164 -0
- package/lib/dist/extraction/vba/signature.js.map +1 -0
- package/lib/dist/extraction/vba/sql-wrapper.d.ts +76 -3
- package/lib/dist/extraction/vba/sql-wrapper.d.ts.map +1 -1
- package/lib/dist/extraction/vba/sql-wrapper.js +725 -151
- package/lib/dist/extraction/vba/sql-wrapper.js.map +1 -1
- package/lib/dist/extraction/vba/tempvars.d.ts.map +1 -1
- package/lib/dist/extraction/vba/tempvars.js +4 -0
- package/lib/dist/extraction/vba/tempvars.js.map +1 -1
- package/lib/dist/extraction/vba/text-utils.d.ts +62 -2
- package/lib/dist/extraction/vba/text-utils.d.ts.map +1 -1
- package/lib/dist/extraction/vba/text-utils.js +84 -6
- package/lib/dist/extraction/vba/text-utils.js.map +1 -1
- package/lib/dist/extraction/vba-extractor.d.ts +18 -1
- package/lib/dist/extraction/vba-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/vba-extractor.js +111 -16
- package/lib/dist/extraction/vba-extractor.js.map +1 -1
- package/lib/dist/extraction/vba-form-extractor.d.ts +28 -14
- package/lib/dist/extraction/vba-form-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/vba-form-extractor.js +56 -21
- package/lib/dist/extraction/vba-form-extractor.js.map +1 -1
- package/lib/dist/extraction/vba-preprocess.d.ts +89 -3
- package/lib/dist/extraction/vba-preprocess.d.ts.map +1 -1
- package/lib/dist/extraction/vba-preprocess.js +221 -57
- package/lib/dist/extraction/vba-preprocess.js.map +1 -1
- package/lib/dist/extraction/vba-source.d.ts +0 -10
- package/lib/dist/extraction/vba-source.d.ts.map +1 -1
- package/lib/dist/extraction/vba-source.js +0 -13
- package/lib/dist/extraction/vba-source.js.map +1 -1
- package/lib/dist/extraction/vba-test-manifest-extractor.d.ts +0 -6
- package/lib/dist/extraction/vba-test-manifest-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/vba-test-manifest-extractor.js +0 -1
- package/lib/dist/extraction/vba-test-manifest-extractor.js.map +1 -1
- package/lib/dist/index.d.ts.map +1 -1
- package/lib/dist/index.js +9 -0
- package/lib/dist/index.js.map +1 -1
- package/lib/dist/mcp/daemon-manager.d.ts.map +1 -1
- package/lib/dist/mcp/daemon-manager.js +7 -3
- package/lib/dist/mcp/daemon-manager.js.map +1 -1
- package/lib/dist/mcp/daemon-paths.d.ts +6 -0
- package/lib/dist/mcp/daemon-paths.d.ts.map +1 -1
- package/lib/dist/mcp/daemon-paths.js +15 -0
- package/lib/dist/mcp/daemon-paths.js.map +1 -1
- package/lib/dist/mcp/daemon-registry.d.ts +82 -7
- package/lib/dist/mcp/daemon-registry.d.ts.map +1 -1
- package/lib/dist/mcp/daemon-registry.js +557 -45
- package/lib/dist/mcp/daemon-registry.js.map +1 -1
- package/lib/dist/mcp/daemon-watchdog.d.ts +12 -0
- package/lib/dist/mcp/daemon-watchdog.d.ts.map +1 -1
- package/lib/dist/mcp/daemon-watchdog.js +37 -7
- package/lib/dist/mcp/daemon-watchdog.js.map +1 -1
- package/lib/dist/mcp/daemon.d.ts +20 -1
- package/lib/dist/mcp/daemon.d.ts.map +1 -1
- package/lib/dist/mcp/daemon.js +123 -30
- package/lib/dist/mcp/daemon.js.map +1 -1
- package/lib/dist/mcp/index.d.ts.map +1 -1
- package/lib/dist/mcp/index.js +13 -2
- package/lib/dist/mcp/index.js.map +1 -1
- package/lib/dist/mcp/proxy.d.ts +32 -0
- package/lib/dist/mcp/proxy.d.ts.map +1 -1
- package/lib/dist/mcp/proxy.js +163 -31
- package/lib/dist/mcp/proxy.js.map +1 -1
- package/lib/dist/mcp/tools.d.ts.map +1 -1
- package/lib/dist/mcp/tools.js +29 -1
- package/lib/dist/mcp/tools.js.map +1 -1
- package/lib/dist/project-config.d.ts +43 -2
- package/lib/dist/project-config.d.ts.map +1 -1
- package/lib/dist/project-config.js +86 -2
- package/lib/dist/project-config.js.map +1 -1
- package/lib/dist/resolution/index.d.ts +47 -2
- package/lib/dist/resolution/index.d.ts.map +1 -1
- package/lib/dist/resolution/index.js +160 -5
- package/lib/dist/resolution/index.js.map +1 -1
- package/lib/dist/resolution/name-matcher.d.ts +25 -0
- package/lib/dist/resolution/name-matcher.d.ts.map +1 -1
- package/lib/dist/resolution/name-matcher.js +59 -0
- package/lib/dist/resolution/name-matcher.js.map +1 -1
- package/lib/dist/resolution/vba-runtime-objects.d.ts +11 -11
- package/lib/dist/resolution/vba-runtime-objects.d.ts.map +1 -1
- package/lib/dist/resolution/vba-runtime-objects.js +18 -38
- package/lib/dist/resolution/vba-runtime-objects.js.map +1 -1
- package/lib/dist/types.d.ts +13 -5
- package/lib/dist/types.d.ts.map +1 -1
- package/lib/dist/types.js +17 -0
- package/lib/dist/types.js.map +1 -1
- package/lib/node_modules/.modules.yaml +1 -1
- package/lib/node_modules/.pnpm-workspace-state-v1.json +1 -1
- package/lib/package.json +4 -1
- package/package.json +1 -1
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `VbaExtractionOptions` — the single object that carries every VBA
|
|
3
|
+
* extraction knob from `codegraph.json` down to `VbaExtractor` (issue #243).
|
|
4
|
+
*
|
|
5
|
+
* ## Why this module exists
|
|
6
|
+
*
|
|
7
|
+
* The knobs used to travel as positional parameters through five files:
|
|
8
|
+
*
|
|
9
|
+
* ```
|
|
10
|
+
* project-config.ts loadVbaConfig()
|
|
11
|
+
* -> extraction/index.ts reads vbaConfig
|
|
12
|
+
* -> extraction/parse-pool.ts ParseTask fields
|
|
13
|
+
* -> extraction/parse-worker.ts message shape
|
|
14
|
+
* -> extraction/tree-sitter.ts extractFromSource(..., vbaTargets, maxRaiseFanout, ...)
|
|
15
|
+
* -> new VbaExtractor(filePath, source, vbaTargets, maxRaiseFanout)
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* Every new knob meant editing all five signatures and every call site. One
|
|
19
|
+
* object collapses that to "add a field here, read it in the extractor".
|
|
20
|
+
*
|
|
21
|
+
* ## Worker-boundary constraint — READ BEFORE ADDING A FIELD
|
|
22
|
+
*
|
|
23
|
+
* This object crosses the `parse-pool` -> `parse-worker` boundary through
|
|
24
|
+
* `worker.postMessage`, which is `structuredClone`-based. Every field MUST be
|
|
25
|
+
* plain, structured-cloneable data: primitives, plain objects, and arrays of
|
|
26
|
+
* those. NO functions, NO `RegExp`, NO `Map`/`Set`, NO class instances — a
|
|
27
|
+
* function throws `DataCloneError` at the boundary and a `RegExp` silently
|
|
28
|
+
* loses its `lastIndex`/identity semantics.
|
|
29
|
+
*
|
|
30
|
+
* A derived value that is not cloneable (a compiled wrapper `RegExp`, a
|
|
31
|
+
* lookup `Map`) belongs on the extractor context, built inside the extractor
|
|
32
|
+
* from the plain data in this object.
|
|
33
|
+
*
|
|
34
|
+
* This module is a LEAF: it imports nothing, so the config layer, the pool,
|
|
35
|
+
* the worker, and the extractor can all depend on it without a cycle.
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* Every VBA-specific extraction knob, in one structured-cloneable object.
|
|
39
|
+
*
|
|
40
|
+
* All fields are optional; `{}` is the zero-config default and must behave
|
|
41
|
+
* exactly like the pre-#243 "caller passed nothing" path.
|
|
42
|
+
*/
|
|
43
|
+
export interface VbaExtractionOptions {
|
|
44
|
+
/**
|
|
45
|
+
* Conditional-compilation targets — the `#Const` name -> truth map used to
|
|
46
|
+
* decide which `#If` branches stay active. Sourced from `codegraph.json` ->
|
|
47
|
+
* `vba.targets`. Undefined means "no project overrides"; the preprocessor
|
|
48
|
+
* falls back to its built-in defaults.
|
|
49
|
+
*/
|
|
50
|
+
targets?: Record<string, boolean>;
|
|
51
|
+
/**
|
|
52
|
+
* Issue #152: per-file fanout cap for `RaiseEvent <EventName>` edges. An
|
|
53
|
+
* event raised from more than this many sites in one file is flagged
|
|
54
|
+
* `metadata.highFanout: true` and ALL its `raises-event` edges are dropped.
|
|
55
|
+
* Undefined means the caller did not choose, so `VbaExtractor` applies
|
|
56
|
+
* `DEFAULT_MAX_RAISE_FANOUT` (50). Sourced from `codegraph.json` ->
|
|
57
|
+
* `vba.maxRaiseFanout`.
|
|
58
|
+
*/
|
|
59
|
+
maxRaiseFanout?: number;
|
|
60
|
+
/**
|
|
61
|
+
* Names of project-specific procedures that wrap a SQL execution call
|
|
62
|
+
* (e.g. a shared `EjecutarSQL(sql)` helper), so a call to one of them is
|
|
63
|
+
* treated as a SQL execution site instead of an ordinary call.
|
|
64
|
+
*
|
|
65
|
+
* Declared here now and threaded end-to-end by #243; the SQL-wrapper task
|
|
66
|
+
* is the consumer. Kept as a `readonly string[]` of plain strings — the
|
|
67
|
+
* compiled matcher built from these names is NOT cloneable and therefore
|
|
68
|
+
* belongs on the extractor context, never in this object.
|
|
69
|
+
*/
|
|
70
|
+
sqlWrappers?: readonly string[];
|
|
71
|
+
/**
|
|
72
|
+
* Issue #261 — the module-level variable names this project uses to carry
|
|
73
|
+
* an error message from where it happened to where the user sees it
|
|
74
|
+
* (`m_Error`, `p_Error`, a project's own `lastFailure`). A read or write of
|
|
75
|
+
* one of them is flagged `metadata.errorChannel: true`, and a handler that
|
|
76
|
+
* writes one is classified `behavior: 'channel'`.
|
|
77
|
+
*
|
|
78
|
+
* Bare VBA identifiers, matched as WHOLE names — never substrings, never
|
|
79
|
+
* user-supplied regex (this runs per identifier per line, the same reasoning
|
|
80
|
+
* `sqlWrappers` was built on). Sourced from `codegraph.json` →
|
|
81
|
+
* `vba.errorChannel`, and EXTENDS the built-in list rather than replacing
|
|
82
|
+
* it. Kept as plain strings for the same reason `sqlWrappers` is: the
|
|
83
|
+
* compiled `Set`/`RegExp` form cannot cross the `structuredClone` worker
|
|
84
|
+
* boundary, so it is built on the extractor context instead.
|
|
85
|
+
*/
|
|
86
|
+
errorChannel?: readonly string[];
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/extraction/vba/options.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC;;;;;;;;;;;;;;OAcG;IACH,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `VbaExtractionOptions` — the single object that carries every VBA
|
|
4
|
+
* extraction knob from `codegraph.json` down to `VbaExtractor` (issue #243).
|
|
5
|
+
*
|
|
6
|
+
* ## Why this module exists
|
|
7
|
+
*
|
|
8
|
+
* The knobs used to travel as positional parameters through five files:
|
|
9
|
+
*
|
|
10
|
+
* ```
|
|
11
|
+
* project-config.ts loadVbaConfig()
|
|
12
|
+
* -> extraction/index.ts reads vbaConfig
|
|
13
|
+
* -> extraction/parse-pool.ts ParseTask fields
|
|
14
|
+
* -> extraction/parse-worker.ts message shape
|
|
15
|
+
* -> extraction/tree-sitter.ts extractFromSource(..., vbaTargets, maxRaiseFanout, ...)
|
|
16
|
+
* -> new VbaExtractor(filePath, source, vbaTargets, maxRaiseFanout)
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* Every new knob meant editing all five signatures and every call site. One
|
|
20
|
+
* object collapses that to "add a field here, read it in the extractor".
|
|
21
|
+
*
|
|
22
|
+
* ## Worker-boundary constraint — READ BEFORE ADDING A FIELD
|
|
23
|
+
*
|
|
24
|
+
* This object crosses the `parse-pool` -> `parse-worker` boundary through
|
|
25
|
+
* `worker.postMessage`, which is `structuredClone`-based. Every field MUST be
|
|
26
|
+
* plain, structured-cloneable data: primitives, plain objects, and arrays of
|
|
27
|
+
* those. NO functions, NO `RegExp`, NO `Map`/`Set`, NO class instances — a
|
|
28
|
+
* function throws `DataCloneError` at the boundary and a `RegExp` silently
|
|
29
|
+
* loses its `lastIndex`/identity semantics.
|
|
30
|
+
*
|
|
31
|
+
* A derived value that is not cloneable (a compiled wrapper `RegExp`, a
|
|
32
|
+
* lookup `Map`) belongs on the extractor context, built inside the extractor
|
|
33
|
+
* from the plain data in this object.
|
|
34
|
+
*
|
|
35
|
+
* This module is a LEAF: it imports nothing, so the config layer, the pool,
|
|
36
|
+
* the worker, and the extractor can all depend on it without a cycle.
|
|
37
|
+
*/
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
//# sourceMappingURL=options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../src/extraction/vba/options.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Issue #257 (task T16, half A): turn a procedure's already-parsed signature
|
|
3
|
+
* into `parameter` nodes.
|
|
4
|
+
*
|
|
5
|
+
* This module is EMISSION ONLY. The signature was parsed once by
|
|
6
|
+
* `signature.ts` — after the preprocessor joined `_` line continuations — and
|
|
7
|
+
* stamped onto the `function` node's `metadata.params` by `procedures.ts`.
|
|
8
|
+
* The same `VbaParameterInfo[]` is handed here, so a continued signature and
|
|
9
|
+
* its one-line equivalent produce byte-identical nodes by construction. Never
|
|
10
|
+
* re-parse the declaration line here; that is how the two views drift.
|
|
11
|
+
*/
|
|
12
|
+
import { Node } from '../../types';
|
|
13
|
+
import { VbaExtractorContext } from './context';
|
|
14
|
+
import type { VbaParameterInfo } from './signature';
|
|
15
|
+
/**
|
|
16
|
+
* Emit one `parameter` node per declared parameter of `procedureNode`, the
|
|
17
|
+
* `contains` edge that binds it to its procedure, and — for a non-primitive
|
|
18
|
+
* declared type — a `type_of` edge onto the type's node.
|
|
19
|
+
*
|
|
20
|
+
* Parameters have no line of their own: VBA writes them inside the procedure
|
|
21
|
+
* header, and after continuation joining even the physical line is a fiction.
|
|
22
|
+
* So `startLine` / `endLine` are the procedure's declaration line, and the id
|
|
23
|
+
* is disambiguated by `<Procedure>.<param>` rather than by position — two
|
|
24
|
+
* accessors of the same property (`Property Get X` / `Property Let X`) sit on
|
|
25
|
+
* different lines and therefore still get distinct ids.
|
|
26
|
+
*
|
|
27
|
+
* `qualifiedName` is `<ModuleOrClass>.<Procedure>.<param>`, using
|
|
28
|
+
* `ctx.moduleName` (the resolved `Attribute VB_Name`, or the basename) rather
|
|
29
|
+
* than `ctx.classNamePrefix` — the latter is `null` for a `.bas`, and a
|
|
30
|
+
* parameter of a module-level Sub wants the module prefix just as much as a
|
|
31
|
+
* class method's does. Same choice the module-level `variable` nodes made in
|
|
32
|
+
* issue #251.
|
|
33
|
+
*/
|
|
34
|
+
export declare function emitParameterNodes(ctx: VbaExtractorContext, procedureNode: Node, params: readonly VbaParameterInfo[], lineNum: number, line: string): void;
|
|
35
|
+
//# sourceMappingURL=parameters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameters.d.ts","sourceRoot":"","sources":["../../../src/extraction/vba/parameters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAGnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AA4BpD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,mBAAmB,EACxB,aAAa,EAAE,IAAI,EACnB,MAAM,EAAE,SAAS,gBAAgB,EAAE,EACnC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,GACX,IAAI,CAgEN"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.emitParameterNodes = emitParameterNodes;
|
|
4
|
+
const tree_sitter_helpers_1 = require("../tree-sitter-helpers");
|
|
5
|
+
const constants_1 = require("./constants");
|
|
6
|
+
/**
|
|
7
|
+
* The type name a `type_of` edge should point at, or `null` when the
|
|
8
|
+
* declaration deserves no edge at all.
|
|
9
|
+
*
|
|
10
|
+
* This mirrors what `dims.ts` does for `Dim x As Foo`, deliberately:
|
|
11
|
+
*
|
|
12
|
+
* - an untyped parameter (implicit `Variant`) yields nothing;
|
|
13
|
+
* - a primitive (`Long`, `String`, `Variant`, …) yields nothing —
|
|
14
|
+
* `PRIMITIVE_TYPES` is the same gate the Dim sweep uses;
|
|
15
|
+
* - a qualified type (`As DAO.Recordset`) yields its OUTER segment, because
|
|
16
|
+
* that is the name the Dim sweep resolves and the only one a project
|
|
17
|
+
* declaration could ever match.
|
|
18
|
+
*
|
|
19
|
+
* The gate is intentionally coarse: `type_of` is emitted for anything that is
|
|
20
|
+
* not a primitive, and `resolveVbaReferenceStubs` decides afterwards whether a
|
|
21
|
+
* real project class of that name exists. A library type nobody declares keeps
|
|
22
|
+
* its stub, exactly as a `Dim r As DAO.Recordset` does today.
|
|
23
|
+
*/
|
|
24
|
+
function typeEdgeTarget(declaredType) {
|
|
25
|
+
if (!declaredType)
|
|
26
|
+
return null;
|
|
27
|
+
const outer = declaredType.split('.')[0] ?? '';
|
|
28
|
+
if (!outer)
|
|
29
|
+
return null;
|
|
30
|
+
if (constants_1.PRIMITIVE_TYPES.has(outer.toLowerCase()))
|
|
31
|
+
return null;
|
|
32
|
+
return outer;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Emit one `parameter` node per declared parameter of `procedureNode`, the
|
|
36
|
+
* `contains` edge that binds it to its procedure, and — for a non-primitive
|
|
37
|
+
* declared type — a `type_of` edge onto the type's node.
|
|
38
|
+
*
|
|
39
|
+
* Parameters have no line of their own: VBA writes them inside the procedure
|
|
40
|
+
* header, and after continuation joining even the physical line is a fiction.
|
|
41
|
+
* So `startLine` / `endLine` are the procedure's declaration line, and the id
|
|
42
|
+
* is disambiguated by `<Procedure>.<param>` rather than by position — two
|
|
43
|
+
* accessors of the same property (`Property Get X` / `Property Let X`) sit on
|
|
44
|
+
* different lines and therefore still get distinct ids.
|
|
45
|
+
*
|
|
46
|
+
* `qualifiedName` is `<ModuleOrClass>.<Procedure>.<param>`, using
|
|
47
|
+
* `ctx.moduleName` (the resolved `Attribute VB_Name`, or the basename) rather
|
|
48
|
+
* than `ctx.classNamePrefix` — the latter is `null` for a `.bas`, and a
|
|
49
|
+
* parameter of a module-level Sub wants the module prefix just as much as a
|
|
50
|
+
* class method's does. Same choice the module-level `variable` nodes made in
|
|
51
|
+
* issue #251.
|
|
52
|
+
*/
|
|
53
|
+
function emitParameterNodes(ctx, procedureNode, params, lineNum, line) {
|
|
54
|
+
if (params.length === 0)
|
|
55
|
+
return;
|
|
56
|
+
const procedureName = procedureNode.name;
|
|
57
|
+
const emitted = new Set();
|
|
58
|
+
for (let position = 0; position < params.length; position++) {
|
|
59
|
+
const param = params[position];
|
|
60
|
+
const name = param.name.trim();
|
|
61
|
+
// `parseSignature` never drops a fragment it cannot understand — a wrong
|
|
62
|
+
// arity is worse than a coarse one — so a nameless entry can reach here.
|
|
63
|
+
// It is not a symbol, so it gets no node.
|
|
64
|
+
if (!name)
|
|
65
|
+
continue;
|
|
66
|
+
const nodeId = (0, tree_sitter_helpers_1.generateNodeId)(ctx.filePath, 'parameter', `${procedureName}.${name}`, lineNum);
|
|
67
|
+
// VBA forbids two parameters of the same name on one signature; this only
|
|
68
|
+
// fires if a malformed declaration parsed into a repeat. Keep the first.
|
|
69
|
+
if (emitted.has(nodeId))
|
|
70
|
+
continue;
|
|
71
|
+
emitted.add(nodeId);
|
|
72
|
+
const qualifiedPrefix = ctx.moduleName
|
|
73
|
+
? `${ctx.moduleName}.${procedureName}`
|
|
74
|
+
: procedureName;
|
|
75
|
+
ctx.nodes.push({
|
|
76
|
+
id: nodeId,
|
|
77
|
+
kind: 'parameter',
|
|
78
|
+
name,
|
|
79
|
+
qualifiedName: `${qualifiedPrefix}.${name}`,
|
|
80
|
+
filePath: ctx.filePath,
|
|
81
|
+
language: 'vba',
|
|
82
|
+
startLine: lineNum,
|
|
83
|
+
endLine: lineNum,
|
|
84
|
+
startColumn: 0,
|
|
85
|
+
endColumn: line.length,
|
|
86
|
+
metadata: {
|
|
87
|
+
position,
|
|
88
|
+
byRef: param.byRef,
|
|
89
|
+
optional: param.optional,
|
|
90
|
+
isArray: param.isArray,
|
|
91
|
+
hasDefault: param.hasDefault,
|
|
92
|
+
// An `As`-less parameter is `Variant` per VBA semantics. Recorded as
|
|
93
|
+
// the language's own default rather than left null, matching how
|
|
94
|
+
// issue #251 stamps `declaredType` on module-level variables.
|
|
95
|
+
declaredType: param.type ?? 'Variant',
|
|
96
|
+
},
|
|
97
|
+
updatedAt: Date.now(),
|
|
98
|
+
});
|
|
99
|
+
ctx.edges.push({
|
|
100
|
+
source: procedureNode.id,
|
|
101
|
+
target: nodeId,
|
|
102
|
+
kind: 'contains',
|
|
103
|
+
});
|
|
104
|
+
const typeName = typeEdgeTarget(param.type);
|
|
105
|
+
if (typeName) {
|
|
106
|
+
ctx.emitTypeOf(nodeId, typeName, lineNum, 0, 'vba-parameter-type');
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=parameters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../../src/extraction/vba/parameters.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { VbaClassifier } from './context';
|
|
2
2
|
import { VbaExtractionRule } from './rules';
|
|
3
3
|
/**
|
|
4
4
|
* Issue #153: the declarative rule table for the procedures concern.
|
|
@@ -17,12 +17,4 @@ import { VbaExtractionRule } from './rules';
|
|
|
17
17
|
*/
|
|
18
18
|
export declare const RULES: readonly VbaExtractionRule<unknown>[];
|
|
19
19
|
export declare function createProceduresClassifier(): VbaClassifier;
|
|
20
|
-
/**
|
|
21
|
-
* Backward-compat wrapper: pre-#83 callers (e.g. legacy test fixtures)
|
|
22
|
-
* used `sweepProcedures(ctx, src)` and got back the ProcInfo[].
|
|
23
|
-
* Now it returns `ctx.procedures` (the same flat list the factory
|
|
24
|
-
* appends to). The implementation still calls the classifier once per
|
|
25
|
-
* pre-split line, so the count is identical to the new walker path.
|
|
26
|
-
*/
|
|
27
|
-
export declare function sweepProcedures(ctx: VbaExtractorContext, src: string): ProcInfo[];
|
|
28
20
|
//# sourceMappingURL=procedures.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"procedures.d.ts","sourceRoot":"","sources":["../../../src/extraction/vba/procedures.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"procedures.d.ts","sourceRoot":"","sources":["../../../src/extraction/vba/procedures.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAY,aAAa,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAwB,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAgDlE;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,KAAK,EAAE,SAAS,iBAAiB,CAAC,OAAO,CAAC,EAwVtD,CAAC;AAEF,wBAAgB,0BAA0B,IAAI,aAAa,CAS1D"}
|