@aroman22/codegraph-vba 1.5.2 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/bin/codegraph.d.ts +1 -1
- package/dist/bin/command-supervision.d.ts +38 -1
- package/dist/db/index.d.ts +84 -5
- package/dist/db/migrations.d.ts +1 -1
- package/dist/db/queries.d.ts +116 -4
- package/dist/db/wal-valve.d.ts +106 -0
- package/dist/directory.d.ts +9 -5
- package/dist/extraction/cfml-extractor.d.ts +107 -0
- package/dist/extraction/grammars.d.ts +25 -1
- package/dist/extraction/index.d.ts +47 -2
- package/dist/extraction/languages/arkts.d.ts +3 -0
- package/dist/extraction/languages/c-cpp.d.ts +98 -0
- package/dist/extraction/languages/cfquery.d.ts +12 -0
- package/dist/extraction/languages/cfscript.d.ts +3 -0
- package/dist/extraction/languages/cobol.d.ts +33 -0
- package/dist/extraction/languages/erlang.d.ts +3 -0
- package/dist/extraction/languages/nix.d.ts +3 -0
- package/dist/extraction/languages/solidity.d.ts +3 -0
- package/dist/extraction/languages/terraform.d.ts +3 -0
- package/dist/extraction/languages/vbnet.d.ts +11 -0
- package/dist/extraction/mybatis-extractor.d.ts +30 -10
- package/dist/extraction/parse-pool.d.ts +28 -1
- package/dist/extraction/tree-sitter-types.d.ts +20 -1
- package/dist/extraction/tree-sitter.d.ts +60 -1
- package/dist/extraction/vba/call-sweep.d.ts +3 -0
- package/dist/extraction/vba/calls.d.ts +55 -0
- package/dist/extraction/vba/constants.d.ts +42 -0
- package/dist/extraction/vba/context.d.ts +175 -0
- package/dist/extraction/vba/controls.d.ts +24 -0
- package/dist/extraction/vba/declarations.d.ts +3 -0
- package/dist/extraction/vba/dims.d.ts +3 -0
- package/dist/extraction/vba/docmd.d.ts +16 -0
- package/dist/extraction/vba/enums-consts.d.ts +15 -0
- package/dist/extraction/vba/implements.d.ts +3 -0
- package/dist/extraction/vba/procedures.d.ts +3 -0
- package/dist/extraction/vba/sql-wrapper.d.ts +17 -0
- package/dist/extraction/vba/tempvars.d.ts +10 -0
- package/dist/extraction/vba/text-utils.d.ts +73 -0
- package/dist/extraction/vba-extractor.d.ts +3 -951
- package/dist/extraction/vba-preprocess.d.ts +1 -1
- package/dist/index.d.ts +81 -1
- package/dist/installer/index.d.ts +42 -0
- package/dist/mcp/daemon.d.ts +35 -3
- package/dist/mcp/early-ppid.d.ts +26 -0
- package/dist/mcp/liveness-watchdog.d.ts +18 -1
- package/dist/mcp/query-pool.d.ts +14 -0
- package/dist/mcp/session.d.ts +14 -0
- package/dist/mcp/startup-handshake.d.ts +44 -0
- package/dist/mcp/tools.d.ts +22 -0
- package/dist/project-config.d.ts +44 -0
- package/dist/resolution/c-fnptr-synthesizer.d.ts +2 -1
- package/dist/resolution/callback-synthesizer.d.ts +1 -1
- package/dist/resolution/cooperative-yield.d.ts +32 -0
- package/dist/resolution/frameworks/cics.d.ts +20 -0
- package/dist/resolution/frameworks/terraform.d.ts +38 -0
- package/dist/resolution/goframe-synthesizer.d.ts +2 -1
- package/dist/resolution/import-resolver.d.ts +7 -0
- package/dist/resolution/index.d.ts +64 -2
- package/dist/resolution/name-matcher.d.ts +22 -3
- package/dist/resolution/strip-comments.d.ts +1 -1
- package/dist/resolution/types.d.ts +29 -0
- package/dist/resolution/workspace-packages.d.ts +10 -0
- package/dist/search/identifier-segments.d.ts +60 -0
- package/dist/sync/watcher.d.ts +10 -5
- package/dist/sync/worktree.d.ts +9 -0
- package/dist/types.d.ts +25 -2
- package/dist/upgrade/index.d.ts +32 -0
- package/dist/upgrade/remove-binary.d.ts +87 -0
- package/dist/upgrade/update-check.d.ts +92 -0
- package/npm-shim.js +32 -3
- package/package.json +7 -7
- package/dist/reasoning/config.d.ts +0 -45
- package/dist/reasoning/credentials.d.ts +0 -5
- package/dist/reasoning/login.d.ts +0 -21
- package/dist/reasoning/reasoner.d.ts +0 -43
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { VbaExtractorContext, ProcInfo } from './context';
|
|
2
|
+
export declare function scanRaiseEvents(ctx: VbaExtractorContext, line: string, from: ProcInfo, lineNum: number): void;
|
|
3
|
+
export declare function scanCallSites(ctx: VbaExtractorContext, line: string, from: ProcInfo, lineNum: number): void;
|
|
4
|
+
/**
|
|
5
|
+
* Issue #45: split a single-line VBA `If <cond> Then <body>` into one or
|
|
6
|
+
* more statement-clause fragments the statement-call detectors can process
|
|
7
|
+
* (`If x Then Foo Else Bar`, colon-separated `If x Then DoA: DoB`). When the
|
|
8
|
+
* line is not a single-line `If … Then` shape, returns `[<line>]` so
|
|
9
|
+
* block-form `If` still works through the per-line scan. `GoTo`/`Exit`/
|
|
10
|
+
* `Resume` clauses are filtered out. `line` is the string-literal-masked
|
|
11
|
+
* scan line, which makes global `:`/`Else` splitting safe.
|
|
12
|
+
*/
|
|
13
|
+
export declare function splitSingleLineIfClauses(line: string): string[];
|
|
14
|
+
/**
|
|
15
|
+
* H1: detect a statement-form Sub call (`MySub`, `MySub arg1, x`,
|
|
16
|
+
* `Call MySub arg1`). Returns the called proc name, or null for
|
|
17
|
+
* declarations, assignments, comments, keyword lines, and the paren form
|
|
18
|
+
* (handled by CALL_RE).
|
|
19
|
+
*/
|
|
20
|
+
export declare function detectStatementCall(line: string): string | null;
|
|
21
|
+
/**
|
|
22
|
+
* H1: emit a same-file `calls` edge for a statement-form Sub call to the
|
|
23
|
+
* already-emitted function node named `procName`.
|
|
24
|
+
*/
|
|
25
|
+
export declare function emitStatementCallEdge(ctx: VbaExtractorContext, caller: ProcInfo, procName: string, lineNum: number): void;
|
|
26
|
+
/**
|
|
27
|
+
* Fix 7: detect a qualified statement-form call — `Receiver.Member <args>`
|
|
28
|
+
* where `Receiver.Member` is NOT followed by `(`. Distinct from the paren
|
|
29
|
+
* form (handled by CALL_RE). Property assignments and blacklisted
|
|
30
|
+
* receivers/members are excluded. Returns `{receiver, member}` or null.
|
|
31
|
+
*/
|
|
32
|
+
export declare function detectQualifiedStatementCall(line: string): {
|
|
33
|
+
receiver: string;
|
|
34
|
+
member: string;
|
|
35
|
+
} | null;
|
|
36
|
+
/**
|
|
37
|
+
* Fix 7: emit a heuristic `calls` edge for a qualified statement-form call.
|
|
38
|
+
* Same shape as the qualified-paren path in `scanCallSites` — reuses the
|
|
39
|
+
* same `callDedupe` / `synthFunctionNodeIds` sets so a paren and non-paren
|
|
40
|
+
* form on the same line don't create duplicate edges.
|
|
41
|
+
*/
|
|
42
|
+
export declare function emitQualifiedStatementCallEdge(ctx: VbaExtractorContext, caller: ProcInfo, receiver: string, member: string, lineNum: number): void;
|
|
43
|
+
/**
|
|
44
|
+
* Issue #43: normalize the receiver of a `With <expr>` block to a bare
|
|
45
|
+
* identifier, or null when it is a keyword / runtime object / unparseable.
|
|
46
|
+
*/
|
|
47
|
+
export declare function normalizeWithReceiver(expr: string): string | null;
|
|
48
|
+
/**
|
|
49
|
+
* Issue #43: detect a `.Member` call inside a `With` block (leading-dot
|
|
50
|
+
* member reference that is a call, not a property assignment).
|
|
51
|
+
*/
|
|
52
|
+
export declare function detectWithMemberCall(line: string): {
|
|
53
|
+
member: string;
|
|
54
|
+
} | null;
|
|
55
|
+
//# sourceMappingURL=calls.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared regexes and lookup sets used by more than one VBA extraction pass.
|
|
3
|
+
* Kept in a leaf module so the per-concern pass modules can import them
|
|
4
|
+
* without depending on each other or on the orchestrator.
|
|
5
|
+
*/
|
|
6
|
+
/** Sub/Function/Property regex — captures visibility prefix, kind, and name. */
|
|
7
|
+
export declare const PROC_RE: RegExp;
|
|
8
|
+
/**
|
|
9
|
+
* Issue #52: shared `End Sub` / `End Function` / `End Property` marker.
|
|
10
|
+
* Promoted from a local regex in `sweepCallsAndSql` so `sweepEnumsAndConsts`
|
|
11
|
+
* can walk the same proc boundaries and decide Const scope per line.
|
|
12
|
+
* The `(?:^|:\s*)` prefix tolerates colon-separated single-line procs
|
|
13
|
+
* (`Public Sub X(): ... : End Sub`) so the proc stack pops on the same
|
|
14
|
+
* physical line.
|
|
15
|
+
*/
|
|
16
|
+
export declare const PROCEDURE_END_RE: RegExp;
|
|
17
|
+
/**
|
|
18
|
+
* VBA primitive type names — skipped when emitted as Dim targets so
|
|
19
|
+
* we don't pollute the graph with `As Long` / `As String` references.
|
|
20
|
+
* Fix 4: all entries are LOWERCASE and the lookup lowercases the
|
|
21
|
+
* captured type name so `As long`, `As LONG`, `As Long` all match.
|
|
22
|
+
* Fix 1 (Issue #1): added `'new'` as a backstop so that if the `As New`
|
|
23
|
+
* pattern is ever captured as a type name it is silently skipped.
|
|
24
|
+
*/
|
|
25
|
+
export declare const PRIMITIVE_TYPES: Set<string>;
|
|
26
|
+
/** Keywords we never want to match as call receivers. */
|
|
27
|
+
export declare const CALL_KEYWORD_BLACKLIST: Set<string>;
|
|
28
|
+
/**
|
|
29
|
+
* Access runtime objects and singletons. Calls on these receivers are
|
|
30
|
+
* real VBA calls but the targets are NOT user-defined modules or
|
|
31
|
+
* classes — they're Access/DAO/ADO runtime types. Synthesizing a
|
|
32
|
+
* `function` node for each would pollute the graph with ~20+ junk
|
|
33
|
+
* nodes per real-world file (audit W4, June 2026). Skip synthesis
|
|
34
|
+
* for any receiver or member in this set.
|
|
35
|
+
*
|
|
36
|
+
* Note: `DoCmd.RunSQL`, `DoCmd.OpenForm`, etc. still get SQL/edge
|
|
37
|
+
* tracking via the dedicated `SQL_WRAPPERS` regex path (REQ-CODE-8),
|
|
38
|
+
* which fires BEFORE this scan and uses its own dispatch — so
|
|
39
|
+
* blacklisting DoCmd here doesn't lose the SQL-flow edges.
|
|
40
|
+
*/
|
|
41
|
+
export declare const RUNTIME_RECEIVER_BLACKLIST: Set<string>;
|
|
42
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VbaExtractorContext — the shared state + shared helpers threaded through
|
|
3
|
+
* every VBA extraction pass.
|
|
4
|
+
*
|
|
5
|
+
* It owns the node/edge/reference accumulators, the per-file lookup maps
|
|
6
|
+
* (`localProcs`, `functionNodeByName`, `localVarTypeMap`, `localConstants`,
|
|
7
|
+
* `localEvents`), the lazily-created module/class node, and the de-dup caches.
|
|
8
|
+
* The per-concern sweeps under `src/extraction/vba/*` are free functions that
|
|
9
|
+
* take a `VbaExtractorContext` and read/write this shared state; the handful
|
|
10
|
+
* of helpers that more than one sweep needs (`emitReference`,
|
|
11
|
+
* `pushContainsFromModule`, `findOrCreateFunctionNodeId`, the qualified-call
|
|
12
|
+
* gates, and the per-scope Const lookup) live here as methods.
|
|
13
|
+
*/
|
|
14
|
+
import { Node, Edge, ExtractionError, UnresolvedReference } from '../../types';
|
|
15
|
+
export interface ProcInfo {
|
|
16
|
+
name: string;
|
|
17
|
+
qualifiedName: string;
|
|
18
|
+
kind: 'sub' | 'function' | 'property';
|
|
19
|
+
visibility: 'public' | 'private' | 'protected' | 'internal';
|
|
20
|
+
startLine: number;
|
|
21
|
+
}
|
|
22
|
+
export declare class VbaExtractorContext {
|
|
23
|
+
filePath: string;
|
|
24
|
+
nodes: Node[];
|
|
25
|
+
edges: Edge[];
|
|
26
|
+
errors: ExtractionError[];
|
|
27
|
+
unresolvedReferences: UnresolvedReference[];
|
|
28
|
+
moduleOrClassNode: Node | null;
|
|
29
|
+
/**
|
|
30
|
+
* Class-name prefix for `qualifiedName` composition.
|
|
31
|
+
*
|
|
32
|
+
* B3 (hueco 5): for `.cls` files every function node's `qualifiedName`
|
|
33
|
+
* is composed as `${className}.${procName}` (e.g. `Form_TestForm.Form_Load`)
|
|
34
|
+
* so cross-class callers can disambiguate which form each `Form_Load`
|
|
35
|
+
* belongs to. For `.bas` files this is `null` — module-scoped procs keep
|
|
36
|
+
* their bare-name `qualifiedName`. Resolved once per `extract()` from
|
|
37
|
+
* `isCls` + `vbName`; `sweepProcedures` reads it.
|
|
38
|
+
*/
|
|
39
|
+
classNamePrefix: string | null;
|
|
40
|
+
/**
|
|
41
|
+
* Map of procedure name (within this file) → list of ProcInfo. The list
|
|
42
|
+
* (rather than a single value) is needed because VBA allows multiple
|
|
43
|
+
* Property accessors with the same name: `Property Get Foo`, `Property
|
|
44
|
+
* Let Foo`, and `Property Set Foo` all share the name `Foo`.
|
|
45
|
+
*/
|
|
46
|
+
localProcs: Map<string, ProcInfo[]>;
|
|
47
|
+
/**
|
|
48
|
+
* Cache: procedure name → first matching function node emitted for that
|
|
49
|
+
* name (audit S2 — O(1) same-file call resolution).
|
|
50
|
+
*/
|
|
51
|
+
functionNodeByName: Map<string, Node>;
|
|
52
|
+
/**
|
|
53
|
+
* Cache: startLine → function node emitted for that line. When Property
|
|
54
|
+
* Get/Let/Set share a name, we find the SPECIFIC accessor's node by its
|
|
55
|
+
* declaration line (Fix 1).
|
|
56
|
+
*/
|
|
57
|
+
functionNodeByStartLine: Map<number, Node>;
|
|
58
|
+
/** Edges whose source needs to be set to the module/class id once it exists. */
|
|
59
|
+
pendingModuleOrClassSource: Edge[];
|
|
60
|
+
/** Cache so we don't re-emit the same proc function node per call site. */
|
|
61
|
+
procNodeIdCache: Map<string, string>;
|
|
62
|
+
callDedupe: Set<string>;
|
|
63
|
+
synthFunctionNodeIds: Set<string>;
|
|
64
|
+
/**
|
|
65
|
+
* B4 (hueco 6) extended by Issue #48: cache of stub node ids we've already
|
|
66
|
+
* emitted for a given (method, target name) pair in this file. Keyed by
|
|
67
|
+
* `${cacheKey}:${lowerName}` so the OpenForm and OpenReport de-dup buckets
|
|
68
|
+
* stay disjoint.
|
|
69
|
+
*/
|
|
70
|
+
opensStubIdsByKey: Map<string, string>;
|
|
71
|
+
synthClassNodeIds: Set<string>;
|
|
72
|
+
/**
|
|
73
|
+
* Issue #50: TempVars placeholder-node de-dup cache. Keys are the
|
|
74
|
+
* deterministic node ids produced by `emitTempVarReference` — those ids
|
|
75
|
+
* intentionally use a synthetic `synthetic:tempvar/<key>` path so the SAME
|
|
76
|
+
* key referenced from Form_A.cls AND Form_B.cls collapses to ONE node.
|
|
77
|
+
*/
|
|
78
|
+
synthTempVarNodeIds: Set<string>;
|
|
79
|
+
/**
|
|
80
|
+
* Maps `variableName.toLowerCase()` → declared type info.
|
|
81
|
+
* Built by `sweepDimsAndWithEvents`; consulted by the unified qualified-call
|
|
82
|
+
* gate (`shouldProcessQualifiedCall`) so declared project-class locals emit
|
|
83
|
+
* edges, declared primitive/external locals stay silent, and undeclared
|
|
84
|
+
* receivers remain module-name candidates for the resolver (Fix 2 / Issue #2).
|
|
85
|
+
*/
|
|
86
|
+
localVarTypeMap: Map<string, {
|
|
87
|
+
outer: string;
|
|
88
|
+
qualified: boolean;
|
|
89
|
+
withEvents?: boolean;
|
|
90
|
+
variableName?: string;
|
|
91
|
+
assignedWithSet?: boolean;
|
|
92
|
+
}>;
|
|
93
|
+
/**
|
|
94
|
+
* Issue #52: Const resolution buckets, scoped per procedure. Key is
|
|
95
|
+
* `'module'` for module-level Consts, or the procedure's `startLine`
|
|
96
|
+
* (stringified) for proc-local Consts. Each bucket maps the lowercase
|
|
97
|
+
* constant name to its simple-literal value (used by `DoCmd.OpenForm` /
|
|
98
|
+
* `OpenReport` / `OpenQuery` argument resolution via `resolveLocalConst`).
|
|
99
|
+
*/
|
|
100
|
+
localConstants: Map<'module' | string, Map<string, string>>;
|
|
101
|
+
/**
|
|
102
|
+
* Issue #52: the current Const-lookup scope. `'module'` when no procedure
|
|
103
|
+
* is open, otherwise the top-of-stack proc's `startLine` as a string. Both
|
|
104
|
+
* `sweepEnumsAndConsts` and `sweepCallsAndSql` keep this in sync with their
|
|
105
|
+
* per-line stack walk.
|
|
106
|
+
*/
|
|
107
|
+
currentProcKey: 'module' | string;
|
|
108
|
+
/**
|
|
109
|
+
* Issue #52: per-extraction proc-stack shared between `sweepEnumsAndConsts`
|
|
110
|
+
* and `sweepCallsAndSql`. Each sweep clears it at the start so the file's
|
|
111
|
+
* mid-proc structural state never leaks across sweeps. Holds the `startLine`
|
|
112
|
+
* of every procedure whose `End` marker the sweep has not yet seen.
|
|
113
|
+
*/
|
|
114
|
+
procStack: number[];
|
|
115
|
+
/** Local event name (lowercase) → event node for `RaiseEvent` edge emission. */
|
|
116
|
+
localEvents: Map<string, Node>;
|
|
117
|
+
constructor(filePath: string);
|
|
118
|
+
/**
|
|
119
|
+
* Emit a `contains` edge from the (lazily-created) module/class node to
|
|
120
|
+
* `targetId`. Mirrors the pending-source pattern the procedure and
|
|
121
|
+
* implements sweeps use: the module node doesn't exist yet, so the edge's
|
|
122
|
+
* source is rewritten once `extract()` creates it.
|
|
123
|
+
*/
|
|
124
|
+
pushContainsFromModule(targetId: string): void;
|
|
125
|
+
/**
|
|
126
|
+
* Fix 2 (Issue #2): return true iff `receiverName` is a file-local variable
|
|
127
|
+
* (appears in `localVarTypeMap`) whose declared type is a SIMPLE (non-
|
|
128
|
+
* qualified, non-primitive) identifier — a candidate project-defined class.
|
|
129
|
+
* Qualified types (e.g. `DAO.Recordset`) and primitives (`String`, `Long`)
|
|
130
|
+
* return false so runtime/DAO calls are suppressed. Brackets are stripped
|
|
131
|
+
* from the lookup key defensively (Issue #54).
|
|
132
|
+
*/
|
|
133
|
+
isLocalProjectClassVar(receiverName: string): boolean;
|
|
134
|
+
/**
|
|
135
|
+
* Qualified-call eligibility is intentionally shared by paren-form
|
|
136
|
+
* (`Receiver.Member(...)`) and statement-form (`Receiver.Member args`) scans:
|
|
137
|
+
* project-class locals are processed after type resolution, declared
|
|
138
|
+
* primitive/external locals are silent, and undeclared receivers remain
|
|
139
|
+
* candidate module names.
|
|
140
|
+
*/
|
|
141
|
+
shouldProcessQualifiedCall(receiverName: string): boolean;
|
|
142
|
+
/**
|
|
143
|
+
* #12a: resolve the "receiver type" used to build a qualified call-stub's
|
|
144
|
+
* name/qualifiedName. When `receiverName` is a file-local variable typed
|
|
145
|
+
* as a candidate project class (`isLocalProjectClassVar`), returns the
|
|
146
|
+
* RESOLVED CLASS NAME from `localVarTypeMap` (e.g. `m_NCOp As NCOperaciones`
|
|
147
|
+
* → `'NCOperaciones'`) so the stub matches the real `.cls` method's
|
|
148
|
+
* `${className}.${proc}` shape. Otherwise returns `receiverName` unchanged
|
|
149
|
+
* (the `.bas`-qualified module call case).
|
|
150
|
+
*/
|
|
151
|
+
resolveReceiverType(receiverName: string): string;
|
|
152
|
+
findOrCreateFunctionNodeId(proc: ProcInfo): string;
|
|
153
|
+
findFunctionNodeByName(name: string): Node | undefined;
|
|
154
|
+
/**
|
|
155
|
+
* Emit a `references` edge from the file's module/class node to a synthetic
|
|
156
|
+
* node named `targetName`. Used by Dim, WithEvents, Set-New, and SQL sweeps.
|
|
157
|
+
* Fix 5: the synthetic node id is keyed on (filePath, kind, name) WITHOUT
|
|
158
|
+
* lineNum so the same type/table referenced on N lines produces ONE node.
|
|
159
|
+
*/
|
|
160
|
+
emitReference(targetName: string, lineNum: number, column: number, synthesizedBy: string): void;
|
|
161
|
+
/**
|
|
162
|
+
* Issue #52: shared lookup helper for `scanDoCmdOpenCalls` and
|
|
163
|
+
* `scanDoCmdOpenQuery`. The current scope is the procedure whose
|
|
164
|
+
* `startLine` is on top of `procStack` (or `'module'` when empty).
|
|
165
|
+
* Per-proc bucket first; module bucket is the fallback.
|
|
166
|
+
*/
|
|
167
|
+
resolveLocalConst(name: string): string | undefined;
|
|
168
|
+
/**
|
|
169
|
+
* Issue #52: shared writer. `scopeKey` is `'module'` or the procedure's
|
|
170
|
+
* startLine-as-string. Creates the bucket lazily. Returns the bucket the
|
|
171
|
+
* value was written to (mostly useful for tests).
|
|
172
|
+
*/
|
|
173
|
+
setLocalConstInScope(scopeKey: 'module' | string, name: string, value: string): Map<string, string>;
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Control-reference sweeps: `Me.<Control>` / `Me!<Control>` (hueco 1, issue
|
|
3
|
+
* #44) and cross-form `Forms!<Form>` / `Forms("<Form>")!<Ctl>` bang refs
|
|
4
|
+
* (issue #44). Both emit `UnresolvedReference`s (no synthetic `function`
|
|
5
|
+
* node) the resolver later binds to the form's controls.
|
|
6
|
+
*/
|
|
7
|
+
import { VbaExtractorContext, ProcInfo } from './context';
|
|
8
|
+
/**
|
|
9
|
+
* Hueco 1: scan a line for `Me.<ControlName>` / `Me!<ControlName>`
|
|
10
|
+
* patterns and emit one UnresolvedReference per occurrence, tagged
|
|
11
|
+
* `metadata.synthesizedBy: 'vba-me-control'`. Operates on the masked
|
|
12
|
+
* `callScanLine`. The +3 column offset skips the 3-char `Me.` / `Me!`
|
|
13
|
+
* prefix (both are 3 chars).
|
|
14
|
+
*/
|
|
15
|
+
export declare function scanMeControlReferences(ctx: VbaExtractorContext, line: string, from: ProcInfo, lineNum: number): void;
|
|
16
|
+
/**
|
|
17
|
+
* Issue #44: scan a line for cross-form bang references
|
|
18
|
+
* (`Forms!<FormName>[!<Ctl>]` and `Forms("<FormName>")!<Ctl>`) and
|
|
19
|
+
* emit ONE UnresolvedReference per match with `metadata.synthesizedBy
|
|
20
|
+
* = 'vba-forms-bang'`. Operates on the ORIGINAL (unmasked) line. The form
|
|
21
|
+
* identifier is unwrapped of surrounding `"` quotes and `[…]` brackets.
|
|
22
|
+
*/
|
|
23
|
+
export declare function scanFormsBang(ctx: VbaExtractorContext, line: string, from: ProcInfo, lineNum: number): void;
|
|
24
|
+
//# sourceMappingURL=controls.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { VbaExtractorContext, ProcInfo } from './context';
|
|
2
|
+
/**
|
|
3
|
+
* B4 (hueco 6) extended by Issue #48: scan one line of VBA source for
|
|
4
|
+
* `DoCmd.OpenX "Target"` calls where X ∈ {Form, Report}. For each match emit
|
|
5
|
+
* a cached stub node (form-layout / report-layout) and an
|
|
6
|
+
* `opens-form` / `opens-report` heuristic edge from the calling Sub.
|
|
7
|
+
*/
|
|
8
|
+
export declare function scanDoCmdOpenCalls(ctx: VbaExtractorContext, line: string, caller: ProcInfo, lineNum: number): void;
|
|
9
|
+
/**
|
|
10
|
+
* Issue #48: scan one line of VBA source for `DoCmd.OpenQuery "X"` calls.
|
|
11
|
+
* Each match emits ONE `UnresolvedReference` (NOT a stub + edge) so the
|
|
12
|
+
* resolver binds to the REAL `query` node that `SqlQueryExtractor`
|
|
13
|
+
* produces for `queries/<Name>.sql`, tagged `synthesizedBy: 'vba-opens-query'`.
|
|
14
|
+
*/
|
|
15
|
+
export declare function scanDoCmdOpenQuery(ctx: VbaExtractorContext, line: string, caller: ProcInfo, lineNum: number): void;
|
|
16
|
+
//# sourceMappingURL=docmd.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { VbaExtractorContext } from './context';
|
|
2
|
+
/**
|
|
3
|
+
* Walk the (uncommented, line-joined) source and emit:
|
|
4
|
+
* - one `enum` node per `Enum <Name>` block, with one `enum_member` node
|
|
5
|
+
* per member and a `contains` edge enum→member;
|
|
6
|
+
* - one `constant` node per name declared on a `Const` line (multi-name
|
|
7
|
+
* lines emit one node per name);
|
|
8
|
+
* - a `contains` edge from the module/class node to each enum and constant
|
|
9
|
+
* (held in `pendingModuleOrClassSource` until the module node exists).
|
|
10
|
+
*
|
|
11
|
+
* Returns the number of top-level symbols (enums + constants) emitted so
|
|
12
|
+
* the caller can flip `hasAnySymbols`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function sweepEnumsAndConsts(ctx: VbaExtractorContext, src: string): number;
|
|
15
|
+
//# sourceMappingURL=enums-consts.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { VbaExtractorContext } from './context';
|
|
2
|
+
export declare function scanSqlInLine(ctx: VbaExtractorContext, line: string, lineNum: number, dedupe: Set<string>, sqlVariables: Map<string, string>): void;
|
|
3
|
+
/**
|
|
4
|
+
* #13 fix: `sql = sql & "..."` (self-referential concatenation) must
|
|
5
|
+
* ACCUMULATE the new fragment onto whatever was already tracked for
|
|
6
|
+
* `varName`, not overwrite it. Overwriting silently dropped earlier
|
|
7
|
+
* fragments' tables — typically the initial `FROM <table>` in
|
|
8
|
+
* `sql = "SELECT * FROM tblA"` followed by `sql = sql & " WHERE x=1"`.
|
|
9
|
+
*
|
|
10
|
+
* Detection: the RHS (`m[2]`, trimmed) starts with `<varName> &`,
|
|
11
|
+
* case-insensitively — matching VBA's case-insensitive identifiers (`Sql`
|
|
12
|
+
* and `sql` are the same variable). A genuine fresh assignment (RHS does
|
|
13
|
+
* NOT start with the self-reference) still RESETS tracking — that
|
|
14
|
+
* behavior is unchanged.
|
|
15
|
+
*/
|
|
16
|
+
export declare function trackSqlVariableAssignment(lines: string[], lineIndex: number, sqlVariables: Map<string, string>): void;
|
|
17
|
+
//# sourceMappingURL=sql-wrapper.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { VbaExtractorContext, ProcInfo } from './context';
|
|
2
|
+
/**
|
|
3
|
+
* Issue #50: scan one line of VBA source for TempVars access sites and
|
|
4
|
+
* emit one `references` edge per site. Bang form scans the MASKED line,
|
|
5
|
+
* paren + Add forms scan the ORIGINAL line. Access is classified by the
|
|
6
|
+
* line suffix after the match: a bare `=` next non-whitespace char is a
|
|
7
|
+
* write (VBA has no `==`).
|
|
8
|
+
*/
|
|
9
|
+
export declare function sweepTempVars(ctx: VbaExtractorContext, maskedLine: string, originalLine: string, lineNum: number, caller: ProcInfo | undefined): void;
|
|
10
|
+
//# sourceMappingURL=tempvars.d.ts.map
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
/**
|
|
8
|
+
* Fold a VBA visibility keyword to the canonical lowercase enum, matching
|
|
9
|
+
* the procedure convention: `Private` → 'private'; `Public`, `Global`,
|
|
10
|
+
* `Friend`, or none → 'public' (VBA's default module-level `Const`/`Enum`
|
|
11
|
+
* is Private, but we follow the same broader-than-private fold the proc
|
|
12
|
+
* sweep uses so visibility is consistent across symbol kinds).
|
|
13
|
+
*/
|
|
14
|
+
export declare function foldVisibility(raw: string): 'public' | 'private';
|
|
15
|
+
/**
|
|
16
|
+
* Fix 2 (Issue #2): replace string-literal content with spaces so that
|
|
17
|
+
* call-site patterns inside `"..."` spans are invisible to CALL_RE and
|
|
18
|
+
* the statement-form detectors. Column positions are preserved (each
|
|
19
|
+
* character is replaced 1-for-1) so any col-based metadata stays correct.
|
|
20
|
+
*/
|
|
21
|
+
export declare function maskStringContent(line: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* #13 helper: escape a variable name for safe interpolation into the
|
|
24
|
+
* self-reference RegExp built by `trackSqlVariableAssignment`. VBA
|
|
25
|
+
* identifiers are alphanumeric+underscore only, so in practice nothing here
|
|
26
|
+
* ever needs escaping — this guards against regex metacharacters anyway
|
|
27
|
+
* rather than assume the input is always well-formed.
|
|
28
|
+
*/
|
|
29
|
+
export declare function escapeRegExpLiteral(value: string): string;
|
|
30
|
+
export declare function parseConstDeclarations(body: string): Array<{
|
|
31
|
+
name: string;
|
|
32
|
+
value: string | null;
|
|
33
|
+
}>;
|
|
34
|
+
export declare function splitOutsideVbaStrings(value: string, separator: string): string[];
|
|
35
|
+
/**
|
|
36
|
+
* Issue #50 helper: return true iff `line.charAt(fromIndex..)` (after the
|
|
37
|
+
* matched TempVars site, including any trailing whitespace) holds an `=`
|
|
38
|
+
* (write-assignment) and not a `==` (VBA has no `==` operator, so a bare
|
|
39
|
+
* check for `=` is safe). Used by `sweepTempVars` to classify a `TempVars`
|
|
40
|
+
* access as read vs write from the local line context.
|
|
41
|
+
*
|
|
42
|
+
* We skip over trailing whitespace only — `.`, `(`, `<`, `>`, `*`, `+`
|
|
43
|
+
* etc. all mean "this isn't an assignment target", and bare `=`
|
|
44
|
+
* is the only access-suffix shape VBA syntax allows here. A line like
|
|
45
|
+
* `TempVars!x = 1` (write) or `Debug.Print TempVars!x` (read) land in
|
|
46
|
+
* the right bucket without further analysis.
|
|
47
|
+
*
|
|
48
|
+
* Strings should already be masked out of `line` (`maskStringContent`)
|
|
49
|
+
* when this is called for the bang form (no string in scope anyway);
|
|
50
|
+
* the paren form passes the ORIGINAL line — but for THAT form the
|
|
51
|
+
* captured match ends at the closing `"` of the literal, so any `=`
|
|
52
|
+
* that follows is unambiguously outside the string.
|
|
53
|
+
*/
|
|
54
|
+
export declare function detectAssignmentSuffix(line: string, fromIndex: number): boolean;
|
|
55
|
+
export declare function unwrapVbaStringLiteral(raw: string): string;
|
|
56
|
+
/**
|
|
57
|
+
* Hueco 3 helper: parse an Access event-handler Sub name into its
|
|
58
|
+
* `<ControlName>_<EventName>` components. Returns null when the name does
|
|
59
|
+
* not match the convention, when the split yields an empty segment, or
|
|
60
|
+
* when the control name is `Form` (form-level events are NOT control
|
|
61
|
+
* handlers — `Form_Load` is the form's own lifecycle event, not a
|
|
62
|
+
* command-button click).
|
|
63
|
+
*
|
|
64
|
+
* Splitting on the LAST underscore (rather than the first) lets
|
|
65
|
+
* multi-word event names parse correctly: `ComandoAltaPM_BeforeDelConfirm`
|
|
66
|
+
* yields control=`ComandoAltaPM`, event=`BeforeDelConfirm`, not
|
|
67
|
+
* control=`ComandoAlta`, event=`PM_BeforeDelConfirm`.
|
|
68
|
+
*/
|
|
69
|
+
export declare function parseEventHandlerName(name: string): {
|
|
70
|
+
controlName: string;
|
|
71
|
+
eventName: string;
|
|
72
|
+
} | null;
|
|
73
|
+
//# sourceMappingURL=text-utils.d.ts.map
|