@aroman22/codegraph-vba-darwin-arm64 1.9.0 → 1.11.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/db/queries.d.ts +39 -0
- package/lib/dist/db/queries.d.ts.map +1 -1
- package/lib/dist/db/queries.js +45 -0
- package/lib/dist/db/queries.js.map +1 -1
- package/lib/dist/extraction/frameworks/dysflow-export.d.ts +37 -0
- package/lib/dist/extraction/frameworks/dysflow-export.d.ts.map +1 -0
- package/lib/dist/extraction/frameworks/dysflow-export.js +121 -0
- package/lib/dist/extraction/frameworks/dysflow-export.js.map +1 -0
- package/lib/dist/extraction/frameworks/index.d.ts +20 -0
- package/lib/dist/extraction/frameworks/index.d.ts.map +1 -0
- package/lib/dist/extraction/frameworks/index.js +24 -0
- package/lib/dist/extraction/frameworks/index.js.map +1 -0
- package/lib/dist/extraction/index.d.ts.map +1 -1
- package/lib/dist/extraction/index.js +25 -5
- package/lib/dist/extraction/index.js.map +1 -1
- package/lib/dist/extraction/parse-pool.d.ts +10 -0
- package/lib/dist/extraction/parse-pool.d.ts.map +1 -1
- package/lib/dist/extraction/parse-pool.js +2 -0
- package/lib/dist/extraction/parse-pool.js.map +1 -1
- package/lib/dist/extraction/parse-worker.js +6 -2
- package/lib/dist/extraction/parse-worker.js.map +1 -1
- package/lib/dist/extraction/tree-sitter.d.ts +9 -1
- package/lib/dist/extraction/tree-sitter.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter.js +58 -5
- package/lib/dist/extraction/tree-sitter.js.map +1 -1
- package/lib/dist/extraction/vba/call-sweep.d.ts +43 -0
- package/lib/dist/extraction/vba/call-sweep.d.ts.map +1 -1
- package/lib/dist/extraction/vba/call-sweep.js +155 -66
- package/lib/dist/extraction/vba/call-sweep.js.map +1 -1
- package/lib/dist/extraction/vba/calls.d.ts.map +1 -1
- package/lib/dist/extraction/vba/calls.js +6 -0
- package/lib/dist/extraction/vba/calls.js.map +1 -1
- package/lib/dist/extraction/vba/context.d.ts +109 -1
- package/lib/dist/extraction/vba/context.d.ts.map +1 -1
- package/lib/dist/extraction/vba/context.js +155 -2
- package/lib/dist/extraction/vba/context.js.map +1 -1
- package/lib/dist/extraction/vba/controls.d.ts.map +1 -1
- package/lib/dist/extraction/vba/controls.js +77 -0
- package/lib/dist/extraction/vba/controls.js.map +1 -1
- package/lib/dist/extraction/vba/declarations.d.ts +38 -2
- package/lib/dist/extraction/vba/declarations.d.ts.map +1 -1
- package/lib/dist/extraction/vba/declarations.js +217 -129
- package/lib/dist/extraction/vba/declarations.js.map +1 -1
- package/lib/dist/extraction/vba/dims.d.ts +35 -1
- package/lib/dist/extraction/vba/dims.d.ts.map +1 -1
- package/lib/dist/extraction/vba/dims.js +185 -109
- package/lib/dist/extraction/vba/dims.js.map +1 -1
- package/lib/dist/extraction/vba/enums-consts.d.ts +47 -7
- package/lib/dist/extraction/vba/enums-consts.d.ts.map +1 -1
- package/lib/dist/extraction/vba/enums-consts.js +212 -139
- package/lib/dist/extraction/vba/enums-consts.js.map +1 -1
- package/lib/dist/extraction/vba/event-synth.d.ts +3 -0
- package/lib/dist/extraction/vba/event-synth.d.ts.map +1 -0
- package/lib/dist/extraction/vba/event-synth.js +176 -0
- package/lib/dist/extraction/vba/event-synth.js.map +1 -0
- package/lib/dist/extraction/vba/events.d.ts +16 -0
- package/lib/dist/extraction/vba/events.d.ts.map +1 -0
- package/lib/dist/extraction/vba/events.js +90 -0
- package/lib/dist/extraction/vba/events.js.map +1 -0
- package/lib/dist/extraction/vba/implements.d.ts +16 -0
- package/lib/dist/extraction/vba/implements.d.ts.map +1 -1
- package/lib/dist/extraction/vba/implements.js +43 -12
- package/lib/dist/extraction/vba/implements.js.map +1 -1
- package/lib/dist/extraction/vba/procedures.d.ts +20 -0
- package/lib/dist/extraction/vba/procedures.d.ts.map +1 -1
- package/lib/dist/extraction/vba/procedures.js +48 -13
- package/lib/dist/extraction/vba/procedures.js.map +1 -1
- package/lib/dist/extraction/vba/rules.d.ts +125 -0
- package/lib/dist/extraction/vba/rules.d.ts.map +1 -0
- package/lib/dist/extraction/vba/rules.js +49 -0
- package/lib/dist/extraction/vba/rules.js.map +1 -0
- package/lib/dist/extraction/vba/text-utils.d.ts +0 -6
- package/lib/dist/extraction/vba/text-utils.d.ts.map +1 -1
- package/lib/dist/extraction/vba/text-utils.js +9 -6
- package/lib/dist/extraction/vba/text-utils.js.map +1 -1
- package/lib/dist/extraction/vba-extractor.d.ts +77 -1
- package/lib/dist/extraction/vba-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/vba-extractor.js +177 -15
- package/lib/dist/extraction/vba-extractor.js.map +1 -1
- package/lib/dist/extraction/vba-form-extractor.d.ts +26 -114
- package/lib/dist/extraction/vba-form-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/vba-form-extractor.js +293 -297
- package/lib/dist/extraction/vba-form-extractor.js.map +1 -1
- package/lib/dist/extraction/vba-preprocess.d.ts +11 -1
- package/lib/dist/extraction/vba-preprocess.d.ts.map +1 -1
- package/lib/dist/extraction/vba-preprocess.js +45 -16
- package/lib/dist/extraction/vba-preprocess.js.map +1 -1
- package/lib/dist/extraction/vba-timing.d.ts +38 -0
- package/lib/dist/extraction/vba-timing.d.ts.map +1 -0
- package/lib/dist/extraction/vba-timing.js +203 -0
- package/lib/dist/extraction/vba-timing.js.map +1 -0
- package/lib/dist/index.d.ts.map +1 -1
- package/lib/dist/index.js +26 -0
- package/lib/dist/index.js.map +1 -1
- package/lib/dist/project-config.d.ts +31 -0
- package/lib/dist/project-config.d.ts.map +1 -1
- package/lib/dist/project-config.js +75 -22
- package/lib/dist/project-config.js.map +1 -1
- package/lib/dist/resolution/frameworks/index.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/index.js +7 -0
- package/lib/dist/resolution/frameworks/index.js.map +1 -1
- package/lib/dist/resolution/index.d.ts +7 -0
- package/lib/dist/resolution/index.d.ts.map +1 -1
- package/lib/dist/resolution/index.js +155 -11
- package/lib/dist/resolution/index.js.map +1 -1
- package/lib/dist/resolution/name-matcher.d.ts +6 -0
- package/lib/dist/resolution/name-matcher.d.ts.map +1 -1
- package/lib/dist/resolution/name-matcher.js +81 -0
- package/lib/dist/resolution/name-matcher.js.map +1 -1
- package/lib/dist/resolution/vba-access-object-name.d.ts +7 -0
- package/lib/dist/resolution/vba-access-object-name.d.ts.map +1 -0
- package/lib/dist/resolution/vba-access-object-name.js +15 -0
- package/lib/dist/resolution/vba-access-object-name.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 +2 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-utils.js","sourceRoot":"","sources":["../../../src/extraction/vba/text-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"text-utils.js","sourceRoot":"","sources":["../../../src/extraction/vba/text-utils.ts"],"names":[],"mappings":";;AAeA,wCAEC;AAQD,8CA4BC;AASD,kDAEC;AAED,wDAgBC;AAED,wDA0BC;AAqBD,wDAWC;AAED,wDAgBC;AAeD,sDAaC;AA5LD;;;;;GAKG;AACH,qCAA6C;AAE7C;;;;;;GAMG;AACH,SAAgB,cAAc,CAAC,GAAW;IACxC,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;AACvE,CAAC;AAED;;;;;GAKG;AACH,SAAgB,iBAAiB,CAAC,IAAY;IAC5C,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QACvB,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,CAAE,CAAC;QACpB,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;YACf,MAAM,IAAI,GAAG,CAAC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AAG,CAAC,CAAC;IAC7C,IAAI,cAAc,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,CAAC,0CAA0C;IAChF,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;IAClD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,GAAG,CAAC,CAAC,CAAC;IACjD,IAAI,CAAC,WAAW,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAC5C,wDAAwD;IACxD,IAAI,WAAW,CAAC,WAAW,EAAE,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IACtD,IAAI,CAAC,IAAA,0BAAiB,EAAC,SAAS,CAAC;QAAE,OAAO,IAAI,CAAC;IAC/C,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;AACpC,CAAC"}
|
|
@@ -1,11 +1,87 @@
|
|
|
1
1
|
import { ExtractionResult } from '../types';
|
|
2
|
+
import type { VbaExtractionRule } from './vba/rules';
|
|
3
|
+
/**
|
|
4
|
+
* Issue #152: per-file fanout cap for `RaiseEvent <EventName>` edges. An
|
|
5
|
+
* event raised from more than this many sites in a single file is
|
|
6
|
+
* flagged `metadata.highFanout: true` and ALL `raises-event` edges to it
|
|
7
|
+
* are dropped — the gate suppresses graph noise from events with generic
|
|
8
|
+
* names (`Change`, `Click`, `AfterUpdate`, …) that would otherwise
|
|
9
|
+
* produce hundreds of edges per file. Mirrors the upstream
|
|
10
|
+
* `EVENT_FANOUT_CAP` discipline in
|
|
11
|
+
* `src/resolution/callback-synthesizer.ts:43`. Configurable via
|
|
12
|
+
* `codegraph.json` → `vba.maxRaiseFanout`. Pass `Number.POSITIVE_INFINITY`
|
|
13
|
+
* (or any value `>=` the largest expected count) to disable the gate.
|
|
14
|
+
*/
|
|
15
|
+
export declare const DEFAULT_MAX_RAISE_FANOUT = 50;
|
|
16
|
+
/**
|
|
17
|
+
* Issue #153: the orchestrator's aggregated view of every VBA
|
|
18
|
+
* classifier's declarative `RULES` table. Each entry is the
|
|
19
|
+
* `readonly VbaExtractionRule[]` constant exported by the
|
|
20
|
+
* corresponding classifier file. Exposed at module scope so:
|
|
21
|
+
*
|
|
22
|
+
* 1. Tests can pin the table shape and assert that the orchestrator
|
|
23
|
+
* still references each table (a deleted import would
|
|
24
|
+
* accidentally break a whole concern and the test would catch
|
|
25
|
+
* the missing reference).
|
|
26
|
+
* 2. Tooling can introspect every rule the orchestrator
|
|
27
|
+
* dispatches — useful for `codegraph stats` style UIs that
|
|
28
|
+
* show "what kinds of VBA symbols does codegraph know about".
|
|
29
|
+
* 3. The `validateVbaRuleTables` invariant runs on this aggregate
|
|
30
|
+
* so a refactor that empties one concern's `RULES` array
|
|
31
|
+
* (e.g. by deleting the `defineRule` calls during a partial
|
|
32
|
+
* migration) fails loudly at module load instead of silently
|
|
33
|
+
* dropping a whole concern.
|
|
34
|
+
*
|
|
35
|
+
* The keys are the FILE BASENAMES of the classifier modules (no
|
|
36
|
+
* `.ts` extension, kebab-case) — the same naming convention the
|
|
37
|
+
* per-classifier export comments use. Stable identifier for
|
|
38
|
+
* `validateVbaRuleTables` consumers.
|
|
39
|
+
*/
|
|
40
|
+
export declare const VBA_RULE_TABLES: Readonly<Record<string, readonly VbaExtractionRule[]>>;
|
|
41
|
+
/**
|
|
42
|
+
* Issue #153: validate that every per-concern rule table the
|
|
43
|
+
* orchestrator dispatches is non-empty. Called once at module load
|
|
44
|
+
* (see the IIFE at the bottom of this file) so an accidentally-
|
|
45
|
+
* emptied `RULES` array fails loudly when the extractor is first
|
|
46
|
+
* imported, NOT at the first `extract()` call.
|
|
47
|
+
*
|
|
48
|
+
* The result is `{ ok, empty }`:
|
|
49
|
+
* - `ok: true` — every required table has at least one rule.
|
|
50
|
+
* - `ok: false` — at least one table is empty; `empty` lists the
|
|
51
|
+
* concern keys that need attention.
|
|
52
|
+
*
|
|
53
|
+
* The function accepts an optional `tables` argument so the unit
|
|
54
|
+
* test in `__tests__/extraction-vba-rule-table.test.ts` can verify
|
|
55
|
+
* the validator's contract independently of the live data.
|
|
56
|
+
*/
|
|
57
|
+
export declare function validateVbaRuleTables(tables?: Readonly<Record<string, readonly VbaExtractionRule[]>>): {
|
|
58
|
+
ok: boolean;
|
|
59
|
+
empty: string[];
|
|
60
|
+
};
|
|
2
61
|
export declare class VbaExtractor {
|
|
3
62
|
private filePath;
|
|
4
63
|
private source;
|
|
5
64
|
private ctx;
|
|
6
65
|
private vbaTargets?;
|
|
7
|
-
|
|
66
|
+
/**
|
|
67
|
+
* Issue #152: per-file fanout cap for `RaiseEvent <EventName>` edges.
|
|
68
|
+
* When a single event is raised more than this many times in one file,
|
|
69
|
+
* the event node is flagged `metadata.highFanout: true` and ALL
|
|
70
|
+
* `raises-event` edges to it are dropped. Pass `undefined` to disable
|
|
71
|
+
* the gate (the legacy, uncapped behaviour). The 50 default lives in
|
|
72
|
+
* the orchestrator: callers that don't pass a value get the default.
|
|
73
|
+
*/
|
|
74
|
+
private maxRaiseFanout;
|
|
75
|
+
constructor(filePath: string, source: string, vbaTargets?: Record<string, boolean>, maxRaiseFanout?: number);
|
|
8
76
|
extract(): ExtractionResult;
|
|
77
|
+
/**
|
|
78
|
+
* Issue #156: emit the per-file timing block (mode `1` or `2`) and
|
|
79
|
+
* — in mode `2` — append the running aggregate. No-op when
|
|
80
|
+
* `mode === 'off'`. In aggregate mode we flush after every extract()
|
|
81
|
+
* call so the line is visible per-file even without a graceful
|
|
82
|
+
* shutdown (crash-on-file-3 still shows files 1-3 in the aggregate).
|
|
83
|
+
*/
|
|
84
|
+
private maybeEmitTimings;
|
|
9
85
|
private result;
|
|
10
86
|
private isFormOrReportFile;
|
|
11
87
|
private createFileNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vba-extractor.d.ts","sourceRoot":"","sources":["../../src/extraction/vba-extractor.ts"],"names":[],"mappings":"AAuCA,OAAO,EAAQ,gBAAgB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"vba-extractor.d.ts","sourceRoot":"","sources":["../../src/extraction/vba-extractor.ts"],"names":[],"mappings":"AAuCA,OAAO,EAAQ,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAQlD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAuBrD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,iBAAiB,EAAE,CAAC,CAQhF,CAAC;AAoBJ;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,iBAAiB,EAAE,CAAC,CAAmB,GAC/E;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAOlC;AAkBD,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,GAAG,CAAsB;IACjC,OAAO,CAAC,UAAU,CAAC,CAA0B;IAC7C;;;;;;;OAOG;IACH,OAAO,CAAC,cAAc,CAAqB;gBAGzC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpC,cAAc,GAAE,MAAiC;IASnD,OAAO,IAAI,gBAAgB;IAmL3B;;;;;;OAMG;IACH,OAAO,CAAC,gBAAgB;IAWxB,OAAO,CAAC,MAAM;IAUd,OAAO,CAAC,kBAAkB;IAK1B,OAAO,CAAC,cAAc;IAiBtB,OAAO,CAAC,YAAY;IA6BpB,OAAO,CAAC,uBAAuB;CAkBhC"}
|
|
@@ -33,7 +33,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.VbaExtractor = void 0;
|
|
36
|
+
exports.VbaExtractor = exports.VBA_RULE_TABLES = exports.DEFAULT_MAX_RAISE_FANOUT = void 0;
|
|
37
|
+
exports.validateVbaRuleTables = validateVbaRuleTables;
|
|
37
38
|
/**
|
|
38
39
|
* VbaExtractor — regex extractor for `.bas` / `.cls` / `.frm` / `.dsr` source.
|
|
39
40
|
*
|
|
@@ -82,33 +83,160 @@ const dims_1 = require("./vba/dims");
|
|
|
82
83
|
const enums_consts_1 = require("./vba/enums-consts");
|
|
83
84
|
const implements_1 = require("./vba/implements");
|
|
84
85
|
const call_sweep_1 = require("./vba/call-sweep");
|
|
86
|
+
const vba_timing_1 = require("./vba-timing");
|
|
87
|
+
/**
|
|
88
|
+
* Issue #152: per-file fanout cap for `RaiseEvent <EventName>` edges. An
|
|
89
|
+
* event raised from more than this many sites in a single file is
|
|
90
|
+
* flagged `metadata.highFanout: true` and ALL `raises-event` edges to it
|
|
91
|
+
* are dropped — the gate suppresses graph noise from events with generic
|
|
92
|
+
* names (`Change`, `Click`, `AfterUpdate`, …) that would otherwise
|
|
93
|
+
* produce hundreds of edges per file. Mirrors the upstream
|
|
94
|
+
* `EVENT_FANOUT_CAP` discipline in
|
|
95
|
+
* `src/resolution/callback-synthesizer.ts:43`. Configurable via
|
|
96
|
+
* `codegraph.json` → `vba.maxRaiseFanout`. Pass `Number.POSITIVE_INFINITY`
|
|
97
|
+
* (or any value `>=` the largest expected count) to disable the gate.
|
|
98
|
+
*/
|
|
99
|
+
exports.DEFAULT_MAX_RAISE_FANOUT = 50;
|
|
100
|
+
/**
|
|
101
|
+
* Issue #153: the orchestrator's aggregated view of every VBA
|
|
102
|
+
* classifier's declarative `RULES` table. Each entry is the
|
|
103
|
+
* `readonly VbaExtractionRule[]` constant exported by the
|
|
104
|
+
* corresponding classifier file. Exposed at module scope so:
|
|
105
|
+
*
|
|
106
|
+
* 1. Tests can pin the table shape and assert that the orchestrator
|
|
107
|
+
* still references each table (a deleted import would
|
|
108
|
+
* accidentally break a whole concern and the test would catch
|
|
109
|
+
* the missing reference).
|
|
110
|
+
* 2. Tooling can introspect every rule the orchestrator
|
|
111
|
+
* dispatches — useful for `codegraph stats` style UIs that
|
|
112
|
+
* show "what kinds of VBA symbols does codegraph know about".
|
|
113
|
+
* 3. The `validateVbaRuleTables` invariant runs on this aggregate
|
|
114
|
+
* so a refactor that empties one concern's `RULES` array
|
|
115
|
+
* (e.g. by deleting the `defineRule` calls during a partial
|
|
116
|
+
* migration) fails loudly at module load instead of silently
|
|
117
|
+
* dropping a whole concern.
|
|
118
|
+
*
|
|
119
|
+
* The keys are the FILE BASENAMES of the classifier modules (no
|
|
120
|
+
* `.ts` extension, kebab-case) — the same naming convention the
|
|
121
|
+
* per-classifier export comments use. Stable identifier for
|
|
122
|
+
* `validateVbaRuleTables` consumers.
|
|
123
|
+
*/
|
|
124
|
+
exports.VBA_RULE_TABLES = {
|
|
125
|
+
implements: implements_1.RULES,
|
|
126
|
+
procedures: procedures_1.RULES,
|
|
127
|
+
declarations: declarations_1.RULES,
|
|
128
|
+
dims: dims_1.RULES,
|
|
129
|
+
'enums-consts': enums_consts_1.RULES,
|
|
130
|
+
'call-sweep': call_sweep_1.RULES,
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Issue #153: the canonical list of concern keys `VBA_RULE_TABLES`
|
|
134
|
+
* must contain. Order matches the per-line dispatch order in
|
|
135
|
+
* `extract()`: events/types/declares → implements → dims → enums/consts
|
|
136
|
+
* → calls/sql. The procedures sweep is the only one that runs BEFORE
|
|
137
|
+
* the main walk (so `ctx.localProcs` is populated for the call sweep
|
|
138
|
+
* to consult) and is therefore referenced in `VBA_RULE_TABLES` but NOT
|
|
139
|
+
* in this list — it is intentionally validated as a separate concern
|
|
140
|
+
* because the pre-walk contract is different.
|
|
141
|
+
*/
|
|
142
|
+
const REQUIRED_DISPATCH_TABLES = [
|
|
143
|
+
'declarations',
|
|
144
|
+
'implements',
|
|
145
|
+
'dims',
|
|
146
|
+
'enums-consts',
|
|
147
|
+
'call-sweep',
|
|
148
|
+
];
|
|
149
|
+
/**
|
|
150
|
+
* Issue #153: validate that every per-concern rule table the
|
|
151
|
+
* orchestrator dispatches is non-empty. Called once at module load
|
|
152
|
+
* (see the IIFE at the bottom of this file) so an accidentally-
|
|
153
|
+
* emptied `RULES` array fails loudly when the extractor is first
|
|
154
|
+
* imported, NOT at the first `extract()` call.
|
|
155
|
+
*
|
|
156
|
+
* The result is `{ ok, empty }`:
|
|
157
|
+
* - `ok: true` — every required table has at least one rule.
|
|
158
|
+
* - `ok: false` — at least one table is empty; `empty` lists the
|
|
159
|
+
* concern keys that need attention.
|
|
160
|
+
*
|
|
161
|
+
* The function accepts an optional `tables` argument so the unit
|
|
162
|
+
* test in `__tests__/extraction-vba-rule-table.test.ts` can verify
|
|
163
|
+
* the validator's contract independently of the live data.
|
|
164
|
+
*/
|
|
165
|
+
function validateVbaRuleTables(tables = exports.VBA_RULE_TABLES) {
|
|
166
|
+
const empty = [];
|
|
167
|
+
for (const key of REQUIRED_DISPATCH_TABLES) {
|
|
168
|
+
const table = tables[key];
|
|
169
|
+
if (!table || table.length === 0)
|
|
170
|
+
empty.push(key);
|
|
171
|
+
}
|
|
172
|
+
return { ok: empty.length === 0, empty };
|
|
173
|
+
}
|
|
174
|
+
// Run the validator once at module load. The IIFE never throws — it
|
|
175
|
+
// just emits a console.error so the failure is visible in CI logs
|
|
176
|
+
// without aborting the import. The unit test
|
|
177
|
+
// `__tests__/extraction-vba-rule-table.test.ts` pins the
|
|
178
|
+
// `validateVbaRuleTables` contract independently.
|
|
179
|
+
(function runRuleTableInvariant() {
|
|
180
|
+
const result = validateVbaRuleTables();
|
|
181
|
+
if (!result.ok) {
|
|
182
|
+
// eslint-disable-next-line no-console
|
|
183
|
+
console.error(`[vba-extractor] VBA_RULE_TABLES is missing rules for: ${result.empty.join(', ')}. ` +
|
|
184
|
+
`Each concern's RULES array must be non-empty.`);
|
|
185
|
+
}
|
|
186
|
+
})();
|
|
85
187
|
class VbaExtractor {
|
|
86
188
|
filePath;
|
|
87
189
|
source;
|
|
88
190
|
ctx;
|
|
89
191
|
vbaTargets;
|
|
90
|
-
|
|
192
|
+
/**
|
|
193
|
+
* Issue #152: per-file fanout cap for `RaiseEvent <EventName>` edges.
|
|
194
|
+
* When a single event is raised more than this many times in one file,
|
|
195
|
+
* the event node is flagged `metadata.highFanout: true` and ALL
|
|
196
|
+
* `raises-event` edges to it are dropped. Pass `undefined` to disable
|
|
197
|
+
* the gate (the legacy, uncapped behaviour). The 50 default lives in
|
|
198
|
+
* the orchestrator: callers that don't pass a value get the default.
|
|
199
|
+
*/
|
|
200
|
+
maxRaiseFanout;
|
|
201
|
+
constructor(filePath, source, vbaTargets, maxRaiseFanout = exports.DEFAULT_MAX_RAISE_FANOUT) {
|
|
91
202
|
this.filePath = filePath;
|
|
92
203
|
this.source = source;
|
|
93
204
|
this.vbaTargets = vbaTargets;
|
|
205
|
+
this.maxRaiseFanout = maxRaiseFanout;
|
|
94
206
|
this.ctx = new context_1.VbaExtractorContext(filePath);
|
|
95
207
|
}
|
|
96
208
|
extract() {
|
|
97
209
|
const startTime = Date.now();
|
|
210
|
+
// Issue #156: lazy-enable the timing instrumentation ONLY when the
|
|
211
|
+
// env var is set. The Maps stay `null` otherwise so the default path
|
|
212
|
+
// (every real user's `codegraph index` run) pays no Map-allocation
|
|
213
|
+
// cost and no `recordStage` call does any real work.
|
|
214
|
+
const timingMode = (0, vba_timing_1.readTimingMode)();
|
|
215
|
+
if (timingMode !== 'off') {
|
|
216
|
+
this.ctx.ensureTimings();
|
|
217
|
+
}
|
|
98
218
|
try {
|
|
99
219
|
// REQ-CODE-9: hand form/report files off to VbaFormExtractor. If
|
|
100
220
|
// somehow routed here, emit just a file node and return.
|
|
101
221
|
if (this.isFormOrReportFile()) {
|
|
102
222
|
this.ctx.nodes.push(this.createFileNode());
|
|
103
|
-
|
|
223
|
+
const result = this.result(startTime);
|
|
224
|
+
this.maybeEmitTimings(result, timingMode);
|
|
225
|
+
return result;
|
|
104
226
|
}
|
|
105
227
|
// Pre-process pipeline (per design): strip comments first to prevent
|
|
106
228
|
// comments from blocking or causing false line continuations, then join
|
|
107
229
|
// continuations, and blank inactive conditional-compilation branches.
|
|
108
230
|
// Line count is preserved by all stages.
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
231
|
+
//
|
|
232
|
+
// Issue #156: each stage is wrapped in a timing block that records
|
|
233
|
+
// into the context's `timings` Map. `preprocessConditionalCompilation`
|
|
234
|
+
// itself contains an internal lexer+parser pair; we sum that into a
|
|
235
|
+
// single `preprocess.cc.lexer+parser` stage via a thin wrapper that
|
|
236
|
+
// re-uses the same `withStage` helper.
|
|
237
|
+
const cleanComments = (0, vba_timing_1.withStage)(this.ctx, 'preprocess.stripVbaComments', () => (0, vba_preprocess_1.stripVbaComments)(this.source));
|
|
238
|
+
const joined = (0, vba_timing_1.withStage)(this.ctx, 'preprocess.joinLineContinuations', () => (0, vba_preprocess_1.joinLineContinuations)(cleanComments));
|
|
239
|
+
const uncommented = (0, vba_timing_1.withStage)(this.ctx, 'preprocess.conditionalCompilation', () => (0, vba_preprocess_1.preprocessConditionalCompilation)(joined, this.vbaTargets, this.ctx.timings));
|
|
112
240
|
// Create the file node.
|
|
113
241
|
this.ctx.nodes.push(this.createFileNode());
|
|
114
242
|
// Resolve the file's "kind" — .cls → class, else module (including .bas
|
|
@@ -151,19 +279,33 @@ class VbaExtractor {
|
|
|
151
279
|
// Pre-walk: procedures only — populates the same-file function index
|
|
152
280
|
// (legacy behaviour: `sweepProcedures` ran first so the call sweep
|
|
153
281
|
// could look up call targets by name).
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
282
|
+
(0, vba_timing_1.withStage)(this.ctx, 'walk.procedures', () => {
|
|
283
|
+
for (let i = 0; i < lines.length; i++) {
|
|
284
|
+
(0, vba_timing_1.withClassifier)(this.ctx, proceduresCls, lines[i] ?? '', i);
|
|
285
|
+
}
|
|
286
|
+
});
|
|
157
287
|
// Main walk: every other classifier sees every line in order.
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
288
|
+
(0, vba_timing_1.withStage)(this.ctx, 'walk.main', () => {
|
|
289
|
+
for (let i = 0; i < lines.length; i++) {
|
|
290
|
+
const line = lines[i] ?? '';
|
|
291
|
+
for (const c of classifiers) {
|
|
292
|
+
(0, vba_timing_1.withClassifier)(this.ctx, c, line, i);
|
|
293
|
+
}
|
|
162
294
|
}
|
|
163
|
-
}
|
|
295
|
+
});
|
|
164
296
|
// Finalize (calls-sql flushes proc-end line updates to function nodes).
|
|
165
297
|
for (const c of classifiers)
|
|
166
298
|
c.finalize?.(this.ctx);
|
|
299
|
+
// Issue #152: per-file fanout gate for `RaiseEvent <EventName>`
|
|
300
|
+
// edges. Events raised from more than `maxRaiseFanout` sites get
|
|
301
|
+
// the `metadata.highFanout` flag and ALL of their `raises-event`
|
|
302
|
+
// edges dropped. The gate is a no-op when `maxRaiseFanout` is
|
|
303
|
+
// undefined (the legacy, uncapped behaviour) and runs BEFORE the
|
|
304
|
+
// module/class node is created so `pendingModuleOrClassSource`
|
|
305
|
+
// re-attribution never sees the dropped edges.
|
|
306
|
+
if (this.maxRaiseFanout !== undefined) {
|
|
307
|
+
this.ctx.applyRaiseFanoutGate(this.maxRaiseFanout);
|
|
308
|
+
}
|
|
167
309
|
const hasAnySymbols = proceduresCls.count > 0 || classifiers.some((c) => c.count > 0);
|
|
168
310
|
const procs = this.ctx.procedures;
|
|
169
311
|
// Create the module/class node ONLY when the file has actual symbols
|
|
@@ -200,11 +342,31 @@ class VbaExtractor {
|
|
|
200
342
|
code: 'parse_error',
|
|
201
343
|
});
|
|
202
344
|
}
|
|
203
|
-
|
|
345
|
+
const result = this.result(startTime);
|
|
346
|
+
this.maybeEmitTimings(result, timingMode);
|
|
347
|
+
return result;
|
|
204
348
|
}
|
|
205
349
|
// ---------------------------------------------------------------------------
|
|
206
350
|
// Helpers
|
|
207
351
|
// ---------------------------------------------------------------------------
|
|
352
|
+
/**
|
|
353
|
+
* Issue #156: emit the per-file timing block (mode `1` or `2`) and
|
|
354
|
+
* — in mode `2` — append the running aggregate. No-op when
|
|
355
|
+
* `mode === 'off'`. In aggregate mode we flush after every extract()
|
|
356
|
+
* call so the line is visible per-file even without a graceful
|
|
357
|
+
* shutdown (crash-on-file-3 still shows files 1-3 in the aggregate).
|
|
358
|
+
*/
|
|
359
|
+
maybeEmitTimings(_result, mode) {
|
|
360
|
+
if (mode === 'off')
|
|
361
|
+
return;
|
|
362
|
+
if (mode === 'per-file' || mode === 'aggregate') {
|
|
363
|
+
(0, vba_timing_1.emitPerFileTimings)(this.ctx, this.filePath);
|
|
364
|
+
}
|
|
365
|
+
if (mode === 'aggregate') {
|
|
366
|
+
(0, vba_timing_1.recordAggregateTimings)(this.ctx, this.filePath);
|
|
367
|
+
(0, vba_timing_1.flushAggregate)();
|
|
368
|
+
}
|
|
369
|
+
}
|
|
208
370
|
result(startTime) {
|
|
209
371
|
return {
|
|
210
372
|
nodes: this.ctx.nodes,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vba-extractor.js","sourceRoot":"","sources":["../../src/extraction/vba-extractor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"vba-extractor.js","sourceRoot":"","sources":["../../src/extraction/vba-extractor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwJA,sDASC;AAjKD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,2CAA6B;AAE7B,+DAAuD;AACvD,qDAI0B;AAC1B,2CAAmE;AAEnE,iDAAyF;AACzF,qDAG4B;AAC5B,qCAAuE;AACv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AO;YACL,EAAE,EAAE,IAAA,oCAAc,EAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;YACtE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ;YAChC,IAAI;YACJ,aAAa,EAAE,IAAI;YACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,QAAQ,EAAE,KAAK;YACf,SAAS,EAAE,CAAC;YACZ,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM;YACvC,WAAW,EAAE,CAAC;YACd,SAAS,EAAE,CAAC;YACZ,QAAQ,EAAE,EAAE;YACZ,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;SACtB,CAAC;IACJ,CAAC;CACF;AAhTD,oCAgTC"}
|
|
@@ -30,15 +30,14 @@ export declare class VbaFormExtractor {
|
|
|
30
30
|
private detectVbName;
|
|
31
31
|
/**
|
|
32
32
|
* Build the per-file node for a `.form.txt` / `.report.txt` source.
|
|
33
|
-
* Emits `
|
|
34
|
-
* `
|
|
33
|
+
* Emits `form-layout` for forms and `report-layout` for reports, replacing
|
|
34
|
+
* the historical `module` kind with a UI-specific layout kind.
|
|
35
35
|
*
|
|
36
|
-
* The deterministic id formula
|
|
37
|
-
* name, 1)
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* label as a back-compat marker; consumers should prefer `node.kind`.
|
|
36
|
+
* The deterministic id formula remains
|
|
37
|
+
* `generateNodeId(filePath, layoutKind, name, 1)`. Report ids intentionally
|
|
38
|
+
* use `report-layout` so real reports agree with DoCmd.OpenReport stubs.
|
|
39
|
+
* `metadata.containerKind` keeps the historical `module` label as a
|
|
40
|
+
* back-compat marker; consumers should prefer `node.kind`.
|
|
42
41
|
*/
|
|
43
42
|
private createFormLayoutNode;
|
|
44
43
|
/**
|
|
@@ -50,68 +49,20 @@ export declare class VbaFormExtractor {
|
|
|
50
49
|
* Name = "txtFoo"
|
|
51
50
|
* End
|
|
52
51
|
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* the extra `Begin`/`End` for the form's root block are matched but
|
|
56
|
-
* filtered by the control-type blacklist (see below).
|
|
52
|
+
* The block walker balances every `Begin`/`End` pair, including untyped
|
|
53
|
+
* root blocks and non-control Form/Report/Section containers.
|
|
57
54
|
*/
|
|
58
55
|
private static readonly BEGIN_RE;
|
|
59
|
-
/**
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
private
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
* filtered out so they don't appear as `property` nodes.
|
|
70
|
-
*
|
|
71
|
-
* - `Form` — the form's own root `Begin Form` / `End` container.
|
|
72
|
-
* - `Section` — Access section containers (Header / Detail / Footer).
|
|
73
|
-
*
|
|
74
|
-
* `Rectangle` and `Image` are real Access controls and must NOT appear here.
|
|
75
|
-
*/
|
|
76
|
-
private static readonly NON_CONTROL_TYPES;
|
|
77
|
-
/**
|
|
78
|
-
* Maximum scan window for the `Name = "..."` attribute after a
|
|
79
|
-
* `Begin <Type>` line. Real Dysflow exports have at most a handful of
|
|
80
|
-
* whitespace-only lines and the `Name` line within the first 3–6 lines
|
|
81
|
-
* of the block. 16 is a generous bound; if `Name` is missing within
|
|
82
|
-
* that window, the control is treated as a nameless container and only
|
|
83
|
-
* the legacy `property` node is emitted (preserves REQ-FORM-2 for
|
|
84
|
-
* pre-Name `.form.txt` files exported by older Dysflow versions).
|
|
85
|
-
*/
|
|
86
|
-
private static readonly NAME_SCAN_WINDOW;
|
|
87
|
-
private sweepControls;
|
|
88
|
-
/**
|
|
89
|
-
* Scan ahead from a `Begin <Type>` line for the first `Name = "…"`
|
|
90
|
-
* attribute. Returns the captured name and the line number where it
|
|
91
|
-
* was found, or `{ name: '', nameLine: 0 }` when no Name is present
|
|
92
|
-
* within the scan window (e.g. the `Begin Form` root block which has
|
|
93
|
-
* `Caption = "..."` but no `Name`, or pre-Name legacy exports).
|
|
94
|
-
*
|
|
95
|
-
* Stops at the next `Begin` or `End` boundary so a misaligned scan
|
|
96
|
-
* never crosses into a sibling control's attribute block.
|
|
97
|
-
*/
|
|
98
|
-
private findControlName;
|
|
99
|
-
/**
|
|
100
|
-
* Issue #49 — `RecordSource = "..."` line regex. The Dysflow SaveAsText
|
|
101
|
-
* format always wraps the value in double quotes; the inner `(?:[^"]|"")*`
|
|
102
|
-
* body tolerates the doubled-quote escape (`""` → `"`) so the captured
|
|
103
|
-
* group carries the literal text exactly as Access stores it.
|
|
104
|
-
*
|
|
105
|
-
* Anchored at the start of the line — properties in the SaveAsText
|
|
106
|
-
* format are always indented but the attribute name is unambiguous, so
|
|
107
|
-
* a leading whitespace-tolerant anchor is enough.
|
|
108
|
-
*/
|
|
109
|
-
private static readonly RECORD_SOURCE_RE;
|
|
110
|
-
/** Issue #49 — `RowSource = "..."` line regex. Mirrors `RECORD_SOURCE_RE`. */
|
|
111
|
-
private static readonly ROW_SOURCE_RE;
|
|
112
|
-
/** Issue #49 — `RowSourceType = "..."` line regex. Used by the control-block
|
|
113
|
-
* scan to detect value-list controls whose RowSource is a literal list. */
|
|
114
|
-
private static readonly ROW_SOURCE_TYPE_RE;
|
|
56
|
+
/** Access also serializes binary/GUID values as `Property = Begin ... End`. */
|
|
57
|
+
private static readonly PROPERTY_BLOCK_BEGIN_RE;
|
|
58
|
+
/** Quoted SaveAsText property captured inside the current block frame. */
|
|
59
|
+
private static readonly QUOTED_PROPERTY_RE;
|
|
60
|
+
private walkBlocks;
|
|
61
|
+
private enclosingSection;
|
|
62
|
+
private emitBlock;
|
|
63
|
+
private emitExpressionHandlers;
|
|
64
|
+
private emitExpressionHandler;
|
|
65
|
+
private emitSourceObjectReference;
|
|
115
66
|
/**
|
|
116
67
|
* Issue #49 — copy of `VbaExtractor.SQL_TABLE_RE`. Same source / flags:
|
|
117
68
|
* captures the table name that follows `FROM`/`JOIN`/`INTO`/`UPDATE`,
|
|
@@ -152,6 +103,13 @@ export declare class VbaFormExtractor {
|
|
|
152
103
|
* name — same dual-match `vba-sql-impact`'s `extractFormBindings` does).
|
|
153
104
|
*/
|
|
154
105
|
private emitTableReference;
|
|
106
|
+
/**
|
|
107
|
+
* Link a bound control to its enclosing form/report's single bare table.
|
|
108
|
+
* Expressions and SQL/absent RecordSource values stay metadata-only: column
|
|
109
|
+
* lineage through expressions or SELECT projections cannot be inferred here
|
|
110
|
+
* without risking false graph edges.
|
|
111
|
+
*/
|
|
112
|
+
private emitControlSourceReference;
|
|
155
113
|
/**
|
|
156
114
|
* Issue #49 — dispatch the value of a RecordSource/RowSource binding.
|
|
157
115
|
* If SQL, run `SQL_TABLE_RE` over the value and emit one edge per
|
|
@@ -166,51 +124,5 @@ export declare class VbaFormExtractor {
|
|
|
166
124
|
* `extractStringLiterals` helper uses for its emitted `text` field.
|
|
167
125
|
*/
|
|
168
126
|
private emitBinding;
|
|
169
|
-
/**
|
|
170
|
-
* Issue #49 — sweep for the form-level `RecordSource` line. RecordSource
|
|
171
|
-
* always attributes to the form-layout node (even if the line is
|
|
172
|
-
* written inside a control's Begin block — defensive: in real
|
|
173
|
-
* SaveAsText exports the form's RecordSource sits at the root, but
|
|
174
|
-
* the agent's spec says "emit from the form-layout node" regardless).
|
|
175
|
-
*
|
|
176
|
-
* The sweep intentionally matches ONLY `RecordSource` here;
|
|
177
|
-
* `RowSource` is handled by `sweepRowSources` so the per-binding
|
|
178
|
-
* attribution logic (control vs. form-layout) stays in one place.
|
|
179
|
-
*/
|
|
180
|
-
private sweepRecordSources;
|
|
181
|
-
/**
|
|
182
|
-
* Issue #49 — sweep for per-control `RowSource` lines. RowSource
|
|
183
|
-
* attributes to the enclosing control's `form-instance-control` node
|
|
184
|
-
* when one is in scope; if the line is found outside any control
|
|
185
|
-
* Begin block (defensive — unusual in real exports), it falls back to
|
|
186
|
-
* the form-layout node. The tag is always `'vba-row-source'` so
|
|
187
|
-
* consumers can distinguish a control-level data binding from the
|
|
188
|
-
* form-level RecordSource even when both happen to share the same
|
|
189
|
-
* source node.
|
|
190
|
-
*
|
|
191
|
-
* Control-block tracking: a stack of `{ controlName, rowSourceType }`
|
|
192
|
-
* entries mirrors the current scope as the sweep walks lines in order.
|
|
193
|
-
* `Begin <Type>` pushes; `End` pops. `Begin Form` / `Begin Section`
|
|
194
|
-
* push a non-control entry so a RowSource written at the form root
|
|
195
|
-
* correctly falls through to the form-layout fallback.
|
|
196
|
-
*
|
|
197
|
-
* Value-list skip: when the CURRENT TOP scope's `RowSourceType` is
|
|
198
|
-
* `"Value List"` (captured by the same scan-window as the control's
|
|
199
|
-
* `Name`), the control's RowSource is a literal list and we skip the
|
|
200
|
-
* emission — the data is in code, not a table.
|
|
201
|
-
*/
|
|
202
|
-
private sweepRowSources;
|
|
203
|
-
/**
|
|
204
|
-
* Issue #49 — companion helper to `findControlName`: scan ahead from a
|
|
205
|
-
* `Begin <Type>` line for the first `RowSourceType = "..."` attribute
|
|
206
|
-
* within the same `NAME_SCAN_WINDOW` (so a missing attribute gracefully
|
|
207
|
-
* no-ops instead of mis-attributing). Returns the captured value (e.g.
|
|
208
|
-
* `"Value List"`, `"Table/Query"`) or `''` when absent.
|
|
209
|
-
*
|
|
210
|
-
* Stops at the next `Begin` or `End` boundary — same scan-window
|
|
211
|
-
* discipline as `findControlName`, so a misaligned scan never crosses
|
|
212
|
-
* into a sibling control's attribute block.
|
|
213
|
-
*/
|
|
214
|
-
private findRowSourceType;
|
|
215
127
|
}
|
|
216
128
|
//# sourceMappingURL=vba-form-extractor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vba-form-extractor.d.ts","sourceRoot":"","sources":["../../src/extraction/vba-form-extractor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vba-form-extractor.d.ts","sourceRoot":"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