@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
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Access event properties shared by form-layout expression extraction and
|
|
3
|
+
* code-behind naming-convention validation. Keep this as the single source of
|
|
4
|
+
* truth when adding events. Reference: Microsoft Access object event docs:
|
|
5
|
+
* https://learn.microsoft.com/en-us/office/vba/api/overview/access/object-model
|
|
6
|
+
*/
|
|
7
|
+
export declare const ACCESS_EVENT_PROPERTIES: Map<string, string>;
|
|
8
|
+
/**
|
|
9
|
+
* Closed set of Access event procedure suffixes. Values from form/report
|
|
10
|
+
* event properties above are combined with control-specific events whose
|
|
11
|
+
* property is not necessarily present in an exported layout. VBA matching is
|
|
12
|
+
* case-insensitive; consumers should compare lower-cased names.
|
|
13
|
+
*/
|
|
14
|
+
export declare const ACCESS_EVENT_NAMES: ReadonlySet<string>;
|
|
15
|
+
export declare function isAccessEventName(name: string): boolean;
|
|
16
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/extraction/vba/events.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,qBAuClC,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CA4BjD,CAAC;AAMH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvD"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ACCESS_EVENT_NAMES = exports.ACCESS_EVENT_PROPERTIES = void 0;
|
|
4
|
+
exports.isAccessEventName = isAccessEventName;
|
|
5
|
+
/**
|
|
6
|
+
* Access event properties shared by form-layout expression extraction and
|
|
7
|
+
* code-behind naming-convention validation. Keep this as the single source of
|
|
8
|
+
* truth when adding events. Reference: Microsoft Access object event docs:
|
|
9
|
+
* https://learn.microsoft.com/en-us/office/vba/api/overview/access/object-model
|
|
10
|
+
*/
|
|
11
|
+
exports.ACCESS_EVENT_PROPERTIES = new Map([
|
|
12
|
+
['onclick', 'Click'],
|
|
13
|
+
['ondblclick', 'DblClick'],
|
|
14
|
+
['oncurrent', 'Current'],
|
|
15
|
+
['onload', 'Load'],
|
|
16
|
+
['onopen', 'Open'],
|
|
17
|
+
['onclose', 'Close'],
|
|
18
|
+
['onactivate', 'Activate'],
|
|
19
|
+
['ondeactivate', 'Deactivate'],
|
|
20
|
+
['onunload', 'Unload'],
|
|
21
|
+
['afterupdate', 'AfterUpdate'],
|
|
22
|
+
['beforeupdate', 'BeforeUpdate'],
|
|
23
|
+
['onchange', 'Change'],
|
|
24
|
+
['onenter', 'Enter'],
|
|
25
|
+
['onexit', 'Exit'],
|
|
26
|
+
['ongotfocus', 'GotFocus'],
|
|
27
|
+
['onlostfocus', 'LostFocus'],
|
|
28
|
+
['onmousedown', 'MouseDown'],
|
|
29
|
+
['onmousemove', 'MouseMove'],
|
|
30
|
+
['onmouseup', 'MouseUp'],
|
|
31
|
+
['onkeydown', 'KeyDown'],
|
|
32
|
+
['onkeypress', 'KeyPress'],
|
|
33
|
+
['onkeyup', 'KeyUp'],
|
|
34
|
+
['ontimer', 'Timer'],
|
|
35
|
+
['onnotinlist', 'NotInList'],
|
|
36
|
+
['ondirty', 'Dirty'],
|
|
37
|
+
['onundo', 'Undo'],
|
|
38
|
+
['ondelete', 'Delete'],
|
|
39
|
+
['beforeinsert', 'BeforeInsert'],
|
|
40
|
+
['afterinsert', 'AfterInsert'],
|
|
41
|
+
['onerror', 'Error'],
|
|
42
|
+
['onfilter', 'Filter'],
|
|
43
|
+
['onapplyfilter', 'ApplyFilter'],
|
|
44
|
+
['onresize', 'Resize'],
|
|
45
|
+
['onnodata', 'NoData'],
|
|
46
|
+
['onformat', 'Format'],
|
|
47
|
+
['onprint', 'Print'],
|
|
48
|
+
['onpage', 'Page'],
|
|
49
|
+
['onretreat', 'Retreat'],
|
|
50
|
+
]);
|
|
51
|
+
/**
|
|
52
|
+
* Closed set of Access event procedure suffixes. Values from form/report
|
|
53
|
+
* event properties above are combined with control-specific events whose
|
|
54
|
+
* property is not necessarily present in an exported layout. VBA matching is
|
|
55
|
+
* case-insensitive; consumers should compare lower-cased names.
|
|
56
|
+
*/
|
|
57
|
+
exports.ACCESS_EVENT_NAMES = new Set([
|
|
58
|
+
...exports.ACCESS_EVENT_PROPERTIES.values(),
|
|
59
|
+
'Updated',
|
|
60
|
+
'DropButtonClick',
|
|
61
|
+
'BeforeDelConfirm',
|
|
62
|
+
'AfterDelConfirm',
|
|
63
|
+
'MouseWheel',
|
|
64
|
+
'BeforeDragOver',
|
|
65
|
+
'BeforeDropOrPaste',
|
|
66
|
+
'BeforePrint',
|
|
67
|
+
'BeforeRender',
|
|
68
|
+
'AfterRender',
|
|
69
|
+
'AfterLayout',
|
|
70
|
+
'AfterFinalRender',
|
|
71
|
+
'BeforeQuery',
|
|
72
|
+
'BeforeScreenTip',
|
|
73
|
+
'CommandBeforeExecute',
|
|
74
|
+
'CommandChecked',
|
|
75
|
+
'CommandEnabled',
|
|
76
|
+
'CommandExecute',
|
|
77
|
+
'DataChange',
|
|
78
|
+
'DataSetChange',
|
|
79
|
+
'OnConnect',
|
|
80
|
+
'OnDisconnect',
|
|
81
|
+
'PivotTableChange',
|
|
82
|
+
'Query',
|
|
83
|
+
'SelectionChange',
|
|
84
|
+
'ViewChange',
|
|
85
|
+
]);
|
|
86
|
+
const ACCESS_EVENT_NAMES_CASE_INSENSITIVE = new Set([...exports.ACCESS_EVENT_NAMES].map((name) => name.toLowerCase()));
|
|
87
|
+
function isAccessEventName(name) {
|
|
88
|
+
return ACCESS_EVENT_NAMES_CASE_INSENSITIVE.has(name.toLowerCase());
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../../src/extraction/vba/events.ts"],"names":[],"mappings":";;;AAuFA,8CAEC;AAzFD;;;;;GAKG;AACU,QAAA,uBAAuB,GAAG,IAAI,GAAG,CAAiB;IAC7D,CAAC,SAAS,EAAE,OAAO,CAAC;IACpB,CAAC,YAAY,EAAE,UAAU,CAAC;IAC1B,CAAC,WAAW,EAAE,SAAS,CAAC;IACxB,CAAC,QAAQ,EAAE,MAAM,CAAC;IAClB,CAAC,QAAQ,EAAE,MAAM,CAAC;IAClB,CAAC,SAAS,EAAE,OAAO,CAAC;IACpB,CAAC,YAAY,EAAE,UAAU,CAAC;IAC1B,CAAC,cAAc,EAAE,YAAY,CAAC;IAC9B,CAAC,UAAU,EAAE,QAAQ,CAAC;IACtB,CAAC,aAAa,EAAE,aAAa,CAAC;IAC9B,CAAC,cAAc,EAAE,cAAc,CAAC;IAChC,CAAC,UAAU,EAAE,QAAQ,CAAC;IACtB,CAAC,SAAS,EAAE,OAAO,CAAC;IACpB,CAAC,QAAQ,EAAE,MAAM,CAAC;IAClB,CAAC,YAAY,EAAE,UAAU,CAAC;IAC1B,CAAC,aAAa,EAAE,WAAW,CAAC;IAC5B,CAAC,aAAa,EAAE,WAAW,CAAC;IAC5B,CAAC,aAAa,EAAE,WAAW,CAAC;IAC5B,CAAC,WAAW,EAAE,SAAS,CAAC;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AAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAC1D,CAAC;AAEF,SAAgB,iBAAiB,CAAC,IAAY;IAC5C,OAAO,mCAAmC,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import { VbaExtractorContext, VbaClassifier } from './context';
|
|
2
|
+
import { VbaExtractionRule } from './rules';
|
|
3
|
+
/**
|
|
4
|
+
* Issue #153: the declarative rule table for the implements concern.
|
|
5
|
+
* One rule — `implements` — matching a leading `Implements <Name>`
|
|
6
|
+
* declaration. The body has no inter-line state to track, so the
|
|
7
|
+
* orchestrator walks the table and bumps `this.count` on every
|
|
8
|
+
* non-null emit. Keeps the inline `classifyLine` below honest: any
|
|
9
|
+
* branch not represented in this table is dead code.
|
|
10
|
+
*/
|
|
11
|
+
export declare const RULES: readonly VbaExtractionRule<unknown>[];
|
|
2
12
|
/**
|
|
3
13
|
* Issue #83: factory for the `Implements` classifier. Stateless per-line.
|
|
14
|
+
*
|
|
15
|
+
* The body walks the declarative `RULES` table — the inline regex
|
|
16
|
+
* match that lived here before #153 is now a single entry in
|
|
17
|
+
* `RULES`. This is the canonical pattern every classifier will
|
|
18
|
+
* converge on as part of the refactor; the legacy "one giant
|
|
19
|
+
* if/else cascade" is gone.
|
|
4
20
|
*/
|
|
5
21
|
export declare function createImplementsClassifier(): VbaClassifier;
|
|
6
22
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implements.d.ts","sourceRoot":"","sources":["../../../src/extraction/vba/implements.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"implements.d.ts","sourceRoot":"","sources":["../../../src/extraction/vba/implements.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAyB,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAKnE;;;;;;;GAOG;AACH,eAAO,MAAM,KAAK,EAAE,SAAS,iBAAiB,CAAC,OAAO,CAAC,EAyCtD,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,IAAI,aAAa,CAgB1D;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,mBAAmB,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAO7E"}
|
|
@@ -1,25 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RULES = void 0;
|
|
3
4
|
exports.createImplementsClassifier = createImplementsClassifier;
|
|
4
5
|
exports.sweepImplements = sweepImplements;
|
|
5
6
|
const tree_sitter_helpers_1 = require("../tree-sitter-helpers");
|
|
7
|
+
const rules_1 = require("./rules");
|
|
6
8
|
/** Implements regex. */
|
|
7
9
|
const IMPLEMENTS_RE = /^\s*Implements\s+(\p{L}[\p{L}\p{N}_]*)/iu;
|
|
8
10
|
/**
|
|
9
|
-
* Issue #
|
|
11
|
+
* Issue #153: the declarative rule table for the implements concern.
|
|
12
|
+
* One rule — `implements` — matching a leading `Implements <Name>`
|
|
13
|
+
* declaration. The body has no inter-line state to track, so the
|
|
14
|
+
* orchestrator walks the table and bumps `this.count` on every
|
|
15
|
+
* non-null emit. Keeps the inline `classifyLine` below honest: any
|
|
16
|
+
* branch not represented in this table is dead code.
|
|
10
17
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
if (!m)
|
|
18
|
-
return;
|
|
18
|
+
exports.RULES = [
|
|
19
|
+
(0, rules_1.defineRule)({
|
|
20
|
+
id: 'implements',
|
|
21
|
+
description: 'Match a leading `Implements <Name>` declaration; emit an `interface` node + a pending `implements` edge.',
|
|
22
|
+
pattern: IMPLEMENTS_RE,
|
|
23
|
+
emit: (m, ctx, line, lineNum) => {
|
|
19
24
|
const name = m[1] ?? '';
|
|
20
25
|
if (!name)
|
|
21
|
-
return;
|
|
22
|
-
const lineNum = i + 1;
|
|
26
|
+
return null;
|
|
23
27
|
const targetId = (0, tree_sitter_helpers_1.generateNodeId)(ctx.filePath, 'interface', name, lineNum);
|
|
24
28
|
ctx.nodes.push({
|
|
25
29
|
id: targetId,
|
|
@@ -49,7 +53,34 @@ function createImplementsClassifier() {
|
|
|
49
53
|
};
|
|
50
54
|
ctx.edges.push(edge);
|
|
51
55
|
ctx.pendingModuleOrClassSource.push(edge);
|
|
52
|
-
|
|
56
|
+
return { name };
|
|
57
|
+
},
|
|
58
|
+
}),
|
|
59
|
+
];
|
|
60
|
+
/**
|
|
61
|
+
* Issue #83: factory for the `Implements` classifier. Stateless per-line.
|
|
62
|
+
*
|
|
63
|
+
* The body walks the declarative `RULES` table — the inline regex
|
|
64
|
+
* match that lived here before #153 is now a single entry in
|
|
65
|
+
* `RULES`. This is the canonical pattern every classifier will
|
|
66
|
+
* converge on as part of the refactor; the legacy "one giant
|
|
67
|
+
* if/else cascade" is gone.
|
|
68
|
+
*/
|
|
69
|
+
function createImplementsClassifier() {
|
|
70
|
+
return {
|
|
71
|
+
name: 'implements',
|
|
72
|
+
count: 0,
|
|
73
|
+
classifyLine(line, i, ctx) {
|
|
74
|
+
const lineNum = i + 1;
|
|
75
|
+
for (const rule of exports.RULES) {
|
|
76
|
+
const m = (0, rules_1.matchRule)(rule.pattern, line);
|
|
77
|
+
if (!m)
|
|
78
|
+
continue;
|
|
79
|
+
const result = rule.emit(m, ctx, line, lineNum);
|
|
80
|
+
if (result !== null && result !== undefined) {
|
|
81
|
+
this.count += rule.count ? rule.count(result) : 1;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
53
84
|
},
|
|
54
85
|
};
|
|
55
86
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implements.js","sourceRoot":"","sources":["../../../src/extraction/vba/implements.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"implements.js","sourceRoot":"","sources":["../../../src/extraction/vba/implements.ts"],"names":[],"mappings":";;;AAyEA,gEAgBC;AAMD,0CAOC;AAhGD,gEAAwD;AAExD,mCAAmE;AAEnE,wBAAwB;AACxB,MAAM,aAAa,GAAG,0CAA0C,CAAC;AAEjE;;;;;;;GAOG;AACU,QAAA,KAAK,GAA0C;IAC1D,IAAA,kBAAU,EAAC;QACT,EAAE,EAAE,YAAY;QAChB,WAAW,EACT,0GAA0G;QAC5G,OAAO,EAAE,aAAa;QACtB,IAAI,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;YAC9B,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;YACxB,IAAI,CAAC,IAAI;gBAAE,OAAO,IAAI,CAAC;YACvB,MAAM,QAAQ,GAAG,IAAA,oCAAc,EAAC,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;YAC1E,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;gBACb,EAAE,EAAE,QAAQ;gBACZ,IAAI,EAAE,WAAW;gBACjB,IAAI;gBACJ,aAAa,EAAE,IAAI;gBACnB,QAAQ,EAAE,GAAG,CAAC,QAAQ;gBACtB,QAAQ,EAAE,KAAK;gBACf,SAAS,EAAE,OAAO;gBAClB,OAAO,EAAE,OAAO;gBAChB,WAAW,EAAE,CAAC;gBACd,SAAS,EAAE,IAAI,CAAC,MAAM;gBACtB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;aACtB,CAAC,CAAC;YACH,MAAM,IAAI,GAAS;gBACjB,MAAM,EAAE,EAAE,EAAE,kDAAkD;gBAC9D,MAAM,EAAE,QAAQ;gBAChB,IAAI,EAAE,YAAY;gBAClB,gEAAgE;g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CAAC,CAAC;IAC9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;IAC3C,CAAC;IACD,OAAO,GAAG,CAAC,KAAK,CAAC;AACnB,CAAC"}
|
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
import { VbaExtractorContext, ProcInfo, VbaClassifier } from './context';
|
|
2
|
+
import { VbaExtractionRule } from './rules';
|
|
3
|
+
/**
|
|
4
|
+
* Issue #153: the declarative rule table for the procedures concern.
|
|
5
|
+
* One rule — `procedure` — matches a `Sub` / `Function` /
|
|
6
|
+
* `Property Get|Let|Set` declaration and emits the function node,
|
|
7
|
+
* the `localProcs` / `functionNodeByName` / `functionNodeByStartLine`
|
|
8
|
+
* / `functionReturnTypes` registration, and (for form code-behind)
|
|
9
|
+
* the synthesized `event-handler` edge.
|
|
10
|
+
*
|
|
11
|
+
* The emit body is intentionally not split across multiple rules —
|
|
12
|
+
* these are 5+ small operations that all fire on the same declaration
|
|
13
|
+
* line. Splitting them would force the orchestrator to know they
|
|
14
|
+
* always co-occur, which is more coupling than the original cascade
|
|
15
|
+
* had. The pattern is the discriminating surface; everything past
|
|
16
|
+
* `match` is one emit.
|
|
17
|
+
*/
|
|
18
|
+
export declare const RULES: readonly VbaExtractionRule<unknown>[];
|
|
2
19
|
/**
|
|
3
20
|
* Issue #83: factory for the procedures classifier. Closure state: none
|
|
4
21
|
* beyond `count` (the per-concern accumulators live on `ctx`).
|
|
22
|
+
*
|
|
23
|
+
* The body walks the declarative `RULES` table (Issue #153). The
|
|
24
|
+
* inline cascade that used to live here is now one entry in `RULES`.
|
|
5
25
|
*/
|
|
6
26
|
export declare function createProceduresClassifier(): VbaClassifier;
|
|
7
27
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"procedures.d.ts","sourceRoot":"","sources":["../../../src/extraction/vba/procedures.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"procedures.d.ts","sourceRoot":"","sources":["../../../src/extraction/vba/procedures.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACzE,OAAO,EAAyB,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAmBnE;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,KAAK,EAAE,SAAS,iBAAiB,CAAC,OAAO,CAAC,EAoNtD,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,0BAA0B,IAAI,aAAa,CAgB1D;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,mBAAmB,EAAE,GAAG,EAAE,MAAM,GAAG,QAAQ,EAAE,CAOjF"}
|
|
@@ -33,6 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.RULES = void 0;
|
|
36
37
|
exports.createProceduresClassifier = createProceduresClassifier;
|
|
37
38
|
exports.sweepProcedures = sweepProcedures;
|
|
38
39
|
/**
|
|
@@ -45,6 +46,7 @@ const path = __importStar(require("path"));
|
|
|
45
46
|
const tree_sitter_helpers_1 = require("../tree-sitter-helpers");
|
|
46
47
|
const constants_1 = require("./constants");
|
|
47
48
|
const text_utils_1 = require("./text-utils");
|
|
49
|
+
const rules_1 = require("./rules");
|
|
48
50
|
/**
|
|
49
51
|
* Parse a `Function`/`Property Get` declaration's return type — the `As
|
|
50
52
|
* <Type>` that follows the parameter list (or the name, for a paren-less
|
|
@@ -63,23 +65,31 @@ function parseReturnType(line) {
|
|
|
63
65
|
return m[1] ?? m[2] ?? null;
|
|
64
66
|
}
|
|
65
67
|
/**
|
|
66
|
-
* Issue #
|
|
67
|
-
*
|
|
68
|
+
* Issue #153: the declarative rule table for the procedures concern.
|
|
69
|
+
* One rule — `procedure` — matches a `Sub` / `Function` /
|
|
70
|
+
* `Property Get|Let|Set` declaration and emits the function node,
|
|
71
|
+
* the `localProcs` / `functionNodeByName` / `functionNodeByStartLine`
|
|
72
|
+
* / `functionReturnTypes` registration, and (for form code-behind)
|
|
73
|
+
* the synthesized `event-handler` edge.
|
|
74
|
+
*
|
|
75
|
+
* The emit body is intentionally not split across multiple rules —
|
|
76
|
+
* these are 5+ small operations that all fire on the same declaration
|
|
77
|
+
* line. Splitting them would force the orchestrator to know they
|
|
78
|
+
* always co-occur, which is more coupling than the original cascade
|
|
79
|
+
* had. The pattern is the discriminating surface; everything past
|
|
80
|
+
* `match` is one emit.
|
|
68
81
|
*/
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (!m)
|
|
76
|
-
return;
|
|
82
|
+
exports.RULES = [
|
|
83
|
+
(0, rules_1.defineRule)({
|
|
84
|
+
id: 'procedure',
|
|
85
|
+
description: 'Match a `Sub` / `Function` / `Property Get|Let|Set <Name>(...) [As <Type>]` declaration; emit a function node, register the proc in `localProcs` / `functionNodeByName` / `functionNodeByStartLine` / `functionReturnTypes`, and (for `Form_*.cls` / `Report_*.cls`) synthesize a `form-instance-control` stub + `event-handler` edge.',
|
|
86
|
+
pattern: constants_1.PROC_RE,
|
|
87
|
+
emit: (m, ctx, line, lineNum) => {
|
|
77
88
|
const visibilityRaw = (m[1] ?? '').trim();
|
|
78
89
|
const kindRaw = (m[2] ?? '').trim().toLowerCase();
|
|
79
90
|
const name = m[3] ?? '';
|
|
80
91
|
if (!name)
|
|
81
|
-
return;
|
|
82
|
-
const lineNum = i + 1;
|
|
92
|
+
return null;
|
|
83
93
|
// Normalize the visibility. VBA's "Static" keyword is a storage
|
|
84
94
|
// specifier, not visibility, so we treat bare-static declarations as
|
|
85
95
|
// 'Public' (the default) per spec R1. "Friend" is not in the Node
|
|
@@ -269,7 +279,32 @@ function createProceduresClassifier() {
|
|
|
269
279
|
ctx.edges.push(edge);
|
|
270
280
|
ctx.pendingModuleOrClassSource.push(edge);
|
|
271
281
|
}
|
|
272
|
-
|
|
282
|
+
return { name };
|
|
283
|
+
},
|
|
284
|
+
}),
|
|
285
|
+
];
|
|
286
|
+
/**
|
|
287
|
+
* Issue #83: factory for the procedures classifier. Closure state: none
|
|
288
|
+
* beyond `count` (the per-concern accumulators live on `ctx`).
|
|
289
|
+
*
|
|
290
|
+
* The body walks the declarative `RULES` table (Issue #153). The
|
|
291
|
+
* inline cascade that used to live here is now one entry in `RULES`.
|
|
292
|
+
*/
|
|
293
|
+
function createProceduresClassifier() {
|
|
294
|
+
return {
|
|
295
|
+
name: 'procedures',
|
|
296
|
+
count: 0,
|
|
297
|
+
classifyLine(line, i, ctx) {
|
|
298
|
+
const lineNum = i + 1;
|
|
299
|
+
for (const rule of exports.RULES) {
|
|
300
|
+
const m = (0, rules_1.matchRule)(rule.pattern, line);
|
|
301
|
+
if (!m)
|
|
302
|
+
continue;
|
|
303
|
+
const result = rule.emit(m, ctx, line, lineNum);
|
|
304
|
+
if (result !== null && result !== undefined) {
|
|
305
|
+
this.count += rule.count ? rule.count(result) : 1;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
273
308
|
},
|
|
274
309
|
};
|
|
275
310
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"procedures.js","sourceRoot":"","sources":["../../../src/extraction/vba/procedures.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"procedures.js","sourceRoot":"","sources":["../../../src/extraction/vba/procedures.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2QA,gEAgBC;AASD,0CAOC;AA3SD;;;;;GAK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AAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;IAC3C,CAAC;IACD,OAAO,GAAG,CAAC,UAAU,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VbaExtractionRule — the declarative rule shape every VBA classifier
|
|
3
|
+
* exports as a `RULES: VbaExtractionRule[]` constant. Issue #153.
|
|
4
|
+
*
|
|
5
|
+
* Before this refactor the per-concern sweepers under `src/extraction/vba/`
|
|
6
|
+
* encoded their rules as inline `if (RE.test(line)) { ... }` branches
|
|
7
|
+
* inside `classifyLine`. Each branch was hard to enumerate, impossible
|
|
8
|
+
* to unit-test in isolation, and easy to silently drop when refactoring
|
|
9
|
+
* the body of a sweep. The rule table here promotes the pattern →
|
|
10
|
+
* emit-mapping to a typed object so:
|
|
11
|
+
*
|
|
12
|
+
* 1. Every rule has a stable `id` (used in error messages, logs, and
|
|
13
|
+
* as a stable handle for tools that consume the rule table).
|
|
14
|
+
* 2. The pattern is explicit (single RegExp or RegExp[]) — the
|
|
15
|
+
* dispatcher knows exactly what to test, no "branched control flow
|
|
16
|
+
* around the regex".
|
|
17
|
+
* 3. The emit function is the ONLY side effect for the rule — pure
|
|
18
|
+
* given (match, ctx, line, lineNum) → T | null. That makes the
|
|
19
|
+
* rule trivially testable in isolation.
|
|
20
|
+
* 4. The `count?` hook lets a rule report "N symbols emitted" without
|
|
21
|
+
* sharing an accumulator with the orchestrator (each rule owns
|
|
22
|
+
* its own count semantics).
|
|
23
|
+
*
|
|
24
|
+
* Inter-line state (procedure stack, With stack, SQL variables) STILL
|
|
25
|
+
* lives on `VbaExtractorContext` — the rule table is per-line. The
|
|
26
|
+
* `classifyLine` orchestrator inside each classifier is the "shell"
|
|
27
|
+
* that maintains the state machine and walks the rule table.
|
|
28
|
+
*/
|
|
29
|
+
import type { VbaExtractorContext } from './context';
|
|
30
|
+
/**
|
|
31
|
+
* A single per-line rule the orchestrator dispatches.
|
|
32
|
+
*
|
|
33
|
+
* @typeParam T - The shape `emit` returns. Most rules return
|
|
34
|
+
* `void | null` because they push directly onto `ctx.nodes` /
|
|
35
|
+
* `ctx.edges` (the canonical VBA sweep idiom). Rules that
|
|
36
|
+
* synthesize a specific symbol can narrow `T` to the symbol's
|
|
37
|
+
* shape so `count?` and downstream consumers get a typed handle.
|
|
38
|
+
*
|
|
39
|
+
* Fields:
|
|
40
|
+
*
|
|
41
|
+
* - `id` Stable, human-readable identifier (e.g. `'implements'`,
|
|
42
|
+
* `'procedure'`, `'dim'`, `'sql-in-strings'`). The rule
|
|
43
|
+
* table's primary key — every id within one file must be
|
|
44
|
+
* unique. Used in error messages and in the test suite
|
|
45
|
+
* that pins the table's shape.
|
|
46
|
+
* - `description` One-line plain-English summary. Surfaced in tooling
|
|
47
|
+
* that introspects the table.
|
|
48
|
+
* - `pattern` The regex (or regex alternatives) the dispatcher tests
|
|
49
|
+
* against the per-line source. Either a single `RegExp`
|
|
50
|
+
* or a non-empty `RegExp[]` (a rule is matched when ANY
|
|
51
|
+
* of the alternatives matches). The dispatcher runs
|
|
52
|
+
* `.exec()` for single regexes and iterates for arrays.
|
|
53
|
+
* - `requires?` Optional structural gate. `'class'` means the rule
|
|
54
|
+
* only fires inside a `.cls` file; `'module'` only in
|
|
55
|
+
* `.bas`/`.frm`/`.dsr`; `'inside-procedure'` only when
|
|
56
|
+
* `ctx.procStack.length > 0`. The orchestrator is
|
|
57
|
+
* expected to honour this — keeping the gate declarative
|
|
58
|
+
* lets the rule own its own preconditions instead of
|
|
59
|
+
* scattering `if` checks into the rule body.
|
|
60
|
+
* - `scan?` `'masked'` = run on the string-literal-masked line
|
|
61
|
+
* (so call patterns inside `"..."` are ignored), the
|
|
62
|
+
* default. `'unmasked'` = run on the original line (so
|
|
63
|
+
* SQL patterns inside `"..."` are caught). `'both'` =
|
|
64
|
+
* dispatcher calls the rule twice, once with each line.
|
|
65
|
+
* - `emit` The per-match side effect. Receives the
|
|
66
|
+
* `RegExpExecArray` from the pattern, the shared
|
|
67
|
+
* `VbaExtractorContext`, the original (or masked) line,
|
|
68
|
+
* and the 1-based line number. Returns the symbol it
|
|
69
|
+
* emitted (used by `count?`) or `null` when the match
|
|
70
|
+
* didn't apply (the caller is expected to skip
|
|
71
|
+
* `count?` in that case).
|
|
72
|
+
* - `count?` Optional counter. When the rule emits exactly one
|
|
73
|
+
* symbol per successful match the orchestrator can
|
|
74
|
+
* treat `1` as the implicit count; the hook is for
|
|
75
|
+
* rules whose emit can fan out (e.g. a multi-variable
|
|
76
|
+
* `Dim a As Foo, b As Bar` line that produces two
|
|
77
|
+
* `references` edges from one match).
|
|
78
|
+
*
|
|
79
|
+
* The `count` parameter is typed as `unknown` to keep the
|
|
80
|
+
* `VbaExtractionRule<T>` shape covariant in `T` — narrowing `T`
|
|
81
|
+
* (e.g. to `{ edges: number }` for the dim-decl fan-out rule) does
|
|
82
|
+
* NOT then force `count` to take that narrower type, which would
|
|
83
|
+
* break the `VbaExtractionRule<unknown>[]` aggregate. Rule
|
|
84
|
+
* authors cast inside their `count` body.
|
|
85
|
+
*/
|
|
86
|
+
export interface VbaExtractionRule<T = unknown> {
|
|
87
|
+
readonly id: string;
|
|
88
|
+
readonly description: string;
|
|
89
|
+
readonly pattern: RegExp | RegExp[];
|
|
90
|
+
readonly requires?: 'class' | 'module' | 'inside-procedure' | string;
|
|
91
|
+
readonly scan?: 'masked' | 'unmasked' | 'both';
|
|
92
|
+
readonly emit: (match: RegExpMatchArray, ctx: VbaExtractorContext, line: string, lineNum: number) => T | null;
|
|
93
|
+
readonly count?: (result: unknown) => number;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Helper to build a `VbaExtractionRule<T>` with a single RegExp.
|
|
97
|
+
* Most rules are 1-line declarations; this collapses the boilerplate
|
|
98
|
+
* to one place.
|
|
99
|
+
*/
|
|
100
|
+
export declare function defineRule<T = unknown>(spec: Omit<VbaExtractionRule<T>, 'pattern'> & {
|
|
101
|
+
pattern: RegExp;
|
|
102
|
+
}): VbaExtractionRule<T>;
|
|
103
|
+
/**
|
|
104
|
+
* Helper to build a `VbaExtractionRule<T>` whose `pattern` is an array
|
|
105
|
+
* of alternative regexes. The dispatcher treats the rule as matched
|
|
106
|
+
* when ANY alternative matches; it runs the alternatives in order and
|
|
107
|
+
* uses the first match's `RegExpExecArray` for `emit`.
|
|
108
|
+
*/
|
|
109
|
+
export declare function defineRuleAlternatives<T = unknown>(spec: Omit<VbaExtractionRule<T>, 'pattern'> & {
|
|
110
|
+
pattern: RegExp[];
|
|
111
|
+
}): VbaExtractionRule<T>;
|
|
112
|
+
/**
|
|
113
|
+
* Run a single rule's `pattern` against `line` and return the first
|
|
114
|
+
* match's `RegExpMatchArray`, or `null` when no alternative matches.
|
|
115
|
+
* `pattern` is `RegExp | RegExp[]` (an array means "match any of
|
|
116
|
+
* these alternatives"); this helper normalizes both into the same
|
|
117
|
+
* `RegExpMatchArray | null` shape the dispatcher's `emit` expects.
|
|
118
|
+
*
|
|
119
|
+
* Every classifier's `classifyLine` walks the declarative `RULES`
|
|
120
|
+
* table via this helper. Centralizing the RegExp/RegExp[] branching
|
|
121
|
+
* here keeps the per-classifier dispatcher loops trivial and avoids
|
|
122
|
+
* each classifier re-implementing the same boilerplate.
|
|
123
|
+
*/
|
|
124
|
+
export declare function matchRule(pattern: RegExp | RegExp[], line: string): RegExpMatchArray | null;
|
|
125
|
+
//# sourceMappingURL=rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../../src/extraction/vba/rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAErD;;;;;;;;;;;;;;;;;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IAAI,CASzB"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defineRule = defineRule;
|
|
4
|
+
exports.defineRuleAlternatives = defineRuleAlternatives;
|
|
5
|
+
exports.matchRule = matchRule;
|
|
6
|
+
/**
|
|
7
|
+
* Helper to build a `VbaExtractionRule<T>` with a single RegExp.
|
|
8
|
+
* Most rules are 1-line declarations; this collapses the boilerplate
|
|
9
|
+
* to one place.
|
|
10
|
+
*/
|
|
11
|
+
function defineRule(spec) {
|
|
12
|
+
return spec;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Helper to build a `VbaExtractionRule<T>` whose `pattern` is an array
|
|
16
|
+
* of alternative regexes. The dispatcher treats the rule as matched
|
|
17
|
+
* when ANY alternative matches; it runs the alternatives in order and
|
|
18
|
+
* uses the first match's `RegExpExecArray` for `emit`.
|
|
19
|
+
*/
|
|
20
|
+
function defineRuleAlternatives(spec) {
|
|
21
|
+
if (spec.pattern.length === 0) {
|
|
22
|
+
throw new Error(`defineRuleAlternatives: rule "${spec.id}" has an empty pattern[]`);
|
|
23
|
+
}
|
|
24
|
+
return spec;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Run a single rule's `pattern` against `line` and return the first
|
|
28
|
+
* match's `RegExpMatchArray`, or `null` when no alternative matches.
|
|
29
|
+
* `pattern` is `RegExp | RegExp[]` (an array means "match any of
|
|
30
|
+
* these alternatives"); this helper normalizes both into the same
|
|
31
|
+
* `RegExpMatchArray | null` shape the dispatcher's `emit` expects.
|
|
32
|
+
*
|
|
33
|
+
* Every classifier's `classifyLine` walks the declarative `RULES`
|
|
34
|
+
* table via this helper. Centralizing the RegExp/RegExp[] branching
|
|
35
|
+
* here keeps the per-classifier dispatcher loops trivial and avoids
|
|
36
|
+
* each classifier re-implementing the same boilerplate.
|
|
37
|
+
*/
|
|
38
|
+
function matchRule(pattern, line) {
|
|
39
|
+
if (Array.isArray(pattern)) {
|
|
40
|
+
for (const re of pattern) {
|
|
41
|
+
const m = re.exec(line);
|
|
42
|
+
if (m)
|
|
43
|
+
return m;
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
return pattern.exec(line);
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../../src/extraction/vba/rules.ts"],"names":[],"mappings":";;AA0GA,gCAIC;AAQD,wDASC;AAcD,8BAYC;AApDD;;;;GAIG;AACH,SAAgB,UAAU,CACxB,IAAiE;IAEjE,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,SAAgB,sBAAsB,CACpC,IAAmE;IAEnE,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CACb,iCAAiC,IAAI,CAAC,EAAE,0BAA0B,CACnE,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAgB,SAAS,CACvB,OAA0B,EAC1B,IAAY;IAEZ,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3B,KAAK,MAAM,EAAE,IAAI,OAAO,EAAE,CAAC;YACzB,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACxB,IAAI,CAAC;gBAAE,OAAO,CAAC,CAAC;QAClB,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pure text helpers shared across the VBA extraction passes. None of these
|
|
3
|
-
* touch extractor state — they are deterministic string transforms lifted
|
|
4
|
-
* out of `VbaExtractor` verbatim so each pass module can import what it needs
|
|
5
|
-
* without pulling in the orchestrator.
|
|
6
|
-
*/
|
|
7
1
|
/**
|
|
8
2
|
* Fold a VBA visibility keyword to the canonical lowercase enum, matching
|
|
9
3
|
* the procedure convention: `Private` → 'private'; `Public`, `Global`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-utils.d.ts","sourceRoot":"","sources":["../../../src/extraction/vba/text-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"text-utils.d.ts","sourceRoot":"","sources":["../../../src/extraction/vba/text-utils.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAEhE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA4BtD;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,GACX,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,CAc/C;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CA0BjF;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAW/E;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAgB1D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,GACX;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAWnD"}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Pure text helpers shared across the VBA extraction passes. None of these
|
|
4
|
-
* touch extractor state — they are deterministic string transforms lifted
|
|
5
|
-
* out of `VbaExtractor` verbatim so each pass module can import what it needs
|
|
6
|
-
* without pulling in the orchestrator.
|
|
7
|
-
*/
|
|
8
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
3
|
exports.foldVisibility = foldVisibility;
|
|
10
4
|
exports.maskStringContent = maskStringContent;
|
|
@@ -14,6 +8,13 @@ exports.splitOutsideVbaStrings = splitOutsideVbaStrings;
|
|
|
14
8
|
exports.detectAssignmentSuffix = detectAssignmentSuffix;
|
|
15
9
|
exports.unwrapVbaStringLiteral = unwrapVbaStringLiteral;
|
|
16
10
|
exports.parseEventHandlerName = parseEventHandlerName;
|
|
11
|
+
/**
|
|
12
|
+
* Pure text helpers shared across the VBA extraction passes. None of these
|
|
13
|
+
* touch extractor state — they are deterministic string transforms lifted
|
|
14
|
+
* out of `VbaExtractor` verbatim so each pass module can import what it needs
|
|
15
|
+
* without pulling in the orchestrator.
|
|
16
|
+
*/
|
|
17
|
+
const events_1 = require("./events");
|
|
17
18
|
/**
|
|
18
19
|
* Fold a VBA visibility keyword to the canonical lowercase enum, matching
|
|
19
20
|
* the procedure convention: `Private` → 'private'; `Public`, `Global`,
|
|
@@ -190,6 +191,8 @@ function parseEventHandlerName(name) {
|
|
|
190
191
|
// Form-level events live on the form, not on a control.
|
|
191
192
|
if (controlName.toLowerCase() === 'form')
|
|
192
193
|
return null;
|
|
194
|
+
if (!(0, events_1.isAccessEventName)(eventName))
|
|
195
|
+
return null;
|
|
193
196
|
return { controlName, eventName };
|
|
194
197
|
}
|
|
195
198
|
//# sourceMappingURL=text-utils.js.map
|