c-next 0.1.70 → 0.1.72
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/package.json +1 -1
- package/src/lib/__tests__/parseCHeader.mocked.test.ts +69 -54
- package/src/lib/parseCHeader.ts +56 -23
- package/src/lib/parseWithSymbols.ts +195 -53
- package/src/transpiler/Transpiler.ts +180 -63
- package/src/transpiler/logic/analysis/FunctionCallAnalyzer.ts +1 -2
- package/src/transpiler/logic/analysis/InitializationAnalyzer.ts +1 -2
- package/src/transpiler/logic/analysis/PassByValueAnalyzer.ts +51 -2
- package/src/transpiler/logic/analysis/__tests__/FunctionCallAnalyzer.test.ts +18 -12
- package/src/transpiler/logic/analysis/__tests__/InitializationAnalyzer.test.ts +9 -9
- package/src/transpiler/logic/analysis/__tests__/runAnalyzers.test.ts +5 -5
- package/src/transpiler/logic/symbols/SymbolTable.ts +729 -265
- package/src/transpiler/logic/symbols/SymbolUtils.ts +2 -2
- package/src/transpiler/logic/symbols/__tests__/SymbolTable.test.ts +415 -751
- package/src/transpiler/logic/symbols/c/__tests__/CResolver.integration.test.ts +573 -0
- package/src/transpiler/logic/symbols/c/__tests__/testHelpers.ts +20 -0
- package/src/transpiler/logic/symbols/c/collectors/EnumCollector.ts +82 -0
- package/src/transpiler/logic/symbols/c/collectors/FunctionCollector.ts +106 -0
- package/src/transpiler/logic/symbols/c/collectors/StructCollector.ts +173 -0
- package/src/transpiler/logic/symbols/c/collectors/TypedefCollector.ts +35 -0
- package/src/transpiler/logic/symbols/c/collectors/VariableCollector.ts +80 -0
- package/src/transpiler/logic/symbols/c/index.ts +333 -0
- package/src/transpiler/logic/symbols/c/utils/DeclaratorUtils.ts +269 -0
- package/src/transpiler/logic/symbols/cnext/__tests__/BitmapCollector.test.ts +50 -11
- package/src/transpiler/logic/symbols/cnext/__tests__/CNextResolver.integration.test.ts +45 -34
- package/src/transpiler/logic/symbols/cnext/__tests__/EnumCollector.test.ts +30 -13
- package/src/transpiler/logic/symbols/cnext/__tests__/FunctionCollector.test.ts +279 -64
- package/src/transpiler/logic/symbols/cnext/__tests__/RegisterCollector.test.ts +60 -13
- package/src/transpiler/logic/symbols/cnext/__tests__/ScopeCollector.test.ts +40 -37
- package/src/transpiler/logic/symbols/cnext/__tests__/StructCollector.test.ts +131 -45
- package/src/transpiler/logic/symbols/cnext/__tests__/TSymbolInfoAdapter.test.ts +223 -139
- package/src/transpiler/logic/symbols/cnext/__tests__/VariableCollector.test.ts +79 -25
- package/src/transpiler/logic/symbols/cnext/__tests__/testUtils.ts +53 -0
- package/src/transpiler/logic/symbols/cnext/adapters/TSymbolInfoAdapter.ts +83 -43
- package/src/transpiler/logic/symbols/cnext/collectors/BitmapCollector.ts +14 -13
- package/src/transpiler/logic/symbols/cnext/collectors/EnumCollector.ts +11 -10
- package/src/transpiler/logic/symbols/cnext/collectors/FunctionCollector.ts +83 -34
- package/src/transpiler/logic/symbols/cnext/collectors/RegisterCollector.ts +22 -18
- package/src/transpiler/logic/symbols/cnext/collectors/ScopeCollector.ts +53 -35
- package/src/transpiler/logic/symbols/cnext/collectors/StructCollector.ts +30 -23
- package/src/transpiler/logic/symbols/cnext/collectors/VariableCollector.ts +18 -19
- package/src/transpiler/logic/symbols/cnext/index.ts +36 -14
- package/src/transpiler/logic/symbols/cnext/types/IScopeCollectorResult.ts +2 -2
- package/src/transpiler/logic/symbols/cnext/utils/SymbolNameUtils.ts +27 -0
- package/src/transpiler/logic/symbols/cpp/__tests__/CppResolver.integration.test.ts +270 -0
- package/src/transpiler/logic/symbols/cpp/__tests__/testHelpers.ts +20 -0
- package/src/transpiler/logic/symbols/cpp/collectors/ClassCollector.ts +317 -0
- package/src/transpiler/logic/symbols/cpp/collectors/EnumCollector.ts +71 -0
- package/src/transpiler/logic/symbols/cpp/collectors/FunctionCollector.ts +155 -0
- package/src/transpiler/logic/symbols/cpp/collectors/NamespaceCollector.ts +65 -0
- package/src/transpiler/logic/symbols/cpp/collectors/TypeAliasCollector.ts +46 -0
- package/src/transpiler/logic/symbols/cpp/collectors/VariableCollector.ts +54 -0
- package/src/transpiler/logic/symbols/cpp/index.ts +366 -0
- package/src/transpiler/logic/symbols/cpp/utils/DeclaratorUtils.ts +248 -0
- package/src/transpiler/logic/symbols/shared/IExtractedParameter.ts +18 -0
- package/src/transpiler/logic/symbols/shared/ParameterExtractorUtils.ts +73 -0
- package/src/transpiler/output/codegen/CodeGenerator.ts +268 -1674
- package/src/transpiler/output/codegen/__tests__/CodeGenerator.test.ts +7 -1
- package/src/transpiler/output/codegen/assignment/AssignmentClassifier.ts +2 -1
- package/src/transpiler/output/codegen/assignment/handlers/AssignmentHandlerUtils.ts +7 -1
- package/src/transpiler/output/codegen/assignment/handlers/BitmapHandlers.ts +6 -2
- package/src/transpiler/output/codegen/assignment/handlers/RegisterHandlers.ts +2 -1
- package/src/transpiler/output/codegen/generators/declarationGenerators/ScopeGenerator.ts +21 -8
- package/src/transpiler/output/codegen/generators/declarationGenerators/ScopedRegisterGenerator.ts +3 -2
- package/src/transpiler/output/codegen/generators/expressions/CallExprUtils.ts +9 -3
- package/src/transpiler/output/codegen/generators/expressions/__tests__/CallExprGenerator.test.ts +3 -4
- package/src/transpiler/output/codegen/generators/expressions/__tests__/CallExprUtils.test.ts +4 -8
- package/src/transpiler/output/codegen/helpers/ArgumentGenerator.ts +236 -0
- package/src/transpiler/output/codegen/helpers/CppConstructorHelper.ts +3 -3
- package/src/transpiler/output/codegen/helpers/FunctionContextManager.ts +435 -0
- package/src/transpiler/output/codegen/helpers/StringOperationsHelper.ts +203 -0
- package/src/transpiler/output/codegen/helpers/SymbolLookupHelper.ts +8 -12
- package/src/transpiler/output/codegen/helpers/TypeRegistrationEngine.ts +520 -0
- package/src/transpiler/output/codegen/helpers/VariableDeclHelper.ts +735 -0
- package/src/transpiler/output/codegen/helpers/VariableDeclarationFormatter.ts +1 -1
- package/src/transpiler/output/codegen/helpers/__tests__/ArgumentGenerator.test.ts +521 -0
- package/src/transpiler/output/codegen/helpers/__tests__/CppConstructorHelper.test.ts +4 -5
- package/src/transpiler/output/codegen/helpers/__tests__/FunctionContextManager.test.ts +983 -0
- package/src/transpiler/output/codegen/helpers/__tests__/StringOperationsHelper.test.ts +269 -0
- package/src/transpiler/output/codegen/helpers/__tests__/SymbolLookupHelper.test.ts +31 -32
- package/src/transpiler/output/codegen/helpers/__tests__/TypeRegistrationEngine.test.ts +186 -0
- package/src/transpiler/output/codegen/helpers/__tests__/VariableDeclHelper.test.ts +460 -0
- package/src/transpiler/output/codegen/helpers/types/IArgumentGeneratorCallbacks.ts +32 -0
- package/src/transpiler/output/codegen/resolution/EnumTypeResolver.ts +5 -1
- package/src/transpiler/output/codegen/types/IFunctionContextCallbacks.ts +12 -0
- package/src/transpiler/output/codegen/types/IVariableFormatInput.ts +1 -1
- package/src/transpiler/output/codegen/utils/QualifiedNameGenerator.ts +114 -0
- package/src/transpiler/output/codegen/utils/__tests__/QualifiedNameGenerator.test.ts +183 -0
- package/src/transpiler/output/headers/BaseHeaderGenerator.ts +4 -4
- package/src/transpiler/output/headers/ExternalTypeHeaderBuilder.ts +7 -7
- package/src/transpiler/output/headers/HeaderGenerator.ts +9 -7
- package/src/transpiler/output/headers/HeaderGeneratorUtils.ts +19 -20
- package/src/transpiler/output/headers/__tests__/BaseHeaderGenerator.test.ts +15 -18
- package/src/transpiler/output/headers/__tests__/CHeaderGenerator.test.ts +63 -64
- package/src/transpiler/output/headers/__tests__/CppHeaderGenerator.test.ts +36 -32
- package/src/transpiler/output/headers/__tests__/ExternalTypeHeaderBuilder.test.ts +26 -26
- package/src/transpiler/output/headers/__tests__/HeaderGenerator.test.ts +87 -59
- package/src/transpiler/output/headers/__tests__/HeaderGeneratorUtils.test.ts +57 -58
- package/src/transpiler/output/headers/adapters/HeaderSymbolAdapter.ts +222 -0
- package/src/transpiler/output/headers/adapters/__tests__/HeaderSymbolAdapter.test.ts +538 -0
- package/src/transpiler/output/headers/types/IGroupedSymbols.ts +8 -8
- package/src/transpiler/output/headers/types/IHeaderSymbol.ts +62 -0
- package/src/transpiler/state/CodeGenState.ts +20 -33
- package/src/transpiler/state/SymbolRegistry.ts +181 -0
- package/src/transpiler/{types → state}/TranspilerState.ts +1 -1
- package/src/transpiler/state/__tests__/CodeGenState.test.ts +67 -59
- package/src/transpiler/state/__tests__/SymbolRegistry.test.ts +249 -0
- package/src/transpiler/{types → state}/__tests__/TranspilerState.test.ts +1 -1
- package/src/transpiler/types/ICachedFileEntry.ts +1 -1
- package/src/transpiler/types/IConflict.ts +14 -0
- package/src/transpiler/types/IPipelineInput.ts +0 -3
- package/src/transpiler/types/ISerializedSymbol.ts +11 -0
- package/src/transpiler/types/TPrimitiveKind.ts +20 -0
- package/src/transpiler/types/TType.ts +103 -0
- package/src/transpiler/types/TVisibility.ts +6 -0
- package/src/transpiler/types/symbol-kinds/TSymbolKind.ts +10 -0
- package/src/transpiler/types/symbol-kinds/TSymbolKindC.ts +12 -0
- package/src/transpiler/types/symbol-kinds/TSymbolKindCNext.ts +16 -0
- package/src/transpiler/types/symbol-kinds/TSymbolKindCpp.ts +14 -0
- package/src/transpiler/types/symbols/IBaseSymbol.ts +31 -0
- package/src/transpiler/{logic/symbols/types → types/symbols}/IBitmapFieldInfo.ts +2 -2
- package/src/transpiler/types/symbols/IBitmapSymbol.ts +21 -0
- package/src/transpiler/{logic/symbols/types → types/symbols}/IEnumSymbol.ts +5 -6
- package/src/transpiler/types/symbols/IFieldInfo.ts +26 -0
- package/src/transpiler/types/symbols/IFunctionSymbol.ts +30 -0
- package/src/transpiler/types/symbols/IParameterInfo.ts +26 -0
- package/src/transpiler/{logic/symbols/types → types/symbols}/IRegisterMemberInfo.ts +4 -4
- package/src/transpiler/types/symbols/IRegisterSymbol.ts +18 -0
- package/src/transpiler/types/symbols/IScopeSymbol.ts +32 -0
- package/src/transpiler/{logic/symbols/types → types/symbols}/IStructFieldInfo.ts +2 -1
- package/src/transpiler/types/symbols/IStructSymbol.ts +15 -0
- package/src/transpiler/types/symbols/IVariableSymbol.ts +30 -0
- package/src/transpiler/types/symbols/SymbolGuards.ts +43 -0
- package/src/transpiler/types/symbols/TAnySymbol.ts +22 -0
- package/src/transpiler/types/symbols/TSymbol.ts +32 -0
- package/src/transpiler/types/symbols/__tests__/IBaseSymbol.test.ts +56 -0
- package/src/transpiler/types/symbols/__tests__/SymbolGuards.test.ts +57 -0
- package/src/transpiler/types/symbols/c/ICBaseSymbol.ts +28 -0
- package/src/transpiler/types/symbols/c/ICEnumMemberSymbol.ts +17 -0
- package/src/transpiler/types/symbols/c/ICEnumSymbol.ts +17 -0
- package/src/transpiler/types/symbols/c/ICFieldInfo.ts +16 -0
- package/src/transpiler/types/symbols/c/ICFunctionSymbol.ts +21 -0
- package/src/transpiler/types/symbols/c/ICParameterInfo.ts +19 -0
- package/src/transpiler/types/symbols/c/ICStructSymbol.ts +21 -0
- package/src/transpiler/types/symbols/c/ICTypedefSymbol.ts +14 -0
- package/src/transpiler/types/symbols/c/ICVariableSymbol.ts +26 -0
- package/src/transpiler/types/symbols/c/TCSymbol.ts +26 -0
- package/src/transpiler/types/symbols/cpp/ICppBaseSymbol.ts +31 -0
- package/src/transpiler/types/symbols/cpp/ICppClassSymbol.ts +15 -0
- package/src/transpiler/types/symbols/cpp/ICppEnumMemberSymbol.ts +14 -0
- package/src/transpiler/types/symbols/cpp/ICppEnumSymbol.ts +14 -0
- package/src/transpiler/types/symbols/cpp/ICppFieldInfo.ts +16 -0
- package/src/transpiler/types/symbols/cpp/ICppFunctionSymbol.ts +21 -0
- package/src/transpiler/types/symbols/cpp/ICppNamespaceSymbol.ts +11 -0
- package/src/transpiler/types/symbols/cpp/ICppParameterInfo.ts +19 -0
- package/src/transpiler/types/symbols/cpp/ICppStructSymbol.ts +16 -0
- package/src/transpiler/types/symbols/cpp/ICppTypeAliasSymbol.ts +14 -0
- package/src/transpiler/types/symbols/cpp/ICppVariableSymbol.ts +23 -0
- package/src/transpiler/types/symbols/cpp/TCppSymbol.ts +30 -0
- package/src/utils/CppNamespaceUtils.ts +3 -4
- package/src/utils/FunctionUtils.ts +92 -0
- package/src/utils/ParameterUtils.ts +55 -0
- package/src/utils/PrimitiveKindUtils.ts +33 -0
- package/src/utils/ScopeUtils.ts +105 -0
- package/src/utils/TTypeUtils.ts +159 -0
- package/src/utils/TypeResolver.ts +132 -0
- package/src/utils/__tests__/CppNamespaceUtils.test.ts +92 -99
- package/src/utils/__tests__/FunctionUtils.test.ts +284 -0
- package/src/utils/__tests__/ParameterUtils.test.ts +174 -0
- package/src/utils/__tests__/PrimitiveKindUtils.test.ts +59 -0
- package/src/utils/__tests__/ScopeUtils.test.ts +53 -0
- package/src/utils/__tests__/TTypeUtils.test.ts +245 -0
- package/src/utils/__tests__/TypeResolver.test.ts +332 -0
- package/src/utils/cache/CacheManager.ts +91 -50
- package/src/utils/cache/__tests__/CacheManager.test.ts +180 -114
- package/src/transpiler/logic/symbols/AutoConstUpdater.ts +0 -93
- package/src/transpiler/logic/symbols/CSymbolCollector.ts +0 -648
- package/src/transpiler/logic/symbols/CppSymbolCollector.ts +0 -874
- package/src/transpiler/logic/symbols/SymbolCollectorContext.ts +0 -68
- package/src/transpiler/logic/symbols/__tests__/AutoConstUpdater.test.ts +0 -418
- package/src/transpiler/logic/symbols/__tests__/CSymbolCollector.test.ts +0 -685
- package/src/transpiler/logic/symbols/__tests__/CppSymbolCollector.test.ts +0 -1146
- package/src/transpiler/logic/symbols/__tests__/SymbolCollectorContext.test.ts +0 -290
- package/src/transpiler/logic/symbols/__tests__/cTestHelpers.ts +0 -43
- package/src/transpiler/logic/symbols/__tests__/cppTestHelpers.ts +0 -40
- package/src/transpiler/logic/symbols/cnext/__tests__/TSymbolAdapter.test.ts +0 -595
- package/src/transpiler/logic/symbols/cnext/adapters/TSymbolAdapter.ts +0 -345
- package/src/transpiler/logic/symbols/types/IBaseSymbol.ts +0 -27
- package/src/transpiler/logic/symbols/types/IBitmapSymbol.ts +0 -23
- package/src/transpiler/logic/symbols/types/ICollectorContext.ts +0 -19
- package/src/transpiler/logic/symbols/types/IConflict.ts +0 -20
- package/src/transpiler/logic/symbols/types/IFieldInfo.ts +0 -18
- package/src/transpiler/logic/symbols/types/IFunctionSymbol.ts +0 -25
- package/src/transpiler/logic/symbols/types/IParameterInfo.ts +0 -24
- package/src/transpiler/logic/symbols/types/IRegisterSymbol.ts +0 -20
- package/src/transpiler/logic/symbols/types/IScopeSymbol.ts +0 -19
- package/src/transpiler/logic/symbols/types/IStructSymbol.ts +0 -16
- package/src/transpiler/logic/symbols/types/IVariableSymbol.ts +0 -30
- package/src/transpiler/logic/symbols/types/TSymbol.ts +0 -36
- package/src/transpiler/logic/symbols/types/__tests__/SymbolGuards.test.ts +0 -244
- package/src/transpiler/logic/symbols/types/typeGuards.ts +0 -44
- package/src/utils/types/ESymbolKind.ts +0 -19
- package/src/utils/types/ISymbol.ts +0 -64
- /package/src/transpiler/{types → constants}/BITMAP_BACKING_TYPE.ts +0 -0
- /package/src/transpiler/{types → constants}/BITMAP_SIZE.ts +0 -0
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unit tests for SymbolRegistry
|
|
3
|
+
*/
|
|
4
|
+
import { describe, it, expect, beforeEach } from "vitest";
|
|
5
|
+
import SymbolRegistry from "../SymbolRegistry";
|
|
6
|
+
import FunctionUtils from "../../../utils/FunctionUtils";
|
|
7
|
+
import TTypeUtils from "../../../utils/TTypeUtils";
|
|
8
|
+
|
|
9
|
+
describe("SymbolRegistry", () => {
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
SymbolRegistry.reset();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
describe("getGlobalScope", () => {
|
|
15
|
+
it("returns the global scope singleton", () => {
|
|
16
|
+
const global = SymbolRegistry.getGlobalScope();
|
|
17
|
+
expect(global.kind).toBe("scope");
|
|
18
|
+
expect(global.name).toBe("");
|
|
19
|
+
expect(global.parent).toBe(global);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it("returns same instance on multiple calls", () => {
|
|
23
|
+
const g1 = SymbolRegistry.getGlobalScope();
|
|
24
|
+
const g2 = SymbolRegistry.getGlobalScope();
|
|
25
|
+
expect(g1).toBe(g2);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
describe("getOrCreateScope", () => {
|
|
30
|
+
it("returns global scope for empty path", () => {
|
|
31
|
+
const scope = SymbolRegistry.getOrCreateScope("");
|
|
32
|
+
expect(scope).toBe(SymbolRegistry.getGlobalScope());
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it("creates scope with global parent for simple name", () => {
|
|
36
|
+
const scope = SymbolRegistry.getOrCreateScope("Test");
|
|
37
|
+
expect(scope.name).toBe("Test");
|
|
38
|
+
expect(scope.parent).toBe(SymbolRegistry.getGlobalScope());
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it("returns same scope for same path", () => {
|
|
42
|
+
const s1 = SymbolRegistry.getOrCreateScope("Test");
|
|
43
|
+
const s2 = SymbolRegistry.getOrCreateScope("Test");
|
|
44
|
+
expect(s1).toBe(s2);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it("creates nested scopes for dotted path", () => {
|
|
48
|
+
const inner = SymbolRegistry.getOrCreateScope("Outer.Inner");
|
|
49
|
+
expect(inner.name).toBe("Inner");
|
|
50
|
+
expect(inner.parent.name).toBe("Outer");
|
|
51
|
+
expect(inner.parent.parent).toBe(SymbolRegistry.getGlobalScope());
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
describe("registerFunction", () => {
|
|
56
|
+
it("adds function to its scope", () => {
|
|
57
|
+
const scope = SymbolRegistry.getOrCreateScope("Test");
|
|
58
|
+
const func = FunctionUtils.create({
|
|
59
|
+
name: "fillData",
|
|
60
|
+
scope,
|
|
61
|
+
parameters: [],
|
|
62
|
+
returnType: TTypeUtils.createPrimitive("void"),
|
|
63
|
+
visibility: "private",
|
|
64
|
+
body: null,
|
|
65
|
+
sourceFile: "test.cnx",
|
|
66
|
+
sourceLine: 1,
|
|
67
|
+
});
|
|
68
|
+
SymbolRegistry.registerFunction(func);
|
|
69
|
+
|
|
70
|
+
expect(scope.functions).toContain(func);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
describe("resolveFunction", () => {
|
|
75
|
+
it("finds function in current scope", () => {
|
|
76
|
+
const scope = SymbolRegistry.getOrCreateScope("Test");
|
|
77
|
+
const func = FunctionUtils.create({
|
|
78
|
+
name: "fillData",
|
|
79
|
+
scope,
|
|
80
|
+
parameters: [],
|
|
81
|
+
returnType: TTypeUtils.createPrimitive("void"),
|
|
82
|
+
visibility: "private",
|
|
83
|
+
body: null,
|
|
84
|
+
sourceFile: "test.cnx",
|
|
85
|
+
sourceLine: 1,
|
|
86
|
+
});
|
|
87
|
+
SymbolRegistry.registerFunction(func);
|
|
88
|
+
|
|
89
|
+
const found = SymbolRegistry.resolveFunction("fillData", scope);
|
|
90
|
+
expect(found).toBe(func);
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it("finds function in parent scope", () => {
|
|
94
|
+
const global = SymbolRegistry.getGlobalScope();
|
|
95
|
+
const func = FunctionUtils.create({
|
|
96
|
+
name: "helper",
|
|
97
|
+
scope: global,
|
|
98
|
+
parameters: [],
|
|
99
|
+
returnType: TTypeUtils.createPrimitive("void"),
|
|
100
|
+
visibility: "public",
|
|
101
|
+
body: null,
|
|
102
|
+
sourceFile: "test.cnx",
|
|
103
|
+
sourceLine: 1,
|
|
104
|
+
});
|
|
105
|
+
SymbolRegistry.registerFunction(func);
|
|
106
|
+
|
|
107
|
+
const childScope = SymbolRegistry.getOrCreateScope("Test");
|
|
108
|
+
const found = SymbolRegistry.resolveFunction("helper", childScope);
|
|
109
|
+
expect(found).toBe(func);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it("returns null for unknown function", () => {
|
|
113
|
+
const scope = SymbolRegistry.getOrCreateScope("Test");
|
|
114
|
+
const found = SymbolRegistry.resolveFunction("unknown", scope);
|
|
115
|
+
expect(found).toBeNull();
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
describe("reset", () => {
|
|
120
|
+
it("clears all registered symbols", () => {
|
|
121
|
+
const scope = SymbolRegistry.getOrCreateScope("Test");
|
|
122
|
+
const func = FunctionUtils.create({
|
|
123
|
+
name: "foo",
|
|
124
|
+
scope,
|
|
125
|
+
parameters: [],
|
|
126
|
+
returnType: TTypeUtils.createPrimitive("void"),
|
|
127
|
+
visibility: "private",
|
|
128
|
+
body: null,
|
|
129
|
+
sourceFile: "test.cnx",
|
|
130
|
+
sourceLine: 1,
|
|
131
|
+
});
|
|
132
|
+
SymbolRegistry.registerFunction(func);
|
|
133
|
+
|
|
134
|
+
SymbolRegistry.reset();
|
|
135
|
+
|
|
136
|
+
const newGlobal = SymbolRegistry.getGlobalScope();
|
|
137
|
+
expect(newGlobal.functions).toHaveLength(0);
|
|
138
|
+
|
|
139
|
+
const found = SymbolRegistry.resolveFunction("foo", newGlobal);
|
|
140
|
+
expect(found).toBeNull();
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
describe("findByMangledName", () => {
|
|
145
|
+
it("finds global function by bare name", () => {
|
|
146
|
+
const global = SymbolRegistry.getGlobalScope();
|
|
147
|
+
const func = FunctionUtils.create({
|
|
148
|
+
name: "main",
|
|
149
|
+
scope: global,
|
|
150
|
+
parameters: [],
|
|
151
|
+
returnType: TTypeUtils.createPrimitive("i32"),
|
|
152
|
+
visibility: "public",
|
|
153
|
+
body: null,
|
|
154
|
+
sourceFile: "main.cnx",
|
|
155
|
+
sourceLine: 1,
|
|
156
|
+
});
|
|
157
|
+
SymbolRegistry.registerFunction(func);
|
|
158
|
+
|
|
159
|
+
const found = SymbolRegistry.findByMangledName("main");
|
|
160
|
+
expect(found).toBe(func);
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
it("finds scoped function by mangled name", () => {
|
|
164
|
+
const scope = SymbolRegistry.getOrCreateScope("Test");
|
|
165
|
+
const func = FunctionUtils.create({
|
|
166
|
+
name: "fillData",
|
|
167
|
+
scope,
|
|
168
|
+
parameters: [],
|
|
169
|
+
returnType: TTypeUtils.createPrimitive("void"),
|
|
170
|
+
visibility: "private",
|
|
171
|
+
body: null,
|
|
172
|
+
sourceFile: "test.cnx",
|
|
173
|
+
sourceLine: 10,
|
|
174
|
+
});
|
|
175
|
+
SymbolRegistry.registerFunction(func);
|
|
176
|
+
|
|
177
|
+
const found = SymbolRegistry.findByMangledName("Test_fillData");
|
|
178
|
+
expect(found).toBe(func);
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
it("finds nested scope function by mangled name", () => {
|
|
182
|
+
const scope = SymbolRegistry.getOrCreateScope("Outer.Inner");
|
|
183
|
+
const func = FunctionUtils.create({
|
|
184
|
+
name: "deepFunc",
|
|
185
|
+
scope,
|
|
186
|
+
parameters: [],
|
|
187
|
+
returnType: TTypeUtils.createPrimitive("void"),
|
|
188
|
+
visibility: "private",
|
|
189
|
+
body: null,
|
|
190
|
+
sourceFile: "test.cnx",
|
|
191
|
+
sourceLine: 20,
|
|
192
|
+
});
|
|
193
|
+
SymbolRegistry.registerFunction(func);
|
|
194
|
+
|
|
195
|
+
const found = SymbolRegistry.findByMangledName("Outer_Inner_deepFunc");
|
|
196
|
+
expect(found).toBe(func);
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
it("returns null for unknown function", () => {
|
|
200
|
+
const found = SymbolRegistry.findByMangledName("Unknown_func");
|
|
201
|
+
expect(found).toBeNull();
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
describe("getScopeByMangledFunctionName", () => {
|
|
206
|
+
it("returns scope for scoped function", () => {
|
|
207
|
+
const scope = SymbolRegistry.getOrCreateScope("Motor");
|
|
208
|
+
const func = FunctionUtils.create({
|
|
209
|
+
name: "init",
|
|
210
|
+
scope,
|
|
211
|
+
parameters: [],
|
|
212
|
+
returnType: TTypeUtils.createPrimitive("void"),
|
|
213
|
+
visibility: "public",
|
|
214
|
+
body: null,
|
|
215
|
+
sourceFile: "motor.cnx",
|
|
216
|
+
sourceLine: 5,
|
|
217
|
+
});
|
|
218
|
+
SymbolRegistry.registerFunction(func);
|
|
219
|
+
|
|
220
|
+
const foundScope =
|
|
221
|
+
SymbolRegistry.getScopeByMangledFunctionName("Motor_init");
|
|
222
|
+
expect(foundScope).toBe(scope);
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
it("returns global scope for global function", () => {
|
|
226
|
+
const global = SymbolRegistry.getGlobalScope();
|
|
227
|
+
const func = FunctionUtils.create({
|
|
228
|
+
name: "helper",
|
|
229
|
+
scope: global,
|
|
230
|
+
parameters: [],
|
|
231
|
+
returnType: TTypeUtils.createPrimitive("void"),
|
|
232
|
+
visibility: "public",
|
|
233
|
+
body: null,
|
|
234
|
+
sourceFile: "helpers.cnx",
|
|
235
|
+
sourceLine: 1,
|
|
236
|
+
});
|
|
237
|
+
SymbolRegistry.registerFunction(func);
|
|
238
|
+
|
|
239
|
+
const foundScope = SymbolRegistry.getScopeByMangledFunctionName("helper");
|
|
240
|
+
expect(foundScope).toBe(global);
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
it("returns null for unknown function", () => {
|
|
244
|
+
const foundScope =
|
|
245
|
+
SymbolRegistry.getScopeByMangledFunctionName("Unknown_func");
|
|
246
|
+
expect(foundScope).toBeNull();
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
});
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { describe, it, expect, beforeEach } from "vitest";
|
|
7
7
|
import TranspilerState from "../TranspilerState";
|
|
8
|
-
import ICodeGenSymbols from "
|
|
8
|
+
import ICodeGenSymbols from "../../types/ICodeGenSymbols";
|
|
9
9
|
|
|
10
10
|
/** Create a minimal ICodeGenSymbols for testing */
|
|
11
11
|
function createMockSymbolInfo(enumName?: string): ICodeGenSymbols {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Cached entry for a single header file
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import IStructFieldInfo from "
|
|
5
|
+
import IStructFieldInfo from "./symbols/IStructFieldInfo";
|
|
6
6
|
import ISerializedSymbol from "./ISerializedSymbol";
|
|
7
7
|
|
|
8
8
|
interface ICachedFileEntry {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Symbol conflict information for cross-language symbol detection.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import TAnySymbol from "./symbols/TAnySymbol";
|
|
6
|
+
|
|
7
|
+
interface IConflict {
|
|
8
|
+
symbolName: string;
|
|
9
|
+
definitions: TAnySymbol[];
|
|
10
|
+
severity: "error" | "warning";
|
|
11
|
+
message: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default IConflict;
|
|
@@ -15,9 +15,6 @@ interface IPipelineInput {
|
|
|
15
15
|
|
|
16
16
|
/** Whether to write generated output to disk */
|
|
17
17
|
readonly writeOutputToDisk: boolean;
|
|
18
|
-
|
|
19
|
-
/** Skip Stage 4 (symbol conflict check) — standalone mode doesn't need it */
|
|
20
|
-
readonly skipConflictCheck?: boolean;
|
|
21
18
|
}
|
|
22
19
|
|
|
23
20
|
export default IPipelineInput;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Serialized symbol for JSON storage
|
|
3
3
|
* Uses string values for enums to ensure clean JSON serialization
|
|
4
|
+
* ADR-055 Phase 7: Canonical format for cache storage (no ISymbol intermediate)
|
|
4
5
|
*/
|
|
5
6
|
interface ISerializedSymbol {
|
|
6
7
|
/** Symbol name */
|
|
@@ -27,6 +28,16 @@ interface ISerializedSymbol {
|
|
|
27
28
|
accessModifier?: string;
|
|
28
29
|
/** For arrays: element count. For integers: bit width */
|
|
29
30
|
size?: number;
|
|
31
|
+
/** Whether this variable is an array */
|
|
32
|
+
isArray?: boolean;
|
|
33
|
+
/** Array dimensions for extern declarations */
|
|
34
|
+
arrayDimensions?: string[];
|
|
35
|
+
/** Whether this variable is const */
|
|
36
|
+
isConst?: boolean;
|
|
37
|
+
/** Whether this variable is atomic (volatile in C) */
|
|
38
|
+
isAtomic?: boolean;
|
|
39
|
+
/** Initial value for const variables */
|
|
40
|
+
initialValue?: string;
|
|
30
41
|
/** Function parameters for header generation */
|
|
31
42
|
parameters?: Array<{
|
|
32
43
|
name: string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* C-Next primitive type kinds.
|
|
3
|
+
*
|
|
4
|
+
* These are the built-in types that map directly to C types.
|
|
5
|
+
*/
|
|
6
|
+
type TPrimitiveKind =
|
|
7
|
+
| "void"
|
|
8
|
+
| "bool"
|
|
9
|
+
| "u8"
|
|
10
|
+
| "i8"
|
|
11
|
+
| "u16"
|
|
12
|
+
| "i16"
|
|
13
|
+
| "u32"
|
|
14
|
+
| "i32"
|
|
15
|
+
| "u64"
|
|
16
|
+
| "i64"
|
|
17
|
+
| "f32"
|
|
18
|
+
| "f64";
|
|
19
|
+
|
|
20
|
+
export default TPrimitiveKind;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* C-Next Type System - Discriminated Union
|
|
3
|
+
*
|
|
4
|
+
* TType represents all possible types in the C-Next type system.
|
|
5
|
+
* Each variant has a `kind` discriminator for type narrowing.
|
|
6
|
+
*
|
|
7
|
+
* Use TTypeUtils for factory functions and type guards.
|
|
8
|
+
*/
|
|
9
|
+
import TPrimitiveKind from "./TPrimitiveKind";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Primitive type (built-in types that map to C types)
|
|
13
|
+
*/
|
|
14
|
+
interface TPrimitiveType {
|
|
15
|
+
readonly kind: "primitive";
|
|
16
|
+
readonly primitive: TPrimitiveKind;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Struct type reference
|
|
21
|
+
*/
|
|
22
|
+
interface TStructType {
|
|
23
|
+
readonly kind: "struct";
|
|
24
|
+
readonly name: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Enum type reference
|
|
29
|
+
*/
|
|
30
|
+
interface TEnumType {
|
|
31
|
+
readonly kind: "enum";
|
|
32
|
+
readonly name: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Bitmap type reference
|
|
37
|
+
* Bitmaps have a fixed bit width (8, 16, 24, 32)
|
|
38
|
+
*/
|
|
39
|
+
interface TBitmapType {
|
|
40
|
+
readonly kind: "bitmap";
|
|
41
|
+
readonly name: string;
|
|
42
|
+
readonly bitWidth: number;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Array type with element type and dimensions
|
|
47
|
+
* Dimensions can be numbers or strings (for C macro pass-through)
|
|
48
|
+
*/
|
|
49
|
+
interface TArrayType {
|
|
50
|
+
readonly kind: "array";
|
|
51
|
+
readonly elementType: TType;
|
|
52
|
+
readonly dimensions: ReadonlyArray<number | string>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* String type with capacity
|
|
57
|
+
* C-Next strings are fixed-capacity char arrays
|
|
58
|
+
*/
|
|
59
|
+
interface TStringType {
|
|
60
|
+
readonly kind: "string";
|
|
61
|
+
readonly capacity: number;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Callback type reference (function pointer type)
|
|
66
|
+
*/
|
|
67
|
+
interface TCallbackType {
|
|
68
|
+
readonly kind: "callback";
|
|
69
|
+
readonly name: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Hardware register type
|
|
74
|
+
*/
|
|
75
|
+
interface TRegisterType {
|
|
76
|
+
readonly kind: "register";
|
|
77
|
+
readonly name: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* External type (C++ templates, external classes)
|
|
82
|
+
* Passes through unchanged to generated code
|
|
83
|
+
*/
|
|
84
|
+
interface TExternalType {
|
|
85
|
+
readonly kind: "external";
|
|
86
|
+
readonly name: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Discriminated union of all C-Next types
|
|
91
|
+
*/
|
|
92
|
+
type TType =
|
|
93
|
+
| TPrimitiveType
|
|
94
|
+
| TStructType
|
|
95
|
+
| TEnumType
|
|
96
|
+
| TBitmapType
|
|
97
|
+
| TArrayType
|
|
98
|
+
| TStringType
|
|
99
|
+
| TCallbackType
|
|
100
|
+
| TRegisterType
|
|
101
|
+
| TExternalType;
|
|
102
|
+
|
|
103
|
+
export default TType;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import TSymbolKindCNext from "./TSymbolKindCNext";
|
|
2
|
+
import TSymbolKindC from "./TSymbolKindC";
|
|
3
|
+
import TSymbolKindCpp from "./TSymbolKindCpp";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Union of all symbol kinds across supported languages.
|
|
7
|
+
*/
|
|
8
|
+
type TSymbolKind = TSymbolKindCNext | TSymbolKindC | TSymbolKindCpp;
|
|
9
|
+
|
|
10
|
+
export default TSymbolKind;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Symbol kinds for C-Next language constructs.
|
|
3
|
+
*/
|
|
4
|
+
type TSymbolKindCNext =
|
|
5
|
+
| "function"
|
|
6
|
+
| "variable"
|
|
7
|
+
| "struct"
|
|
8
|
+
| "enum"
|
|
9
|
+
| "enum_member"
|
|
10
|
+
| "bitmap"
|
|
11
|
+
| "bitmap_field"
|
|
12
|
+
| "register"
|
|
13
|
+
| "register_member"
|
|
14
|
+
| "scope";
|
|
15
|
+
|
|
16
|
+
export default TSymbolKindCNext;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type TSymbolKindCNext from "../symbol-kinds/TSymbolKindCNext";
|
|
2
|
+
import type ESourceLanguage from "../../../utils/types/ESourceLanguage";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Base interface for all symbol types.
|
|
6
|
+
* All concrete symbol interfaces extend this with a narrowed `kind` literal.
|
|
7
|
+
*/
|
|
8
|
+
interface IBaseSymbol {
|
|
9
|
+
/** Symbol kind - discriminator for type narrowing */
|
|
10
|
+
readonly kind: TSymbolKindCNext;
|
|
11
|
+
|
|
12
|
+
/** Symbol name */
|
|
13
|
+
readonly name: string;
|
|
14
|
+
|
|
15
|
+
/** Scope this symbol belongs to (circular reference resolved at runtime) */
|
|
16
|
+
readonly scope: IBaseSymbol;
|
|
17
|
+
|
|
18
|
+
/** Source file where the symbol is defined */
|
|
19
|
+
readonly sourceFile: string;
|
|
20
|
+
|
|
21
|
+
/** Line number in the source file */
|
|
22
|
+
readonly sourceLine: number;
|
|
23
|
+
|
|
24
|
+
/** Source language (CNext, C, Cpp) */
|
|
25
|
+
readonly sourceLanguage: ESourceLanguage;
|
|
26
|
+
|
|
27
|
+
/** Whether this symbol is exported/public */
|
|
28
|
+
readonly isExported: boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default IBaseSymbol;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type IBaseSymbol from "./IBaseSymbol";
|
|
2
|
+
import type IBitmapFieldInfo from "./IBitmapFieldInfo";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Symbol representing a bitmap type definition.
|
|
6
|
+
*/
|
|
7
|
+
interface IBitmapSymbol extends IBaseSymbol {
|
|
8
|
+
/** Discriminator narrowed to "bitmap" */
|
|
9
|
+
readonly kind: "bitmap";
|
|
10
|
+
|
|
11
|
+
/** Backing integer type (e.g., "u8", "u32") */
|
|
12
|
+
readonly backingType: string;
|
|
13
|
+
|
|
14
|
+
/** Total bit width of the bitmap */
|
|
15
|
+
readonly bitWidth: number;
|
|
16
|
+
|
|
17
|
+
/** Map of field name to bit offset/width metadata */
|
|
18
|
+
readonly fields: ReadonlyMap<string, IBitmapFieldInfo>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default IBitmapSymbol;
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import IBaseSymbol from "./IBaseSymbol";
|
|
1
|
+
import type IBaseSymbol from "./IBaseSymbol";
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* Symbol representing an enum type definition.
|
|
6
5
|
*/
|
|
7
6
|
interface IEnumSymbol extends IBaseSymbol {
|
|
8
|
-
/**
|
|
9
|
-
kind:
|
|
7
|
+
/** Discriminator narrowed to "enum" */
|
|
8
|
+
readonly kind: "enum";
|
|
10
9
|
|
|
11
10
|
/** Map of member name to numeric value */
|
|
12
|
-
members:
|
|
11
|
+
readonly members: ReadonlyMap<string, number>;
|
|
13
12
|
|
|
14
13
|
/** Optional explicit bit width (e.g., 8 for u8 backing type) */
|
|
15
|
-
bitWidth?: number;
|
|
14
|
+
readonly bitWidth?: number;
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
export default IEnumSymbol;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type TType from "../TType";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Metadata for a struct field.
|
|
5
|
+
*/
|
|
6
|
+
interface IFieldInfo {
|
|
7
|
+
/** Field name */
|
|
8
|
+
readonly name: string;
|
|
9
|
+
|
|
10
|
+
/** Field type */
|
|
11
|
+
readonly type: TType;
|
|
12
|
+
|
|
13
|
+
/** Whether this field is const */
|
|
14
|
+
readonly isConst: boolean;
|
|
15
|
+
|
|
16
|
+
/** Whether this field is atomic (volatile in C) */
|
|
17
|
+
readonly isAtomic: boolean;
|
|
18
|
+
|
|
19
|
+
/** Whether this field is an array */
|
|
20
|
+
readonly isArray: boolean;
|
|
21
|
+
|
|
22
|
+
/** Array dimensions if isArray is true */
|
|
23
|
+
readonly dimensions?: ReadonlyArray<number | string>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default IFieldInfo;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type IBaseSymbol from "./IBaseSymbol";
|
|
2
|
+
import type IScopeSymbol from "./IScopeSymbol";
|
|
3
|
+
import type IParameterInfo from "./IParameterInfo";
|
|
4
|
+
import type TType from "../TType";
|
|
5
|
+
import type TVisibility from "../TVisibility";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Symbol representing a function definition.
|
|
9
|
+
*/
|
|
10
|
+
interface IFunctionSymbol extends IBaseSymbol {
|
|
11
|
+
/** Discriminator narrowed to "function" */
|
|
12
|
+
readonly kind: "function";
|
|
13
|
+
|
|
14
|
+
/** Scope this function belongs to (overrides IBaseSymbol.scope with specific type) */
|
|
15
|
+
readonly scope: IScopeSymbol;
|
|
16
|
+
|
|
17
|
+
/** Function parameters */
|
|
18
|
+
readonly parameters: ReadonlyArray<IParameterInfo>;
|
|
19
|
+
|
|
20
|
+
/** Return type */
|
|
21
|
+
readonly returnType: TType;
|
|
22
|
+
|
|
23
|
+
/** Visibility within scope */
|
|
24
|
+
readonly visibility: TVisibility;
|
|
25
|
+
|
|
26
|
+
/** AST reference for function body (unknown to avoid parser dependency) */
|
|
27
|
+
readonly body: unknown;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default IFunctionSymbol;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type TType from "../TType";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Metadata for a function parameter.
|
|
5
|
+
*/
|
|
6
|
+
interface IParameterInfo {
|
|
7
|
+
/** Parameter name */
|
|
8
|
+
readonly name: string;
|
|
9
|
+
|
|
10
|
+
/** Parameter type */
|
|
11
|
+
readonly type: TType;
|
|
12
|
+
|
|
13
|
+
/** Whether this parameter is const */
|
|
14
|
+
readonly isConst: boolean;
|
|
15
|
+
|
|
16
|
+
/** Whether this parameter is an array */
|
|
17
|
+
readonly isArray: boolean;
|
|
18
|
+
|
|
19
|
+
/** Array dimensions if isArray is true */
|
|
20
|
+
readonly arrayDimensions?: ReadonlyArray<number | string>;
|
|
21
|
+
|
|
22
|
+
/** Issue #268: true if parameter should get auto-const (unmodified pointer) */
|
|
23
|
+
readonly isAutoConst?: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default IParameterInfo;
|