@colbymchenry/codegraph-darwin-arm64 1.1.6 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/codegraph +5 -0
- package/lib/dist/bin/codegraph.d.ts +1 -1
- package/lib/dist/bin/codegraph.d.ts.map +1 -1
- package/lib/dist/bin/codegraph.js +232 -61
- package/lib/dist/bin/codegraph.js.map +1 -1
- package/lib/dist/bin/command-supervision.d.ts.map +1 -1
- package/lib/dist/bin/command-supervision.js +14 -1
- package/lib/dist/bin/command-supervision.js.map +1 -1
- package/lib/dist/db/migrations.d.ts +1 -1
- package/lib/dist/db/migrations.d.ts.map +1 -1
- package/lib/dist/db/migrations.js +19 -1
- package/lib/dist/db/migrations.js.map +1 -1
- package/lib/dist/db/queries.d.ts +51 -0
- package/lib/dist/db/queries.d.ts.map +1 -1
- package/lib/dist/db/queries.js +141 -0
- package/lib/dist/db/queries.js.map +1 -1
- package/lib/dist/db/schema.sql +19 -0
- package/lib/dist/directory.d.ts +9 -5
- package/lib/dist/directory.d.ts.map +1 -1
- package/lib/dist/directory.js +210 -19
- package/lib/dist/directory.js.map +1 -1
- package/lib/dist/extraction/cfml-extractor.d.ts +107 -0
- package/lib/dist/extraction/cfml-extractor.d.ts.map +1 -0
- package/lib/dist/extraction/cfml-extractor.js +494 -0
- package/lib/dist/extraction/cfml-extractor.js.map +1 -0
- package/lib/dist/extraction/grammars.d.ts +9 -0
- package/lib/dist/extraction/grammars.d.ts.map +1 -1
- package/lib/dist/extraction/grammars.js +115 -3
- package/lib/dist/extraction/grammars.js.map +1 -1
- package/lib/dist/extraction/index.d.ts +46 -1
- package/lib/dist/extraction/index.d.ts.map +1 -1
- package/lib/dist/extraction/index.js +254 -3
- package/lib/dist/extraction/index.js.map +1 -1
- package/lib/dist/extraction/languages/arkts.d.ts +3 -0
- package/lib/dist/extraction/languages/arkts.d.ts.map +1 -0
- package/lib/dist/extraction/languages/arkts.js +127 -0
- package/lib/dist/extraction/languages/arkts.js.map +1 -0
- package/lib/dist/extraction/languages/c-cpp.d.ts +59 -0
- package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -1
- package/lib/dist/extraction/languages/c-cpp.js +499 -3
- package/lib/dist/extraction/languages/c-cpp.js.map +1 -1
- package/lib/dist/extraction/languages/cfquery.d.ts +12 -0
- package/lib/dist/extraction/languages/cfquery.d.ts.map +1 -0
- package/lib/dist/extraction/languages/cfquery.js +28 -0
- package/lib/dist/extraction/languages/cfquery.js.map +1 -0
- package/lib/dist/extraction/languages/cfscript.d.ts +3 -0
- package/lib/dist/extraction/languages/cfscript.d.ts.map +1 -0
- package/lib/dist/extraction/languages/cfscript.js +73 -0
- package/lib/dist/extraction/languages/cfscript.js.map +1 -0
- package/lib/dist/extraction/languages/cobol.d.ts +33 -0
- package/lib/dist/extraction/languages/cobol.d.ts.map +1 -0
- package/lib/dist/extraction/languages/cobol.js +499 -0
- package/lib/dist/extraction/languages/cobol.js.map +1 -0
- package/lib/dist/extraction/languages/erlang.d.ts +3 -0
- package/lib/dist/extraction/languages/erlang.d.ts.map +1 -0
- package/lib/dist/extraction/languages/erlang.js +350 -0
- package/lib/dist/extraction/languages/erlang.js.map +1 -0
- package/lib/dist/extraction/languages/index.d.ts.map +1 -1
- package/lib/dist/extraction/languages/index.js +18 -0
- package/lib/dist/extraction/languages/index.js.map +1 -1
- package/lib/dist/extraction/languages/nix.d.ts +3 -0
- package/lib/dist/extraction/languages/nix.d.ts.map +1 -0
- package/lib/dist/extraction/languages/nix.js +294 -0
- package/lib/dist/extraction/languages/nix.js.map +1 -0
- package/lib/dist/extraction/languages/solidity.d.ts +3 -0
- package/lib/dist/extraction/languages/solidity.d.ts.map +1 -0
- package/lib/dist/extraction/languages/solidity.js +293 -0
- package/lib/dist/extraction/languages/solidity.js.map +1 -0
- package/lib/dist/extraction/languages/terraform.d.ts +3 -0
- package/lib/dist/extraction/languages/terraform.d.ts.map +1 -0
- package/lib/dist/extraction/languages/terraform.js +641 -0
- package/lib/dist/extraction/languages/terraform.js.map +1 -0
- package/lib/dist/extraction/languages/vbnet.d.ts +11 -0
- package/lib/dist/extraction/languages/vbnet.d.ts.map +1 -0
- package/lib/dist/extraction/languages/vbnet.js +141 -0
- package/lib/dist/extraction/languages/vbnet.js.map +1 -0
- package/lib/dist/extraction/mybatis-extractor.d.ts +30 -10
- package/lib/dist/extraction/mybatis-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/mybatis-extractor.js +140 -38
- package/lib/dist/extraction/mybatis-extractor.js.map +1 -1
- package/lib/dist/extraction/tree-sitter-helpers.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter-helpers.js +1 -0
- package/lib/dist/extraction/tree-sitter-helpers.js.map +1 -1
- package/lib/dist/extraction/tree-sitter-types.d.ts +20 -1
- package/lib/dist/extraction/tree-sitter-types.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter.d.ts +38 -0
- package/lib/dist/extraction/tree-sitter.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter.js +845 -16
- package/lib/dist/extraction/tree-sitter.js.map +1 -1
- package/lib/dist/extraction/wasm/tree-sitter-arkts.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-cfml.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-cfquery.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-cfscript.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-cobol.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-erlang.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-nix.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-terraform.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-vbnet.wasm +0 -0
- package/lib/dist/graph/traversal.d.ts.map +1 -1
- package/lib/dist/graph/traversal.js +76 -17
- package/lib/dist/graph/traversal.js.map +1 -1
- package/lib/dist/index.d.ts +63 -1
- package/lib/dist/index.d.ts.map +1 -1
- package/lib/dist/index.js +310 -6
- package/lib/dist/index.js.map +1 -1
- package/lib/dist/installer/index.d.ts.map +1 -1
- package/lib/dist/installer/index.js +3 -1
- package/lib/dist/installer/index.js.map +1 -1
- package/lib/dist/mcp/daemon.d.ts +25 -3
- package/lib/dist/mcp/daemon.d.ts.map +1 -1
- package/lib/dist/mcp/daemon.js +39 -7
- package/lib/dist/mcp/daemon.js.map +1 -1
- package/lib/dist/mcp/dynamic-boundaries.d.ts.map +1 -1
- package/lib/dist/mcp/dynamic-boundaries.js +2 -1
- package/lib/dist/mcp/dynamic-boundaries.js.map +1 -1
- package/lib/dist/mcp/early-ppid.d.ts +26 -0
- package/lib/dist/mcp/early-ppid.d.ts.map +1 -0
- package/lib/dist/mcp/early-ppid.js +29 -0
- package/lib/dist/mcp/early-ppid.js.map +1 -0
- package/lib/dist/mcp/index.d.ts.map +1 -1
- package/lib/dist/mcp/index.js +21 -4
- package/lib/dist/mcp/index.js.map +1 -1
- package/lib/dist/mcp/proxy.d.ts.map +1 -1
- package/lib/dist/mcp/proxy.js +21 -3
- package/lib/dist/mcp/proxy.js.map +1 -1
- package/lib/dist/mcp/startup-handshake.d.ts +44 -0
- package/lib/dist/mcp/startup-handshake.d.ts.map +1 -0
- package/lib/dist/mcp/startup-handshake.js +73 -0
- package/lib/dist/mcp/startup-handshake.js.map +1 -0
- package/lib/dist/mcp/tools.d.ts +22 -0
- package/lib/dist/mcp/tools.d.ts.map +1 -1
- package/lib/dist/mcp/tools.js +74 -9
- package/lib/dist/mcp/tools.js.map +1 -1
- package/lib/dist/project-config.d.ts +38 -0
- package/lib/dist/project-config.d.ts.map +1 -1
- package/lib/dist/project-config.js +101 -2
- package/lib/dist/project-config.js.map +1 -1
- package/lib/dist/resolution/callback-synthesizer.d.ts +1 -1
- package/lib/dist/resolution/callback-synthesizer.d.ts.map +1 -1
- package/lib/dist/resolution/callback-synthesizer.js +743 -11
- package/lib/dist/resolution/callback-synthesizer.js.map +1 -1
- package/lib/dist/resolution/cooperative-yield.d.ts +32 -0
- package/lib/dist/resolution/cooperative-yield.d.ts.map +1 -0
- package/lib/dist/resolution/cooperative-yield.js +42 -0
- package/lib/dist/resolution/cooperative-yield.js.map +1 -0
- package/lib/dist/resolution/frameworks/cics.d.ts +20 -0
- package/lib/dist/resolution/frameworks/cics.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/cics.js +90 -0
- package/lib/dist/resolution/frameworks/cics.js.map +1 -0
- package/lib/dist/resolution/frameworks/index.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/index.js +6 -0
- package/lib/dist/resolution/frameworks/index.js.map +1 -1
- package/lib/dist/resolution/frameworks/java.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/java.js +14 -6
- package/lib/dist/resolution/frameworks/java.js.map +1 -1
- package/lib/dist/resolution/frameworks/terraform.d.ts +38 -0
- package/lib/dist/resolution/frameworks/terraform.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/terraform.js +277 -0
- package/lib/dist/resolution/frameworks/terraform.js.map +1 -0
- package/lib/dist/resolution/import-resolver.d.ts +7 -0
- package/lib/dist/resolution/import-resolver.d.ts.map +1 -1
- package/lib/dist/resolution/import-resolver.js +129 -4
- package/lib/dist/resolution/import-resolver.js.map +1 -1
- package/lib/dist/resolution/index.d.ts +44 -2
- package/lib/dist/resolution/index.d.ts.map +1 -1
- package/lib/dist/resolution/index.js +335 -30
- package/lib/dist/resolution/index.js.map +1 -1
- package/lib/dist/resolution/name-matcher.d.ts +22 -3
- package/lib/dist/resolution/name-matcher.d.ts.map +1 -1
- package/lib/dist/resolution/name-matcher.js +484 -39
- package/lib/dist/resolution/name-matcher.js.map +1 -1
- package/lib/dist/resolution/strip-comments.d.ts +1 -1
- package/lib/dist/resolution/strip-comments.d.ts.map +1 -1
- package/lib/dist/resolution/strip-comments.js +49 -0
- package/lib/dist/resolution/strip-comments.js.map +1 -1
- package/lib/dist/resolution/types.d.ts +20 -0
- package/lib/dist/resolution/types.d.ts.map +1 -1
- package/lib/dist/resolution/workspace-packages.d.ts +10 -0
- package/lib/dist/resolution/workspace-packages.d.ts.map +1 -1
- package/lib/dist/resolution/workspace-packages.js +142 -4
- package/lib/dist/resolution/workspace-packages.js.map +1 -1
- package/lib/dist/search/identifier-segments.d.ts +60 -0
- package/lib/dist/search/identifier-segments.d.ts.map +1 -0
- package/lib/dist/search/identifier-segments.js +176 -0
- package/lib/dist/search/identifier-segments.js.map +1 -0
- package/lib/dist/sync/git-hooks.d.ts.map +1 -1
- package/lib/dist/sync/git-hooks.js +2 -0
- package/lib/dist/sync/git-hooks.js.map +1 -1
- package/lib/dist/sync/watcher.d.ts +10 -5
- package/lib/dist/sync/watcher.d.ts.map +1 -1
- package/lib/dist/sync/watcher.js +51 -14
- package/lib/dist/sync/watcher.js.map +1 -1
- package/lib/dist/sync/worktree.d.ts.map +1 -1
- package/lib/dist/sync/worktree.js +5 -0
- package/lib/dist/sync/worktree.js.map +1 -1
- package/lib/dist/types.d.ts +19 -1
- package/lib/dist/types.d.ts.map +1 -1
- package/lib/dist/types.js +10 -0
- package/lib/dist/types.js.map +1 -1
- package/lib/dist/upgrade/index.js +1 -1
- package/lib/dist/upgrade/index.js.map +1 -1
- package/lib/node_modules/.package-lock.json +1 -1
- package/lib/package.json +1 -1
- package/package.json +1 -1
- package/lib/dist/reasoning/config.d.ts +0 -45
- package/lib/dist/reasoning/config.d.ts.map +0 -1
- package/lib/dist/reasoning/config.js +0 -171
- package/lib/dist/reasoning/config.js.map +0 -1
- package/lib/dist/reasoning/credentials.d.ts +0 -5
- package/lib/dist/reasoning/credentials.d.ts.map +0 -1
- package/lib/dist/reasoning/credentials.js +0 -83
- package/lib/dist/reasoning/credentials.js.map +0 -1
- package/lib/dist/reasoning/login.d.ts +0 -21
- package/lib/dist/reasoning/login.d.ts.map +0 -1
- package/lib/dist/reasoning/login.js +0 -85
- package/lib/dist/reasoning/login.js.map +0 -1
- package/lib/dist/reasoning/reasoner.d.ts +0 -43
- package/lib/dist/reasoning/reasoner.d.ts.map +0 -1
- package/lib/dist/reasoning/reasoner.js +0 -308
- package/lib/dist/reasoning/reasoner.js.map +0 -1
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.arktsExtractor = void 0;
|
|
4
|
+
const typescript_1 = require("./typescript");
|
|
5
|
+
/**
|
|
6
|
+
* ArkTS (HarmonyOS / OpenHarmony, `.ets`) — a TypeScript superset whose
|
|
7
|
+
* headline feature is declarative UI: an `@Component struct` with a `build()`
|
|
8
|
+
* method describing the view tree, `@State`/`@Prop`/`@Link` reactive
|
|
9
|
+
* properties, and global `@Builder`/`@Extend`/`@Styles` functions.
|
|
10
|
+
*
|
|
11
|
+
* The vendored grammar (harmony-contrib/tree-sitter-arkts) extends
|
|
12
|
+
* tree-sitter-javascript exactly the way tree-sitter-typescript does, so every
|
|
13
|
+
* TS node type — and therefore the whole typescriptExtractor — applies
|
|
14
|
+
* verbatim. ArkTS-specific shapes it adds:
|
|
15
|
+
*
|
|
16
|
+
* - `struct_declaration` / `struct_body` — the `@Component struct`. Same
|
|
17
|
+
* `name:`/`body:` fields as class_declaration; members are ordinary
|
|
18
|
+
* `method_definition` / `public_field_definition` nodes, so struct members
|
|
19
|
+
* extract through the standard class-member paths.
|
|
20
|
+
* - `arkui_component_expression` — a build()-DSL component instantiation
|
|
21
|
+
* (`Column() { … }`). Carries a `function:` field (the component), an
|
|
22
|
+
* optional `children:` block, and — unlike TS — the CHAINED ATTRIBUTES as
|
|
23
|
+
* repeated `property:`/`arguments:` field pairs on the SAME node
|
|
24
|
+
* (`Text(x).fontSize(16).opacity(0.6)` is ONE node, not nested calls).
|
|
25
|
+
* Handled by the arkts branch in extractCall (tree-sitter.ts).
|
|
26
|
+
* - Decorators on functions (`@Builder function F() {}`) — invalid in TS,
|
|
27
|
+
* first-class here (a `decorator:` field on function_declaration), so the
|
|
28
|
+
* core's existing extractDecoratorsFor path captures them.
|
|
29
|
+
*/
|
|
30
|
+
/** Reactive/state decorators that make a member worth flagging (searchable). */
|
|
31
|
+
const DECORATED_MEMBER_TYPES = new Set([
|
|
32
|
+
'struct_declaration',
|
|
33
|
+
'public_field_definition',
|
|
34
|
+
'method_definition',
|
|
35
|
+
'function_declaration',
|
|
36
|
+
]);
|
|
37
|
+
/**
|
|
38
|
+
* Collect decorator names for a declaration from BOTH positions the grammar
|
|
39
|
+
* produces: direct `decorator` children (`@Entry @Component struct X`,
|
|
40
|
+
* `@State count` on a field) and preceding `decorator` siblings (`@Builder`
|
|
41
|
+
* before a method_definition inside struct_body; `@Component` on the
|
|
42
|
+
* export_statement wrapping `export struct X`). The backwards sibling walk
|
|
43
|
+
* stops at the first non-decorator so an earlier declaration's decorators
|
|
44
|
+
* never leak in (mirrors extractDecoratorsFor's sibling pass).
|
|
45
|
+
*/
|
|
46
|
+
function collectDecoratorNames(node) {
|
|
47
|
+
const names = [];
|
|
48
|
+
const nameOf = (dec) => {
|
|
49
|
+
for (let i = 0; i < dec.namedChildCount; i++) {
|
|
50
|
+
const child = dec.namedChild(i);
|
|
51
|
+
if (!child)
|
|
52
|
+
continue;
|
|
53
|
+
if (child.type === 'identifier')
|
|
54
|
+
return child.text;
|
|
55
|
+
if (child.type === 'call_expression') {
|
|
56
|
+
// `@StorageLink('theme')` / `@Extend(Text)` — the decorator name is
|
|
57
|
+
// the callee.
|
|
58
|
+
const fn = child.childForFieldName('function');
|
|
59
|
+
if (fn?.type === 'identifier')
|
|
60
|
+
return fn.text;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return undefined;
|
|
64
|
+
};
|
|
65
|
+
for (let i = 0; i < node.namedChildCount; i++) {
|
|
66
|
+
const child = node.namedChild(i);
|
|
67
|
+
if (child?.type === 'decorator') {
|
|
68
|
+
const n = nameOf(child);
|
|
69
|
+
if (n)
|
|
70
|
+
names.push(n);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
const parent = node.parent;
|
|
74
|
+
if (parent) {
|
|
75
|
+
// Find this node among the parent's named children by start offset
|
|
76
|
+
// (wrapper identity is not stable across navigation), then walk backwards.
|
|
77
|
+
const start = node.startIndex;
|
|
78
|
+
let idx = -1;
|
|
79
|
+
for (let i = 0; i < parent.namedChildCount; i++) {
|
|
80
|
+
const sib = parent.namedChild(i);
|
|
81
|
+
if (sib && sib.startIndex === start) {
|
|
82
|
+
idx = i;
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
for (let i = idx - 1; i >= 0; i--) {
|
|
87
|
+
const sib = parent.namedChild(i);
|
|
88
|
+
if (!sib || sib.type !== 'decorator')
|
|
89
|
+
break;
|
|
90
|
+
const n = nameOf(sib);
|
|
91
|
+
if (n)
|
|
92
|
+
names.unshift(n);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return names.length > 0 ? names : undefined;
|
|
96
|
+
}
|
|
97
|
+
exports.arktsExtractor = {
|
|
98
|
+
...typescript_1.typescriptExtractor,
|
|
99
|
+
// `@Component struct X { … }` — extractStruct handles it (kind `struct`,
|
|
100
|
+
// members extracted like class members, `this.m()` resolution and the
|
|
101
|
+
// class/struct containment gates in the name-matcher all apply as-is). The
|
|
102
|
+
// component-ness is preserved on the node's decorators (`Component`,
|
|
103
|
+
// `Entry`, `CustomDialog`, `Reusable`), captured by extractModifiers below.
|
|
104
|
+
structTypes: ['struct_declaration'],
|
|
105
|
+
// build()-DSL component instantiations are call sites: `TodoRow({...})`
|
|
106
|
+
// inside a parent's build() is the parent→child component edge, resolved by
|
|
107
|
+
// the ordinary call pipeline against the child's struct node. The arkts
|
|
108
|
+
// branch in extractCall also lifts each chained `.attr(...)` (emitted
|
|
109
|
+
// dot-prefixed so it can ONLY resolve to `@Extend`/`@Styles`/`@Builder`
|
|
110
|
+
// attribute helpers — see matchReference) and `.onXxx(this.handler)`
|
|
111
|
+
// method-reference bindings. `leading_dot_expression` is the detached-chain
|
|
112
|
+
// shape the grammar produces when a nested component's chain starts on the
|
|
113
|
+
// line after its closing `}` inside arkui_children.
|
|
114
|
+
callTypes: ['call_expression', 'arkui_component_expression', 'leading_dot_expression'],
|
|
115
|
+
// Surface ArkTS decorators on the node's `decorators` list (searchable, and
|
|
116
|
+
// the hook a future ArkUI state→build synthesizer keys off). Core paths
|
|
117
|
+
// already emit `decorates` REFERENCES for classes/methods/properties/
|
|
118
|
+
// functions; this hook is what puts the names on struct nodes too —
|
|
119
|
+
// extractStruct has no extractDecoratorsFor call, and node.decorators is
|
|
120
|
+
// only populated via extractModifiers (see createNode).
|
|
121
|
+
extractModifiers: (node) => {
|
|
122
|
+
if (!DECORATED_MEMBER_TYPES.has(node.type))
|
|
123
|
+
return undefined;
|
|
124
|
+
return collectDecoratorNames(node);
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
//# sourceMappingURL=arkts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arkts.js","sourceRoot":"","sources":["../../../src/extraction/languages/arkts.ts"],"names":[],"mappings":";;;AACA,6CAAmD;AAGnD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,gFAAgF;AAChF,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC;IACrC,oBAAoB;IACpB,yBAAyB;IACzB,mBAAmB;IACnB,sBAAsB;CACvB,CAAC,CAAC;AAEH;;;;;;;;GAQG;AACH,SAAS,qBAAqB,CAAC,IAAgB;IAC7C,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,MAAM,MAAM,GAAG,CAAC,GAAe,EAAsB,EAAE;QACrD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,eAAe,EAAE,CAAC,EAAE,EAAE,CAAC;YAC7C,MAAM,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAChC,IAAI,CAAC,KAAK;gBAAE,SAAS;YACrB,IAAI,KAAK,CAAC,IAAI,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
|
48
48
|
*/
|
|
49
49
|
export declare function blankCppExportMacros(source: string): string;
|
|
50
|
+
export declare function blankCppInlineMacros(source: string): string;
|
|
51
|
+
/**
|
|
52
|
+
* Universal fallback (any macro, no list) for a C/C++ function name still mangled
|
|
53
|
+
* because a macro we don't blank sat in front of the return type: `MACRO Ret
|
|
54
|
+
* name(…)` / `Ret MACRO name(…)` misparse so the return type is glued onto the
|
|
55
|
+
* name ("Ret name", "char_t* to_str(double v)"). Recover the real identifier —
|
|
56
|
+
* the token immediately before the parameter list (or the last token). This runs
|
|
57
|
+
* AFTER the curated pre-parse blank, so it only ever sees the residual tail that
|
|
58
|
+
* blanking didn't already fix cleanly (which also recovers the return type).
|
|
59
|
+
*
|
|
60
|
+
* Safe by construction: only touches an ALREADY-mangled name — one with an
|
|
61
|
+
* internal space that isn't a legit `operator …`/destructor — so a well-formed
|
|
62
|
+
* name is returned unchanged. Guarded against the two ways it could mis-pick:
|
|
63
|
+
* the `Ret (name)` parenthesized-name idiom (left as-is, ambiguous), and a token
|
|
64
|
+
* that is a bare primitive/keyword rather than a real identifier.
|
|
65
|
+
*/
|
|
66
|
+
export declare function recoverMangledCppName(name: string): string;
|
|
67
|
+
export declare function blankMetalAttributes(source: string): string;
|
|
68
|
+
/**
|
|
69
|
+
* Blank annotation-style macro invocations that decorate a declaration but carry
|
|
70
|
+
* NO terminating semicolon — the pervasive Unreal-Engine reflection markup
|
|
71
|
+
* (`UPROPERTY(...)`, `UFUNCTION(...)`, `UCLASS(...)`, `GENERATED_BODY()`,
|
|
72
|
+
* `UE_DEPRECATED_FORGAME(...)`, `DECLARE_DELEGATE_*(...)`, …) that sits on its
|
|
73
|
+
* own line right before a member/type. tree-sitter's C++ grammar doesn't know
|
|
74
|
+
* these are macros, so each one drops into error recovery; in a big reflected
|
|
75
|
+
* class (`CharacterMovementComponent.h` has ~240 of them) the errors accumulate
|
|
76
|
+
* until the enclosing `class_specifier` can't close and collapses into an ERROR
|
|
77
|
+
* node — the whole class definition, its members, and its `extends` edges vanish
|
|
78
|
+
* from the graph. Neither `blankCppExportMacros` (class-header export macros) nor
|
|
79
|
+
* `blankCppInlineMacros` (return-type inline specifiers) touches these in-body
|
|
80
|
+
* markup macros. Replacing each with equal-length spaces preserves every byte
|
|
81
|
+
* offset (so line/column stay exact) and the class then parses normally.
|
|
82
|
+
*
|
|
83
|
+
* Deliberately name-list-FREE — UE alone has hundreds of such macros and projects
|
|
84
|
+
* add their own — so it keys on structure, not a curated list, matched tightly to
|
|
85
|
+
* avoid touching legitimate C++:
|
|
86
|
+
* - the macro must be the FIRST non-whitespace token on its line (`^[ \t]*`),
|
|
87
|
+
* which is where declaration markup lives — so a macro used inside an
|
|
88
|
+
* expression or condition (`if (CHECK(x))`, `x = MACRO(a) + b`) is never
|
|
89
|
+
* matched (it isn't line-leading);
|
|
90
|
+
* - the name must be ALL-CAPS (`[A-Z][A-Z0-9_]{2,}`), since ordinary
|
|
91
|
+
* function/type names called at line start are lower/mixed case;
|
|
92
|
+
* - the char after the balanced `(...)` must START A DECLARATION — a letter,
|
|
93
|
+
* `_`, `~` (destructor), or `#` (a following directive). Declaration markup is
|
|
94
|
+
* always followed by the thing it decorates (`UPROPERTY(...)\n float X;`,
|
|
95
|
+
* `UE_DEPRECATED(...) UPROPERTY(...)`), whereas a statement call is followed by
|
|
96
|
+
* `;` (`FOO(x);`), an init-list item by `,`/`{`, and an expression fragment by
|
|
97
|
+
* an operator (`MAKE(a) + 1`) — all rejected. String/char literals inside the
|
|
98
|
+
* args are skipped so an embedded `)` can't mis-close the balance.
|
|
99
|
+
*
|
|
100
|
+
* C++-only (wired into cppExtractor). A blanked macro inside a block comment is
|
|
101
|
+
* harmless (comments don't parse), and the rare line-leading no-semicolon
|
|
102
|
+
* ALL-CAPS call that isn't markup only loses that one annotation, never a whole
|
|
103
|
+
* class.
|
|
104
|
+
*/
|
|
105
|
+
export declare function blankCppAnnotationMacroCalls(source: string): string;
|
|
106
|
+
export declare function blankCppApiPrefixMacros(source: string): string;
|
|
107
|
+
export declare function blankCppInlineAnnotationMacros(source: string): string;
|
|
108
|
+
export declare function blankCudaConstructs(source: string): string;
|
|
50
109
|
export declare const cppExtractor: LanguageExtractor;
|
|
51
110
|
//# sourceMappingURL=c-cpp.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"c-cpp.d.ts","sourceRoot":"","sources":["../../../src/extraction/languages/c-cpp.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"c-cpp.d.ts","sourceRoot":"","sources":["../../../src/extraction/languages/c-cpp.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAwG9D;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAkBtE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAUzD;AAaD,eAAO,MAAM,UAAU,EAAE,iBAuDxB,CAAC;AAoCF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAM3D;AA8ED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAG3D;AAWD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQ1D;AAyBD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAG3D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAwCnE;AA4BD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAG9D;AAuBD,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAiCrE;AAiDD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAmB1D;AA2CD,eAAO,MAAM,YAAY,EAAE,iBAsF1B,CAAC"}
|