@alloy-js/typescript 0.20.0-dev.0 → 0.20.0-dev.2
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/dist/src/builtins/index.js +2 -1
- package/dist/src/builtins/index.js.map +1 -0
- package/dist/src/builtins/node.d.ts +1 -1
- package/dist/src/builtins/node.js +2 -1
- package/dist/src/builtins/node.js.map +1 -0
- package/dist/src/components/ArrayExpression.js +2 -1
- package/dist/src/components/ArrayExpression.js.map +1 -0
- package/dist/src/components/ArrowFunction.d.ts.map +1 -1
- package/dist/src/components/ArrowFunction.js +9 -14
- package/dist/src/components/ArrowFunction.js.map +1 -0
- package/dist/src/components/BarrelFile.js +2 -1
- package/dist/src/components/BarrelFile.js.map +1 -0
- package/dist/src/components/BlockScope.d.ts.map +1 -1
- package/dist/src/components/BlockScope.js +5 -3
- package/dist/src/components/BlockScope.js.map +1 -0
- package/dist/src/components/CallSignature.js +2 -1
- package/dist/src/components/CallSignature.js.map +1 -0
- package/dist/src/components/ClassDeclaration.d.ts.map +1 -1
- package/dist/src/components/ClassDeclaration.js +22 -31
- package/dist/src/components/ClassDeclaration.js.map +1 -0
- package/dist/src/components/CommaList.js +2 -1
- package/dist/src/components/CommaList.js.map +1 -0
- package/dist/src/components/Declaration.d.ts +2 -9
- package/dist/src/components/Declaration.d.ts.map +1 -1
- package/dist/src/components/Declaration.js +22 -44
- package/dist/src/components/Declaration.js.map +1 -0
- package/dist/src/components/EnumDeclaration.d.ts.map +1 -1
- package/dist/src/components/EnumDeclaration.js +7 -10
- package/dist/src/components/EnumDeclaration.js.map +1 -0
- package/dist/src/components/EnumMember.d.ts.map +1 -1
- package/dist/src/components/EnumMember.js +5 -5
- package/dist/src/components/EnumMember.js.map +1 -0
- package/dist/src/components/ExportStatement.d.ts.map +1 -1
- package/dist/src/components/ExportStatement.js +4 -2
- package/dist/src/components/ExportStatement.js.map +1 -0
- package/dist/src/components/FunctionBase.d.ts.map +1 -1
- package/dist/src/components/FunctionBase.js +17 -13
- package/dist/src/components/FunctionBase.js.map +1 -0
- package/dist/src/components/FunctionCallExpression.js +2 -1
- package/dist/src/components/FunctionCallExpression.js.map +1 -0
- package/dist/src/components/FunctionDeclaration.d.ts.map +1 -1
- package/dist/src/components/FunctionDeclaration.js +5 -4
- package/dist/src/components/FunctionDeclaration.js.map +1 -0
- package/dist/src/components/FunctionExpression.d.ts.map +1 -1
- package/dist/src/components/FunctionExpression.js +9 -14
- package/dist/src/components/FunctionExpression.js.map +1 -0
- package/dist/src/components/FunctionType.d.ts.map +1 -1
- package/dist/src/components/FunctionType.js +5 -4
- package/dist/src/components/FunctionType.js.map +1 -0
- package/dist/src/components/IfStatement.d.ts.map +1 -1
- package/dist/src/components/IfStatement.js +4 -2
- package/dist/src/components/IfStatement.js.map +1 -0
- package/dist/src/components/ImportStatement.d.ts.map +1 -1
- package/dist/src/components/ImportStatement.js +5 -5
- package/dist/src/components/ImportStatement.js.map +1 -0
- package/dist/src/components/Interface.d.ts.map +1 -1
- package/dist/src/components/Interface.js +16 -14
- package/dist/src/components/Interface.js.map +1 -0
- package/dist/src/components/InterfaceMethod.d.ts.map +1 -1
- package/dist/src/components/InterfaceMethod.js +6 -4
- package/dist/src/components/InterfaceMethod.js.map +1 -0
- package/dist/src/components/JSDoc.js +2 -1
- package/dist/src/components/JSDoc.js.map +1 -0
- package/dist/src/components/JSDocComment.js +2 -1
- package/dist/src/components/JSDocComment.js.map +1 -0
- package/dist/src/components/JSDocExample.js +2 -1
- package/dist/src/components/JSDocExample.js.map +1 -0
- package/dist/src/components/JSDocParam.js +2 -1
- package/dist/src/components/JSDocParam.js.map +1 -0
- package/dist/src/components/LexicalScope.d.ts +12 -0
- package/dist/src/components/LexicalScope.d.ts.map +1 -0
- package/dist/src/components/LexicalScope.js +25 -0
- package/dist/src/components/LexicalScope.js.map +1 -0
- package/dist/src/components/MemberDeclaration.d.ts +1 -10
- package/dist/src/components/MemberDeclaration.d.ts.map +1 -1
- package/dist/src/components/MemberDeclaration.js +5 -8
- package/dist/src/components/MemberDeclaration.js.map +1 -0
- package/dist/src/components/MemberExpression.d.ts.map +1 -1
- package/dist/src/components/MemberExpression.js +15 -6
- package/dist/src/components/MemberExpression.js.map +1 -0
- package/dist/src/components/MemberScope.d.ts +15 -0
- package/dist/src/components/MemberScope.d.ts.map +1 -0
- package/dist/src/components/MemberScope.js +18 -0
- package/dist/src/components/MemberScope.js.map +1 -0
- package/dist/src/components/NewExpression.d.ts.map +1 -1
- package/dist/src/components/NewExpression.js +7 -6
- package/dist/src/components/NewExpression.js.map +1 -0
- package/dist/src/components/ObjectExpression.d.ts.map +1 -1
- package/dist/src/components/ObjectExpression.js +12 -15
- package/dist/src/components/ObjectExpression.js.map +1 -0
- package/dist/src/components/PackageDirectory.js +2 -1
- package/dist/src/components/PackageDirectory.js.map +1 -0
- package/dist/src/components/PackageJson.js +2 -1
- package/dist/src/components/PackageJson.js.map +1 -0
- package/dist/src/components/PropertyName.js +3 -3
- package/dist/src/components/PropertyName.js.map +1 -0
- package/dist/src/components/Reference.js +2 -1
- package/dist/src/components/Reference.js.map +1 -0
- package/dist/src/components/SingleLineCommentBlock.js +2 -1
- package/dist/src/components/SingleLineCommentBlock.js.map +1 -0
- package/dist/src/components/SourceFile.d.ts.map +1 -1
- package/dist/src/components/SourceFile.js +5 -3
- package/dist/src/components/SourceFile.js.map +1 -0
- package/dist/src/components/SwitchStatement.js +2 -1
- package/dist/src/components/SwitchStatement.js.map +1 -0
- package/dist/src/components/TsConfigJson.js +2 -1
- package/dist/src/components/TsConfigJson.js.map +1 -0
- package/dist/src/components/TypeDeclaration.js +2 -1
- package/dist/src/components/TypeDeclaration.js.map +1 -0
- package/dist/src/components/TypeRefContext.js +2 -1
- package/dist/src/components/TypeRefContext.js.map +1 -0
- package/dist/src/components/ValueExpression.js +2 -1
- package/dist/src/components/ValueExpression.js.map +1 -0
- package/dist/src/components/VarDeclaration.d.ts.map +1 -1
- package/dist/src/components/VarDeclaration.js +16 -27
- package/dist/src/components/VarDeclaration.js.map +1 -0
- package/dist/src/components/index.js +2 -1
- package/dist/src/components/index.js.map +1 -0
- package/dist/src/components/interface/expression.test.js +2 -1
- package/dist/src/components/interface/expression.test.js.map +1 -0
- package/dist/src/components/stc/index.js +2 -1
- package/dist/src/components/stc/index.js.map +1 -0
- package/dist/src/context/index.d.ts +1 -1
- package/dist/src/context/index.d.ts.map +1 -1
- package/dist/src/context/index.js +2 -1
- package/dist/src/context/index.js.map +1 -0
- package/dist/src/context/type-ref-context.js +2 -1
- package/dist/src/context/type-ref-context.js.map +1 -0
- package/dist/src/create-package.d.ts.map +1 -1
- package/dist/src/create-package.js +13 -34
- package/dist/src/create-package.js.map +1 -0
- package/dist/src/index.js +2 -1
- package/dist/src/index.js.map +1 -0
- package/dist/src/name-conflict-resolver.js +2 -1
- package/dist/src/name-conflict-resolver.js.map +1 -0
- package/dist/src/name-policy.js +2 -1
- package/dist/src/name-policy.js.map +1 -0
- package/dist/src/parameter-descriptor.js +2 -1
- package/dist/src/parameter-descriptor.js.map +1 -0
- package/dist/src/source-directory-data.js +2 -1
- package/dist/src/source-directory-data.js.map +1 -0
- package/dist/src/symbols/index.d.ts +19 -0
- package/dist/src/symbols/index.d.ts.map +1 -1
- package/dist/src/symbols/index.js +73 -1
- package/dist/src/symbols/index.js.map +1 -0
- package/dist/src/symbols/reference.d.ts +2 -2
- package/dist/src/symbols/reference.d.ts.map +1 -1
- package/dist/src/symbols/reference.js +69 -70
- package/dist/src/symbols/reference.js.map +1 -0
- package/dist/src/symbols/scopes.d.ts +5 -8
- package/dist/src/symbols/scopes.d.ts.map +1 -1
- package/dist/src/symbols/scopes.js +28 -1
- package/dist/src/symbols/scopes.js.map +1 -0
- package/dist/src/symbols/ts-lexical-scope.d.ts +12 -0
- package/dist/src/symbols/ts-lexical-scope.d.ts.map +1 -0
- package/dist/src/symbols/ts-lexical-scope.js +17 -0
- package/dist/src/symbols/ts-lexical-scope.js.map +1 -0
- package/dist/src/symbols/ts-member-scope.d.ts +12 -4
- package/dist/src/symbols/ts-member-scope.d.ts.map +1 -1
- package/dist/src/symbols/ts-member-scope.js +17 -7
- package/dist/src/symbols/ts-member-scope.js.map +1 -0
- package/dist/src/symbols/ts-module-scope.d.ts +8 -3
- package/dist/src/symbols/ts-module-scope.d.ts.map +1 -1
- package/dist/src/symbols/ts-module-scope.js +31 -19
- package/dist/src/symbols/ts-module-scope.js.map +1 -0
- package/dist/src/symbols/ts-output-symbol.d.ts +19 -18
- package/dist/src/symbols/ts-output-symbol.d.ts.map +1 -1
- package/dist/src/symbols/ts-output-symbol.js +62 -38
- package/dist/src/symbols/ts-output-symbol.js.map +1 -0
- package/dist/src/symbols/ts-package-scope.d.ts +1 -1
- package/dist/src/symbols/ts-package-scope.d.ts.map +1 -1
- package/dist/src/symbols/ts-package-scope.js +6 -6
- package/dist/src/symbols/ts-package-scope.js.map +1 -0
- package/dist/src/utils.d.ts +4 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +25 -2
- package/dist/src/utils.js.map +1 -0
- package/dist/test/array.test.js +2 -1
- package/dist/test/array.test.js.map +1 -0
- package/dist/test/arrow-function.test.js +2 -1
- package/dist/test/arrow-function.test.js.map +1 -0
- package/dist/test/barrel.test.js +26 -17
- package/dist/test/barrel.test.js.map +1 -0
- package/dist/test/basic.test.js +22 -26
- package/dist/test/basic.test.js.map +1 -0
- package/dist/test/block-scope.test.js +2 -1
- package/dist/test/block-scope.test.js.map +1 -0
- package/dist/test/class.test.js +24 -18
- package/dist/test/class.test.js.map +1 -0
- package/dist/test/enum-jsdoc.test.js +2 -1
- package/dist/test/enum-jsdoc.test.js.map +1 -0
- package/dist/test/enum.test.js +2 -1
- package/dist/test/enum.test.js.map +1 -0
- package/dist/test/externals.test.js +12 -51
- package/dist/test/externals.test.js.map +1 -0
- package/dist/test/function-call-expression.test.js +9 -8
- package/dist/test/function-call-expression.test.js.map +1 -0
- package/dist/test/function-declaration-jsdoc.test.js +2 -1
- package/dist/test/function-declaration-jsdoc.test.js.map +1 -0
- package/dist/test/function-declaration.test.js +2 -1
- package/dist/test/function-declaration.test.js.map +1 -0
- package/dist/test/function-expression.test.js +2 -1
- package/dist/test/function-expression.test.js.map +1 -0
- package/dist/test/function-type.test.js +2 -1
- package/dist/test/function-type.test.js.map +1 -0
- package/dist/test/if-statement.test.js +2 -1
- package/dist/test/if-statement.test.js.map +1 -0
- package/dist/test/imports.test.d.ts.map +1 -1
- package/dist/test/imports.test.js +62 -60
- package/dist/test/imports.test.js.map +1 -0
- package/dist/test/interface-jsdoc.test.js +2 -1
- package/dist/test/interface-jsdoc.test.js.map +1 -0
- package/dist/test/interface.test.js +2 -1
- package/dist/test/interface.test.js.map +1 -0
- package/dist/test/jscomment.test.js +2 -1
- package/dist/test/jscomment.test.js.map +1 -0
- package/dist/test/jsdoc.test.js +2 -1
- package/dist/test/jsdoc.test.js.map +1 -0
- package/dist/test/jsdocparam.test.js +2 -1
- package/dist/test/jsdocparam.test.js.map +1 -0
- package/dist/test/member-expression.test.js +8 -7
- package/dist/test/member-expression.test.js.map +1 -0
- package/dist/test/name-conflict.test.js +5 -7
- package/dist/test/name-conflict.test.js.map +1 -0
- package/dist/test/name-policy.test.js +9 -13
- package/dist/test/name-policy.test.js.map +1 -0
- package/dist/test/new-expression.test.js +6 -7
- package/dist/test/new-expression.test.js.map +1 -0
- package/dist/test/object.test.js +2 -1
- package/dist/test/object.test.js.map +1 -0
- package/dist/test/package-external.test.js +71 -66
- package/dist/test/package-external.test.js.map +1 -0
- package/dist/test/package-json.test.js +8 -10
- package/dist/test/package-json.test.js.map +1 -0
- package/dist/test/package.test.js +12 -12
- package/dist/test/package.test.js.map +1 -0
- package/dist/test/reference.test.js +10 -12
- package/dist/test/reference.test.js.map +1 -0
- package/dist/test/source-file.test.js +7 -10
- package/dist/test/source-file.test.js.map +1 -0
- package/dist/test/switch-statement.test.js +2 -1
- package/dist/test/switch-statement.test.js.map +1 -0
- package/dist/test/utils.js +6 -2
- package/dist/test/utils.js.map +1 -0
- package/dist/test/value-expression.test.js +2 -1
- package/dist/test/value-expression.test.js.map +1 -0
- package/dist/test/values.test.d.ts.map +1 -1
- package/dist/test/values.test.js +11 -8
- package/dist/test/values.test.js.map +1 -0
- package/dist/test/var-declaration-jsdoc.test.js +2 -1
- package/dist/test/var-declaration-jsdoc.test.js.map +1 -0
- package/dist/test/var-declaration.test.d.ts.map +1 -1
- package/dist/test/var-declaration.test.js +21 -12
- package/dist/test/var-declaration.test.js.map +1 -0
- package/dist/test/vitest.setup.js +2 -1
- package/dist/test/vitest.setup.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/components/ArrowFunction.tsx +7 -10
- package/src/components/BlockScope.tsx +3 -3
- package/src/components/ClassDeclaration.tsx +19 -44
- package/src/components/Declaration.tsx +22 -53
- package/src/components/EnumDeclaration.tsx +4 -11
- package/src/components/EnumMember.tsx +3 -3
- package/src/components/ExportStatement.tsx +2 -1
- package/src/components/FunctionBase.tsx +33 -28
- package/src/components/FunctionDeclaration.tsx +3 -3
- package/src/components/FunctionExpression.tsx +7 -10
- package/src/components/FunctionType.tsx +3 -3
- package/src/components/IfStatement.tsx +2 -1
- package/src/components/ImportStatement.tsx +4 -8
- package/src/components/Interface.tsx +15 -22
- package/src/components/InterfaceMethod.tsx +4 -4
- package/src/components/LexicalScope.tsx +27 -0
- package/src/components/MemberDeclaration.tsx +8 -20
- package/src/components/MemberExpression.tsx +25 -5
- package/src/components/MemberScope.tsx +29 -0
- package/src/components/NewExpression.tsx +4 -5
- package/src/components/ObjectExpression.tsx +11 -18
- package/src/components/PropertyName.tsx +2 -2
- package/src/components/SourceFile.tsx +3 -1
- package/src/components/VarDeclaration.tsx +14 -28
- package/src/context/index.ts +1 -1
- package/src/create-package.ts +10 -39
- package/src/symbols/index.ts +118 -0
- package/src/symbols/reference.tsx +163 -0
- package/src/symbols/scopes.ts +38 -13
- package/src/symbols/ts-lexical-scope.ts +18 -0
- package/src/symbols/ts-member-scope.ts +23 -6
- package/src/symbols/ts-module-scope.ts +31 -21
- package/src/symbols/ts-output-symbol.ts +111 -49
- package/src/symbols/ts-package-scope.ts +5 -5
- package/src/utils.ts +38 -1
- package/temp/api.json +1641 -713
- package/test/barrel.test.tsx +24 -18
- package/test/basic.test.tsx +20 -29
- package/test/class.test.tsx +28 -18
- package/test/externals.test.tsx +10 -57
- package/test/function-call-expression.test.tsx +6 -7
- package/test/imports.test.tsx +57 -74
- package/test/member-expression.test.tsx +5 -13
- package/test/name-conflict.test.tsx +4 -7
- package/test/name-policy.test.tsx +7 -15
- package/test/new-expression.test.tsx +4 -7
- package/test/package-external.test.tsx +69 -73
- package/test/package-json.test.tsx +6 -11
- package/test/package.test.tsx +8 -11
- package/test/reference.test.tsx +10 -15
- package/test/source-file.test.tsx +5 -11
- package/test/utils.tsx +1 -1
- package/test/values.test.tsx +8 -8
- package/test/var-declaration.test.tsx +19 -20
- package/tsdoc-metadata.json +1 -1
- package/dist/src/context/private-scope.d.ts +0 -18
- package/dist/src/context/private-scope.d.ts.map +0 -1
- package/dist/src/context/private-scope.js +0 -8
- package/src/context/private-scope.ts +0 -23
- package/src/symbols/reference.ts +0 -197
package/src/create-package.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
type Binder,
|
|
3
3
|
getSymbolCreatorSymbol,
|
|
4
|
-
|
|
4
|
+
OutputMemberSpace,
|
|
5
5
|
type Refkey,
|
|
6
6
|
refkey,
|
|
7
7
|
SymbolCreator,
|
|
8
8
|
} from "@alloy-js/core";
|
|
9
9
|
import {
|
|
10
10
|
TSModuleScope,
|
|
11
|
-
TSOutputScope,
|
|
12
11
|
TSOutputSymbol,
|
|
13
12
|
TSPackageScope,
|
|
14
13
|
} from "./symbols/index.js";
|
|
@@ -120,13 +119,12 @@ function assignMembers(
|
|
|
120
119
|
keys: Record<string, any>,
|
|
121
120
|
isStatic: boolean,
|
|
122
121
|
) {
|
|
123
|
-
let
|
|
122
|
+
let space: OutputMemberSpace;
|
|
123
|
+
|
|
124
124
|
if (isStatic) {
|
|
125
|
-
|
|
126
|
-
scope = ownerSym.staticMemberScope!;
|
|
125
|
+
space = ownerSym.staticMembers!;
|
|
127
126
|
} else {
|
|
128
|
-
|
|
129
|
-
scope = ownerSym.instanceMemberScope!;
|
|
127
|
+
space = ownerSym.instanceMembers!;
|
|
130
128
|
}
|
|
131
129
|
|
|
132
130
|
const namespace = isStatic ? "static" : "instance";
|
|
@@ -138,28 +136,13 @@ function assignMembers(
|
|
|
138
136
|
const memberKey = keys[namespace][memberObj.name];
|
|
139
137
|
if (!memberKey) continue; // Skip if key doesn't exist
|
|
140
138
|
|
|
141
|
-
|
|
142
|
-
isStatic ?
|
|
143
|
-
OutputSymbolFlags.StaticMember
|
|
144
|
-
: OutputSymbolFlags.InstanceMember;
|
|
145
|
-
if (memberObj.staticMembers?.length) {
|
|
146
|
-
memberFlags |= OutputSymbolFlags.StaticMemberContainer;
|
|
147
|
-
}
|
|
148
|
-
if (memberObj.instanceMembers?.length) {
|
|
149
|
-
memberFlags |= OutputSymbolFlags.InstanceMemberContainer;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
const memberSym = new TSOutputSymbol(memberObj.name, {
|
|
153
|
-
scope,
|
|
139
|
+
const memberSym = new TSOutputSymbol(memberObj.name, space, {
|
|
154
140
|
binder,
|
|
155
141
|
refkeys: memberKey,
|
|
156
142
|
export: false,
|
|
157
143
|
default: false,
|
|
158
|
-
flags: memberFlags,
|
|
159
144
|
});
|
|
160
145
|
|
|
161
|
-
scope.symbols.add(memberSym);
|
|
162
|
-
|
|
163
146
|
// Recursively handle nested static and instance members
|
|
164
147
|
if (memberObj.staticMembers && isStatic) {
|
|
165
148
|
assignMembers(
|
|
@@ -199,17 +182,15 @@ function createSymbols(
|
|
|
199
182
|
|
|
200
183
|
for (const [path, symbols] of Object.entries(props.descriptor)) {
|
|
201
184
|
const keys = path === "." ? refkeys : refkeys[path];
|
|
202
|
-
const moduleScope = new TSModuleScope(path, {
|
|
185
|
+
const moduleScope = new TSModuleScope(path, pkgScope, {
|
|
203
186
|
binder,
|
|
204
|
-
parent: pkgScope,
|
|
205
187
|
});
|
|
206
188
|
|
|
207
189
|
pkgScope.exportedSymbols.set(path, moduleScope);
|
|
208
190
|
|
|
209
191
|
if (symbols.default) {
|
|
210
192
|
const key = keys.default;
|
|
211
|
-
const sym = new TSOutputSymbol(symbols.default, {
|
|
212
|
-
scope: moduleScope,
|
|
193
|
+
const sym = new TSOutputSymbol(symbols.default, moduleScope.values, {
|
|
213
194
|
refkeys: key,
|
|
214
195
|
export: true,
|
|
215
196
|
default: true,
|
|
@@ -223,22 +204,12 @@ function createSymbols(
|
|
|
223
204
|
{ name: exportedName }
|
|
224
205
|
: exportedName;
|
|
225
206
|
const key = keys[namedRef.name];
|
|
226
|
-
|
|
227
|
-
let flags = OutputSymbolFlags.None;
|
|
228
|
-
if (namedRef.staticMembers?.length) {
|
|
229
|
-
flags |= OutputSymbolFlags.StaticMemberContainer;
|
|
230
|
-
}
|
|
231
|
-
if (namedRef.instanceMembers?.length) {
|
|
232
|
-
flags |= OutputSymbolFlags.InstanceMemberContainer;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
const ownerSym = new TSOutputSymbol(namedRef.name, {
|
|
207
|
+
const ownerSym = new TSOutputSymbol(namedRef.name, moduleScope.values, {
|
|
236
208
|
binder,
|
|
237
|
-
scope: moduleScope,
|
|
238
209
|
refkeys: key,
|
|
239
210
|
export: true,
|
|
240
211
|
default: false,
|
|
241
|
-
|
|
212
|
+
hasInstanceMembers: !!namedRef.instanceMembers?.length,
|
|
242
213
|
});
|
|
243
214
|
moduleScope.exportedSymbols.set(key, ownerSym);
|
|
244
215
|
|
package/src/symbols/index.ts
CHANGED
|
@@ -1,6 +1,124 @@
|
|
|
1
|
+
import { OutputScopeOptions } from "@alloy-js/core";
|
|
2
|
+
import { useLexicalScope, useMemberOwner } from "../utils.js";
|
|
3
|
+
import { useTSScope } from "./scopes.js";
|
|
4
|
+
import { TSLexicalScope } from "./ts-lexical-scope.js";
|
|
5
|
+
import { TSMemberScope } from "./ts-member-scope.js";
|
|
6
|
+
import { CreateTsSymbolOptions, TSOutputSymbol } from "./ts-output-symbol.js";
|
|
7
|
+
|
|
1
8
|
export * from "./reference.js";
|
|
2
9
|
export * from "./scopes.js";
|
|
10
|
+
export * from "./ts-lexical-scope.js";
|
|
3
11
|
export * from "./ts-member-scope.js";
|
|
4
12
|
export * from "./ts-module-scope.js";
|
|
5
13
|
export * from "./ts-output-symbol.js";
|
|
6
14
|
export * from "./ts-package-scope.js";
|
|
15
|
+
|
|
16
|
+
export function createTypeAndValueSymbol(
|
|
17
|
+
name: string,
|
|
18
|
+
options: CreateTsSymbolOptions = {},
|
|
19
|
+
) {
|
|
20
|
+
const scope = useLexicalScope();
|
|
21
|
+
const spaces = scope ? [scope.types, scope.values] : [];
|
|
22
|
+
return new TSOutputSymbol(name, spaces, options);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function createTypeSymbol(name: string, options: CreateTsSymbolOptions) {
|
|
26
|
+
const scope = useLexicalScope();
|
|
27
|
+
if (scope && !scope.types) {
|
|
28
|
+
throw new Error(
|
|
29
|
+
"Attempting to create a type symbol in a scope that does not have a type declaration space.",
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
const spaces = scope ? [scope.types] : [];
|
|
33
|
+
return new TSOutputSymbol(name, spaces, options);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function createValueSymbol(
|
|
37
|
+
name: string,
|
|
38
|
+
options: CreateTsSymbolOptions = {},
|
|
39
|
+
) {
|
|
40
|
+
const scope = useLexicalScope();
|
|
41
|
+
if (scope && !scope.values) {
|
|
42
|
+
throw new Error(
|
|
43
|
+
"Attempting to create a value symbol in a scope that does not have a value declaration space.",
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
const spaces = scope ? [scope.values] : [];
|
|
47
|
+
return new TSOutputSymbol(name, spaces, options);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function createTransientValueSymbol() {
|
|
51
|
+
return new TSOutputSymbol("transient-value", undefined, {
|
|
52
|
+
transient: true,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function createStaticMemberSymbol(
|
|
57
|
+
name: string,
|
|
58
|
+
options: CreateTsSymbolOptions = {},
|
|
59
|
+
) {
|
|
60
|
+
const owner = useMemberOwner();
|
|
61
|
+
return new TSOutputSymbol(name, owner.staticMembers, options);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function createInstanceMemberSymbol(
|
|
65
|
+
name: string,
|
|
66
|
+
options: CreateTsSymbolOptions = {},
|
|
67
|
+
) {
|
|
68
|
+
const owner = useMemberOwner();
|
|
69
|
+
return new TSOutputSymbol(name, owner.instanceMembers, options);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function createPrivateStaticMemberSymbol(
|
|
73
|
+
name: string,
|
|
74
|
+
options: CreateTsSymbolOptions = {},
|
|
75
|
+
) {
|
|
76
|
+
const owner = useMemberOwner();
|
|
77
|
+
return new TSOutputSymbol(name, owner.privateStaticMembers, options);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function createPrivateInstanceMemberSymbol(
|
|
81
|
+
name: string,
|
|
82
|
+
options: CreateTsSymbolOptions = {},
|
|
83
|
+
) {
|
|
84
|
+
const owner = useMemberOwner();
|
|
85
|
+
return new TSOutputSymbol(name, owner.privateInstanceMembers, options);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function createMemberSymbol(
|
|
89
|
+
name: string,
|
|
90
|
+
locationOptions: { jsPrivate?: boolean; static?: boolean },
|
|
91
|
+
options: CreateTsSymbolOptions = {},
|
|
92
|
+
) {
|
|
93
|
+
if (locationOptions.jsPrivate) {
|
|
94
|
+
if (locationOptions.static) {
|
|
95
|
+
return createPrivateStaticMemberSymbol(name, options);
|
|
96
|
+
} else {
|
|
97
|
+
return createPrivateInstanceMemberSymbol(name, options);
|
|
98
|
+
}
|
|
99
|
+
} else {
|
|
100
|
+
if (locationOptions.static) {
|
|
101
|
+
return createStaticMemberSymbol(name, options);
|
|
102
|
+
} else {
|
|
103
|
+
return createInstanceMemberSymbol(name, options);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function createLexicalScope(
|
|
109
|
+
name: string,
|
|
110
|
+
options: OutputScopeOptions = {},
|
|
111
|
+
) {
|
|
112
|
+
const parent = useTSScope();
|
|
113
|
+
|
|
114
|
+
return new TSLexicalScope(name, parent, options);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export function createMemberScope(
|
|
118
|
+
name: string,
|
|
119
|
+
ownerSymbol: TSOutputSymbol,
|
|
120
|
+
options: OutputScopeOptions = {},
|
|
121
|
+
) {
|
|
122
|
+
const parent = useTSScope();
|
|
123
|
+
return new TSMemberScope(name, parent, ownerSymbol, options);
|
|
124
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Children,
|
|
3
|
+
MemberResolutionContext,
|
|
4
|
+
MemberResolver,
|
|
5
|
+
memo,
|
|
6
|
+
Refkey,
|
|
7
|
+
resolve,
|
|
8
|
+
untrack,
|
|
9
|
+
useContext,
|
|
10
|
+
} from "@alloy-js/core";
|
|
11
|
+
import { MemberExpression } from "../components/MemberExpression.jsx";
|
|
12
|
+
import { usePackage } from "../components/PackageDirectory.jsx";
|
|
13
|
+
import { SourceFileContext } from "../components/SourceFile.jsx";
|
|
14
|
+
import { TSOutputScope } from "./scopes.js";
|
|
15
|
+
import { TSLexicalScope } from "./ts-lexical-scope.js";
|
|
16
|
+
import { TSModuleScope } from "./ts-module-scope.js";
|
|
17
|
+
import { TSOutputSymbol } from "./ts-output-symbol.js";
|
|
18
|
+
import { TSPackageScope } from "./ts-package-scope.js";
|
|
19
|
+
|
|
20
|
+
export interface RefOptions {
|
|
21
|
+
type?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export function ref(
|
|
24
|
+
refkey: Refkey,
|
|
25
|
+
options?: RefOptions,
|
|
26
|
+
): () => [Children, TSOutputSymbol | undefined] {
|
|
27
|
+
const sourceFile = useContext(SourceFileContext);
|
|
28
|
+
const resolveResult = resolve<TSOutputScope, TSOutputSymbol>(
|
|
29
|
+
refkey as Refkey,
|
|
30
|
+
{ memberResolver },
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
return memo(() => {
|
|
34
|
+
if (resolveResult.value === undefined) {
|
|
35
|
+
return ["<Unresolved Symbol>", undefined];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const { symbol, pathDown, memberPath, lexicalDeclaration, commonScope } =
|
|
39
|
+
resolveResult.value;
|
|
40
|
+
|
|
41
|
+
validateSymbolReachable(pathDown);
|
|
42
|
+
|
|
43
|
+
// Where the target declaration is relative to the referencing scope.
|
|
44
|
+
// * package: target symbol is in a different package
|
|
45
|
+
// * module: target symbol is in a different module
|
|
46
|
+
// * local: target symbol is within the current module
|
|
47
|
+
const targetLocation =
|
|
48
|
+
pathDown[0] instanceof TSPackageScope ? "package"
|
|
49
|
+
: pathDown[0] instanceof TSModuleScope ? "module"
|
|
50
|
+
: "local";
|
|
51
|
+
let localSymbol: TSOutputSymbol | undefined;
|
|
52
|
+
|
|
53
|
+
if (targetLocation === "package") {
|
|
54
|
+
// need package import
|
|
55
|
+
const pkg = usePackage();
|
|
56
|
+
const sourcePackage = pathDown[0] as TSPackageScope;
|
|
57
|
+
|
|
58
|
+
if (pkg && !sourcePackage.builtin) {
|
|
59
|
+
pkg.scope.addDependency(sourcePackage);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// find public dependency
|
|
63
|
+
for (const module of sourcePackage.exportedSymbols.values()) {
|
|
64
|
+
for (const refkey of lexicalDeclaration.refkeys) {
|
|
65
|
+
if (module.exportedSymbols.has(refkey)) {
|
|
66
|
+
localSymbol = untrack(() =>
|
|
67
|
+
sourceFile!.scope.addImport(lexicalDeclaration, module, {
|
|
68
|
+
type: options?.type,
|
|
69
|
+
}),
|
|
70
|
+
);
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (!localSymbol) {
|
|
77
|
+
throw new Error(
|
|
78
|
+
"The symbol " + symbol.name + " is not exported from package",
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
} else if (targetLocation === "module") {
|
|
82
|
+
localSymbol = untrack(() =>
|
|
83
|
+
sourceFile!.scope.addImport(
|
|
84
|
+
lexicalDeclaration,
|
|
85
|
+
pathDown[0] as TSModuleScope,
|
|
86
|
+
{ type: options?.type },
|
|
87
|
+
),
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const parts = [];
|
|
92
|
+
|
|
93
|
+
if (commonScope && commonScope.isMemberScope) {
|
|
94
|
+
// we are referencing a member of a type we are inside
|
|
95
|
+
if (lexicalDeclaration.isInstanceMemberSymbol) {
|
|
96
|
+
parts.push(<MemberExpression.Part id="this" />);
|
|
97
|
+
} else {
|
|
98
|
+
parts.push(<MemberExpression.Part symbol={commonScope.ownerSymbol} />);
|
|
99
|
+
}
|
|
100
|
+
parts.push(<MemberExpression.Part symbol={lexicalDeclaration} />);
|
|
101
|
+
} else {
|
|
102
|
+
parts.push(
|
|
103
|
+
<MemberExpression.Part symbol={localSymbol ?? lexicalDeclaration} />,
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
for (const part of memberPath) {
|
|
107
|
+
parts.push(<MemberExpression.Part symbol={part} />);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return [<MemberExpression children={parts} />, localSymbol ?? symbol];
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function validateSymbolReachable(path: TSOutputScope[]) {
|
|
115
|
+
for (const scope of path) {
|
|
116
|
+
if (!(scope instanceof TSModuleScope) && scope instanceof TSLexicalScope) {
|
|
117
|
+
throw new Error(
|
|
118
|
+
"Cannot reference a symbol inside a function from outside a function",
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const memberResolver: MemberResolver<TSOutputScope, TSOutputSymbol> = function (
|
|
125
|
+
owner: TSOutputSymbol,
|
|
126
|
+
member: TSOutputSymbol,
|
|
127
|
+
context: MemberResolutionContext<TSOutputScope>,
|
|
128
|
+
) {
|
|
129
|
+
if (context.isMemberAccess) {
|
|
130
|
+
if (!member.isMemberSymbol) {
|
|
131
|
+
throw new Error(`${member.name} is not a member symbol.`);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const memberOwner = owner.hasTypeSymbol ? owner.type : owner.dealias();
|
|
135
|
+
if (member.ownerSymbol !== memberOwner) {
|
|
136
|
+
throw new Error(`${member.name} is not a member of ${owner.name}.`);
|
|
137
|
+
}
|
|
138
|
+
} else {
|
|
139
|
+
if (member.isInstanceMemberSymbol) {
|
|
140
|
+
if (
|
|
141
|
+
!context.referencePath.some(
|
|
142
|
+
(s) => s.isMemberScope && s.ownerSymbol === owner,
|
|
143
|
+
)
|
|
144
|
+
) {
|
|
145
|
+
throw new Error(
|
|
146
|
+
`Cannot reference instance member '${member.name}' without an instance of '${owner.name}' in scope`,
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (member.isPrivateMemberSymbol) {
|
|
152
|
+
if (
|
|
153
|
+
!context.referencePath.some(
|
|
154
|
+
(s) => s.isMemberScope && s.ownerSymbol === owner,
|
|
155
|
+
)
|
|
156
|
+
) {
|
|
157
|
+
throw new Error(
|
|
158
|
+
`Cannot reference private member '${member.name}' outside an instance of '${owner.name} in scope'`,
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
};
|
package/src/symbols/scopes.ts
CHANGED
|
@@ -1,23 +1,48 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useScope } from "@alloy-js/core";
|
|
2
|
+
import { TSLexicalScope } from "./ts-lexical-scope.js";
|
|
2
3
|
import { TSMemberScope } from "./ts-member-scope.js";
|
|
3
4
|
import { TSModuleScope } from "./ts-module-scope.js";
|
|
4
5
|
import { TSPackageScope } from "./ts-package-scope.js";
|
|
5
6
|
|
|
6
|
-
export type TSOutputScope =
|
|
7
|
-
| TSGlobalScope
|
|
8
|
-
| TSPackageScope
|
|
9
|
-
| TSModuleScope
|
|
10
|
-
| TSFunctionScope
|
|
11
|
-
| TSMemberScope;
|
|
7
|
+
export type TSOutputScope = TSPackageScope | TSModuleScope | TSLexicalScope;
|
|
12
8
|
|
|
13
|
-
export
|
|
14
|
-
|
|
9
|
+
export function useTSScope() {
|
|
10
|
+
return useScope() as TSOutputScope;
|
|
15
11
|
}
|
|
16
12
|
|
|
17
|
-
export
|
|
18
|
-
|
|
13
|
+
export function useTSLexicalScope(): TSLexicalScope {
|
|
14
|
+
const scope = useTSScope();
|
|
15
|
+
|
|
16
|
+
if (!(scope instanceof TSLexicalScope)) {
|
|
17
|
+
throw new Error(
|
|
18
|
+
"Expected a TSLexicalScope, but got " + scope.constructor.name,
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return scope;
|
|
19
23
|
}
|
|
20
24
|
|
|
21
|
-
export function
|
|
22
|
-
|
|
25
|
+
export function useTSLexicalScopeIfPresent() {
|
|
26
|
+
const scope = useTSScope();
|
|
27
|
+
if (!scope) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
if (!(scope instanceof TSLexicalScope)) {
|
|
31
|
+
throw new Error(
|
|
32
|
+
"Expected a TSLexicalScope, but got " + scope.constructor.name,
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
return scope;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function useTSMemberScope(): TSMemberScope {
|
|
39
|
+
const scope = useTSScope();
|
|
40
|
+
|
|
41
|
+
if (!(scope instanceof TSMemberScope)) {
|
|
42
|
+
throw new Error(
|
|
43
|
+
"Expected a TSMemberScope, but got " + scope.constructor.name,
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return scope;
|
|
23
48
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { OutputScope } from "@alloy-js/core";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A lexical scope for TypeScript, which contains declaration spaces for types
|
|
5
|
+
* and values. This scope is used to hold symbols for things like variable or
|
|
6
|
+
* interface declarations.
|
|
7
|
+
*/
|
|
8
|
+
export class TSLexicalScope extends OutputScope {
|
|
9
|
+
public static readonly declarationSpaces = ["values", "types"];
|
|
10
|
+
|
|
11
|
+
get values() {
|
|
12
|
+
return this.spaceFor("values")!;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
get types() {
|
|
16
|
+
return this.spaceFor("types")!;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -1,12 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OutputScopeOptions } from "@alloy-js/core";
|
|
2
|
+
import { TSOutputScope } from "./scopes.js";
|
|
3
|
+
import { TSLexicalScope } from "./ts-lexical-scope.js";
|
|
2
4
|
import { TSOutputSymbol } from "./ts-output-symbol.js";
|
|
3
5
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* A member scope for TypeScript. Member declarations create symbols in this
|
|
8
|
+
* scope, which will be added to the owner symbol's members.
|
|
9
|
+
*/
|
|
10
|
+
export class TSMemberScope extends TSLexicalScope {
|
|
11
|
+
public static readonly declarationSpaces = [];
|
|
12
|
+
|
|
13
|
+
constructor(
|
|
14
|
+
name: string,
|
|
15
|
+
parentScope: TSOutputScope | undefined,
|
|
16
|
+
ownerSymbol: TSOutputSymbol,
|
|
17
|
+
options: OutputScopeOptions = {},
|
|
18
|
+
) {
|
|
19
|
+
options.ownerSymbol = ownerSymbol;
|
|
20
|
+
super(name, parentScope, options);
|
|
21
|
+
}
|
|
22
|
+
get ownerSymbol() {
|
|
23
|
+
return super.ownerSymbol as TSOutputSymbol;
|
|
7
24
|
}
|
|
8
25
|
|
|
9
|
-
get
|
|
10
|
-
return
|
|
26
|
+
get isMemberScope() {
|
|
27
|
+
return true;
|
|
11
28
|
}
|
|
12
29
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { reactive, Refkey, shallowReactive } from "@alloy-js/core";
|
|
2
|
+
import { TSLexicalScope } from "./ts-lexical-scope.js";
|
|
2
3
|
import { TSOutputSymbol, TSSymbolFlags } from "./ts-output-symbol.js";
|
|
3
4
|
|
|
4
5
|
export interface ImportedSymbol {
|
|
@@ -11,11 +12,11 @@ export interface AddImportOptions {
|
|
|
11
12
|
type?: boolean;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
/**
|
|
16
|
+
* A lexical scope for TypeScript which represents the top-level scope of a
|
|
17
|
+
* module. Manages the module's imported and exported symbols.
|
|
18
|
+
*/
|
|
19
|
+
export class TSModuleScope extends TSLexicalScope {
|
|
19
20
|
#exportedSymbols: Map<Refkey, TSOutputSymbol> = shallowReactive(new Map());
|
|
20
21
|
get exportedSymbols() {
|
|
21
22
|
return this.#exportedSymbols;
|
|
@@ -24,6 +25,7 @@ export class TSModuleScope extends OutputScope {
|
|
|
24
25
|
#importedSymbols: Map<TSOutputSymbol, TSOutputSymbol> = shallowReactive(
|
|
25
26
|
new Map(),
|
|
26
27
|
);
|
|
28
|
+
|
|
27
29
|
get importedSymbols() {
|
|
28
30
|
return this.#importedSymbols;
|
|
29
31
|
}
|
|
@@ -40,31 +42,28 @@ export class TSModuleScope extends OutputScope {
|
|
|
40
42
|
) {
|
|
41
43
|
const existing = this.importedSymbols.get(targetSymbol);
|
|
42
44
|
if (existing) {
|
|
43
|
-
if (!options?.type && existing.
|
|
44
|
-
existing.
|
|
45
|
+
if (!options?.type && existing.isTypeSymbol) {
|
|
46
|
+
existing.spaces.push(this.values);
|
|
45
47
|
}
|
|
46
48
|
return existing;
|
|
47
49
|
}
|
|
48
50
|
|
|
49
|
-
if (targetModule.kind !== "module") {
|
|
50
|
-
throw new Error("Cannot import symbol that isn't in module scope");
|
|
51
|
-
}
|
|
52
|
-
|
|
53
51
|
if (!this.importedModules.has(targetModule)) {
|
|
54
52
|
this.importedModules.set(targetModule, new Set());
|
|
55
53
|
}
|
|
56
54
|
|
|
57
|
-
|
|
58
|
-
binder: this.binder,
|
|
59
|
-
scope: this,
|
|
60
|
-
aliasTarget: targetSymbol,
|
|
61
|
-
tsFlags: TSSymbolFlags.LocalImportSymbol,
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
targetSymbol.copyTo(localSymbol);
|
|
55
|
+
let localSymbol;
|
|
65
56
|
|
|
66
57
|
if (options?.type) {
|
|
67
|
-
localSymbol.
|
|
58
|
+
localSymbol = new TSOutputSymbol(targetSymbol.name, this.types, {
|
|
59
|
+
aliasTarget: targetSymbol,
|
|
60
|
+
tsFlags: TSSymbolFlags.LocalImportSymbol,
|
|
61
|
+
});
|
|
62
|
+
} else {
|
|
63
|
+
localSymbol = new TSOutputSymbol(targetSymbol.name, this.values, {
|
|
64
|
+
aliasTarget: targetSymbol,
|
|
65
|
+
tsFlags: TSSymbolFlags.LocalImportSymbol,
|
|
66
|
+
});
|
|
68
67
|
}
|
|
69
68
|
|
|
70
69
|
this.importedSymbols.set(targetSymbol, localSymbol);
|
|
@@ -75,4 +74,15 @@ export class TSModuleScope extends OutputScope {
|
|
|
75
74
|
|
|
76
75
|
return localSymbol;
|
|
77
76
|
}
|
|
77
|
+
|
|
78
|
+
getAllSymbols() {
|
|
79
|
+
const allSymbols = new Set<TSOutputSymbol>();
|
|
80
|
+
for (const symbol of this.values) {
|
|
81
|
+
allSymbols.add(symbol as TSOutputSymbol);
|
|
82
|
+
}
|
|
83
|
+
for (const symbol of this.types) {
|
|
84
|
+
allSymbols.add(symbol as TSOutputSymbol);
|
|
85
|
+
}
|
|
86
|
+
return allSymbols;
|
|
87
|
+
}
|
|
78
88
|
}
|