@artel/artc 0.6.26039 → 0.8.26001

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.
Files changed (212) hide show
  1. package/build/Cli.js +3 -3
  2. package/build/api/Api.js +19 -15
  3. package/build/api/ApiNodeJS.js +3 -3
  4. package/build/api/ApiServices.js +11426 -5066
  5. package/build/{chunk-LTJPPRSR.js → chunk-55LNCV63.js} +87206 -50765
  6. package/build/{chunk-5VVFNKOH.js → chunk-6XVQ7FTB.js} +2 -2
  7. package/build/{chunk-AEW4TILW.js → chunk-PUDLDJ7V.js} +1 -1
  8. package/build/types/analysis/Analyzer.d.ts +6 -1
  9. package/build/types/analysis/TypeMemberLookup.d.ts +3 -1
  10. package/build/types/analysis/WellKnownDeclarations.d.ts +54 -0
  11. package/build/types/analysis/a/Analyzer.d.ts +4 -4
  12. package/build/types/analysis/a/IdentifierExpressionMeaning.d.ts +3 -3
  13. package/build/types/analysis/a/MemberAccessExpressionMeaning.d.ts +3 -3
  14. package/build/types/analysis/a/ModifierValidator.d.ts +3 -2
  15. package/build/types/analysis/a/ResolvedTranslationPackage.d.ts +2 -1
  16. package/build/types/analysis/a/SourceFileAnalyzer.d.ts +1 -1
  17. package/build/types/analysis/a/SourcePackageMembersCreator.d.ts +1 -2
  18. package/build/types/analysis/a/TreeQuery.d.ts +1 -2
  19. package/build/types/analysis/a/TypeMemberLookup.d.ts +3 -1
  20. package/build/types/analysis/a/semantic-context/FieldWithInitializerSemanticContext.d.ts +3 -3
  21. package/build/types/analysis/a/semantic-context/SemanticContext.d.ts +2 -2
  22. package/build/types/analysis/a/semantic-context/SemanticContextBuilder.d.ts +10 -12
  23. package/build/types/analysis/a/semantic-context/SpecialLocalDeclarationsBuilder.d.ts +0 -1
  24. package/build/types/analysis/a/semantic-context/SubprogramBodyAndParametersSemanticContext.d.ts +5 -4
  25. package/build/types/analysis/a/semantic-context/SubprogramSemanticContext.d.ts +11 -10
  26. package/build/types/analysis/a/semantic-context/TypeSemanticContext.d.ts +13 -13
  27. package/build/types/analysis/m/Analyzer.d.ts +425 -1
  28. package/build/types/analysis/m/ArgumentToParameterMatchResult.d.ts +23 -0
  29. package/build/types/analysis/m/ArgumentsToParametersMatcher.d.ts +40 -0
  30. package/build/types/analysis/m/BaseExpressionMeaning.d.ts +25 -0
  31. package/build/types/analysis/m/CallExpressionMeaning.d.ts +72 -0
  32. package/build/types/analysis/m/ConstructorCallResolver.d.ts +24 -0
  33. package/build/types/analysis/m/DeclarationsUsageCounter.d.ts +12 -0
  34. package/build/types/analysis/m/DereferenceExpressionMeaning.d.ts +28 -0
  35. package/build/types/analysis/m/ExpressionAnalysisOptions.d.ts +21 -0
  36. package/build/types/analysis/m/FunctionAccessResolver.d.ts +19 -0
  37. package/build/types/analysis/m/IdentifierExpressionMeaning.d.ts +137 -0
  38. package/build/types/analysis/m/IndexedAccessExpressionMeaning.d.ts +32 -0
  39. package/build/types/analysis/m/InstanceFieldsInitializationValidator.d.ts +18 -0
  40. package/build/types/analysis/m/MemberAccessExpressionMeaning.d.ts +137 -0
  41. package/build/types/analysis/m/ModifierFlags.d.ts +20 -0
  42. package/build/types/analysis/m/NamedTypeResolver.d.ts +44 -0
  43. package/build/types/analysis/m/NamedTypeSpecifierResolver.d.ts +19 -0
  44. package/build/types/analysis/m/ObjectExpressionMeaning.d.ts +29 -0
  45. package/build/types/analysis/m/OverloadResolver.d.ts +104 -0
  46. package/build/types/analysis/m/OwnAndBaseConstructorCallsChecker.d.ts +36 -0
  47. package/build/types/analysis/m/PackageAndStaticVariablesInitializationValidator.d.ts +17 -0
  48. package/build/types/analysis/m/ReachabilityChecker.d.ts +27 -0
  49. package/build/types/analysis/m/ReductionSourceMemberFinder.d.ts +17 -0
  50. package/build/types/analysis/m/ReservedNameDictionary.d.ts +15 -0
  51. package/build/types/analysis/m/ResolvedTranslationPackage.d.ts +68 -0
  52. package/build/types/analysis/m/ReturnTypeInferrer.d.ts +13 -0
  53. package/build/types/analysis/m/SourceFileAnalyzer.d.ts +131 -0
  54. package/build/types/analysis/m/SourcePackageMembersCreator.d.ts +7 -0
  55. package/build/types/analysis/m/SourceTypeMembersCreator.d.ts +9 -0
  56. package/build/types/analysis/m/StaticDeclarationMeaning.d.ts +32 -0
  57. package/build/types/analysis/m/SyntacticAccessKind.d.ts +6 -0
  58. package/build/types/analysis/m/TagMeaning.d.ts +70 -0
  59. package/build/types/analysis/m/TextIdentity.d.ts +7 -0
  60. package/build/types/analysis/m/TranslatedEntityNameConflictsValidator.d.ts +28 -0
  61. package/build/types/analysis/m/TreeQuery.d.ts +15 -0
  62. package/build/types/analysis/m/TypeArgumentInferrer.d.ts +52 -0
  63. package/build/types/analysis/m/TypeInferrer.d.ts +11 -0
  64. package/build/types/analysis/m/TypeMemberLookup.d.ts +4 -1
  65. package/build/types/analysis/m/TypeNarrower.d.ts +31 -0
  66. package/build/types/analysis/m/TypeOverloadResolver.d.ts +9 -0
  67. package/build/types/analysis/m/UserDefinableBinaryOperatorResolver.d.ts +34 -0
  68. package/build/types/analysis/m/UserDefinableUnaryOperatorResolver.d.ts +23 -0
  69. package/build/types/analysis/m/VariableIsAssignedChecker.d.ts +11 -0
  70. package/build/types/analysis/m/VariableIsNotAssignedChecker.d.ts +12 -0
  71. package/build/types/analysis/m/control-flow/GraphBuilder.d.ts +52 -0
  72. package/build/types/analysis/m/control-flow/GraphVisualizer.d.ts +12 -0
  73. package/build/types/analysis/m/control-flow/NarrowableExpression.d.ts +5 -0
  74. package/build/types/analysis/m/control-flow/NarrowableReference.d.ts +72 -0
  75. package/build/types/analysis/m/control-flow/Nodes.d.ts +112 -0
  76. package/build/types/analysis/m/control-flow/index.d.ts +5 -0
  77. package/build/types/analysis/m/semantic-context/Declarations.d.ts +94 -0
  78. package/build/types/analysis/m/semantic-context/FieldWithInitializerSemanticContext.d.ts +28 -0
  79. package/build/types/analysis/m/semantic-context/SemanticContext.d.ts +14 -0
  80. package/build/types/analysis/m/semantic-context/SemanticContextBase.d.ts +190 -0
  81. package/build/types/analysis/m/semantic-context/SemanticContextBuilder.d.ts +69 -0
  82. package/build/types/analysis/m/semantic-context/SemanticContextValidatingNameConflicts.d.ts +51 -0
  83. package/build/types/analysis/m/semantic-context/SemanticContextWithParent.d.ts +12 -0
  84. package/build/types/analysis/m/semantic-context/SourceFileSemanticContext.d.ts +63 -0
  85. package/build/types/analysis/m/semantic-context/StaticDeclarationSemanticContext.d.ts +26 -0
  86. package/build/types/analysis/m/semantic-context/SubprogramBodyAndParametersSemanticContext.d.ts +108 -0
  87. package/build/types/analysis/m/semantic-context/SubprogramSemanticContext.d.ts +92 -0
  88. package/build/types/analysis/m/semantic-context/TypeSemanticContext.d.ts +93 -0
  89. package/build/types/analysis/m/semantic-context/index.d.ts +10 -0
  90. package/build/types/common/LocalizationHelper.d.ts +3 -1
  91. package/build/types/common/LocalizationHelperA.d.ts +0 -2
  92. package/build/types/common/LocalizationHelperM.d.ts +13 -0
  93. package/build/types/common/Name.d.ts +1 -1
  94. package/build/types/common/index.d.ts +1 -0
  95. package/build/types/diagnostic/DiagnosticCode.d.ts +211 -192
  96. package/build/types/diagnostic/TokenDiagnosticM.d.ts +2 -0
  97. package/build/types/emitter/EmitPhaseName.d.ts +2 -2
  98. package/build/types/emitter/Entities.d.ts +4 -2
  99. package/build/types/emitter/IrBuilderM.d.ts +124 -0
  100. package/build/types/emitter/IrFactory.d.ts +2 -2
  101. package/build/types/entities/Entity.d.ts +8 -5
  102. package/build/types/entities/EntityLocalizationContext.d.ts +3 -2
  103. package/build/types/entities/OperatorKind.d.ts +13 -18
  104. package/build/types/entities/Translation.d.ts +4 -3
  105. package/build/types/entities/interfaces/AliasTypeEntity.d.ts +4 -1
  106. package/build/types/entities/interfaces/DereferenceOperatorEntity.d.ts +3 -1
  107. package/build/types/entities/interfaces/FunctionEntity.d.ts +3 -1
  108. package/build/types/entities/interfaces/FunctionTypeEntity.d.ts +3 -1
  109. package/build/types/entities/interfaces/IndexerEntity.d.ts +4 -1
  110. package/build/types/entities/interfaces/PackageAliasEntity.d.ts +4 -1
  111. package/build/types/entities/interfaces/PackageEntity.d.ts +2 -1
  112. package/build/types/entities/interfaces/ReducedTypeEntity.d.ts +3 -1
  113. package/build/types/entities/interfaces/StructuredTypeEntity.d.ts +9 -2
  114. package/build/types/entities/interfaces/TextTranslationEntity.d.ts +4 -1
  115. package/build/types/entities/interfaces/TypeExtensionEntity.d.ts +4 -1
  116. package/build/types/entities/interfaces/TypeParameterEntity.d.ts +7 -3
  117. package/build/types/entities/interfaces/VariableEntity.d.ts +3 -2
  118. package/build/types/entities/interfaces/VariantTypeEntity.d.ts +3 -1
  119. package/build/types/entities/interfaces/m/ConstructorEntityM.d.ts +10 -0
  120. package/build/types/entities/interfaces/m/DestructorEntityM.d.ts +8 -0
  121. package/build/types/entities/interfaces/m/index.d.ts +2 -0
  122. package/build/types/entities/source/a/SourceFunctionEntity.d.ts +1 -1
  123. package/build/types/entities/source/a/SourcePackageEntity.d.ts +2 -1
  124. package/build/types/entities/source/a/SourceStructuredTypeEntity.d.ts +3 -5
  125. package/build/types/entities/source/m/SourceAliasTypeEntity.d.ts +32 -0
  126. package/build/types/entities/source/m/SourceConstructorEntity.d.ts +40 -0
  127. package/build/types/entities/source/m/SourceDestructorEntity.d.ts +38 -0
  128. package/build/types/entities/source/m/SourceFunctionEntity.d.ts +252 -0
  129. package/build/types/entities/source/m/SourceFunctionTypeEntity.d.ts +35 -0
  130. package/build/types/entities/source/m/SourceGetterEntity.d.ts +122 -0
  131. package/build/types/entities/source/m/SourceIndexerEntity.d.ts +36 -0
  132. package/build/types/entities/source/m/SourcePackageAliasEntity.d.ts +22 -0
  133. package/build/types/entities/source/m/SourcePackageEntity.d.ts +68 -0
  134. package/build/types/entities/source/m/SourceSetterEntity.d.ts +122 -0
  135. package/build/types/entities/source/m/SourceStructuredTypeEntity.d.ts +111 -0
  136. package/build/types/entities/source/m/SourceTextTranslationEntity.d.ts +29 -0
  137. package/build/types/entities/source/m/SourceTypeParameterEntity.d.ts +30 -0
  138. package/build/types/entities/source/m/SourceVariableEntity.d.ts +447 -0
  139. package/build/types/entities/source/m/SourceVariantTypeEntity.d.ts +38 -0
  140. package/build/types/entities/source/m/index.d.ts +15 -0
  141. package/build/types/entities/translated/TranslatedPackageEntity.d.ts +2 -1
  142. package/build/types/entities/translated/TranslatedStructuredTypeEntity.d.ts +33 -1
  143. package/build/types/entities/translated/source/a/SourceTranslatedPackageStructuredTypeEntity.d.ts +8 -2
  144. package/build/types/entities/translated/source/m/SourceTranslatedAliasTypeEntity.d.ts +14 -0
  145. package/build/types/entities/translated/source/m/SourceTranslatedDestructorEntity.d.ts +12 -0
  146. package/build/types/entities/translated/source/m/SourceTranslatedFunctionEntity.d.ts +24 -0
  147. package/build/types/entities/translated/source/m/SourceTranslatedFunctionTypeEntity.d.ts +13 -0
  148. package/build/types/entities/translated/source/m/SourceTranslatedIndexerEntity.d.ts +12 -0
  149. package/build/types/entities/translated/source/m/SourceTranslatedPackageEntity.d.ts +19 -0
  150. package/build/types/entities/translated/source/m/SourceTranslatedPackageStructuredTypeEntity.d.ts +26 -0
  151. package/build/types/entities/translated/source/m/SourceTranslatedPackageVariantTypeEntity.d.ts +14 -0
  152. package/build/types/entities/translated/source/m/SourceTranslatedReducedTypeEntity.d.ts +14 -0
  153. package/build/types/entities/translated/source/m/index.d.ts +9 -0
  154. package/build/types/parser/a/KeywordDictionary.d.ts +2 -3
  155. package/build/types/parser/a/Parser.d.ts +2 -2
  156. package/build/types/parser/m/ConvertTokenKind.d.ts +3 -0
  157. package/build/types/parser/m/KeywordDictionary.d.ts +33 -0
  158. package/build/types/parser/m/Parser.d.ts +7 -0
  159. package/build/types/parser/m/Scanner.d.ts +56 -0
  160. package/build/types/parser/m/TokenKind.d.ts +81 -0
  161. package/build/types/parser/m/TriviaInterner.d.ts +8 -0
  162. package/build/types/project/SourceFile.d.ts +5 -6
  163. package/build/types/services/LanguageServer.d.ts +23 -12
  164. package/build/types/services/a/NodeSemanticInfo.d.ts +2 -2
  165. package/build/types/services/common/WorkspaceItemsService.d.ts +1 -0
  166. package/build/types/services/common/completion/Types.d.ts +8 -2
  167. package/build/types/services/common/display/DisplayService.d.ts +3 -0
  168. package/build/types/services/common/display/Types.d.ts +2 -2
  169. package/build/types/services/m/CodeActionsService.d.ts +10 -0
  170. package/build/types/services/m/CompletionService.d.ts +60 -0
  171. package/build/types/services/m/DefinitionService.d.ts +11 -0
  172. package/build/types/services/m/DisplayService.d.ts +52 -0
  173. package/build/types/services/m/EvaluatableExpressionService.d.ts +10 -0
  174. package/build/types/services/m/HoverService.d.ts +11 -0
  175. package/build/types/services/m/NodeSemanticInfo.d.ts +46 -0
  176. package/build/types/services/m/RenameService.d.ts +11 -0
  177. package/build/types/services/m/SelectionRangeService.d.ts +7 -0
  178. package/build/types/services/m/SemanticTokensService.d.ts +11 -0
  179. package/build/types/services/m/SourceFileItemsService.d.ts +10 -0
  180. package/build/types/services/m/TranslationService.d.ts +23 -0
  181. package/build/types/services/m/TranslationsGenerationService.d.ts +7 -0
  182. package/build/types/services/m/TreeUtils.d.ts +58 -0
  183. package/build/types/services/m/references/DefinitionInfoFinder.d.ts +6 -0
  184. package/build/types/services/m/references/ReferencesFinder.d.ts +7 -0
  185. package/build/types/services/m/signature-help/ParametersSignatureHelpProvider.d.ts +15 -0
  186. package/build/types/services/m/signature-help/SignatureHelpService.d.ts +6 -0
  187. package/build/types/services/m/signature-help/SignatureWithParameters.d.ts +94 -0
  188. package/build/types/services/m/signature-help/TypeParameterSignatureHelpProvider.d.ts +21 -0
  189. package/build/types/services/m/signature-help/utils.d.ts +9 -0
  190. package/build/types/tree/a/KeywordKind.d.ts +1 -3
  191. package/build/types/tree/a/NodeKind.d.ts +113 -114
  192. package/build/types/tree/a/Nodes.d.ts +6 -5
  193. package/build/types/tree/a/OperatorKind.d.ts +5 -0
  194. package/build/types/tree/a/Types.d.ts +9 -4
  195. package/build/types/tree/m/BaseNode.d.ts +8 -40
  196. package/build/types/tree/m/KeywordFlags.d.ts +4 -0
  197. package/build/types/tree/m/KeywordKind.d.ts +40 -0
  198. package/build/types/tree/m/NodeKind.d.ts +147 -2
  199. package/build/types/tree/m/Nodes.d.ts +2064 -9
  200. package/build/types/tree/m/NodesDebug.d.ts +9 -0
  201. package/build/types/tree/m/OperatorKind.d.ts +39 -0
  202. package/build/types/tree/m/SyntaxToCode.d.ts +107 -0
  203. package/build/types/tree/m/Token.d.ts +46 -0
  204. package/build/types/tree/m/TokenFlags.d.ts +12 -0
  205. package/build/types/tree/m/TokenKind.d.ts +61 -60
  206. package/build/types/tree/m/TreeTraversal.d.ts +18 -0
  207. package/build/types/tree/m/Types.d.ts +46 -0
  208. package/build/types/tree/m/Utils.d.ts +7 -0
  209. package/build/types/tree/m/index.d.ts +9 -0
  210. package/build/types/types/StandardTypes.d.ts +2 -0
  211. package/package.json +1 -1
  212. /package/build/types/diagnostic/{TokenDiagnostic.d.ts → TokenDiagnosticA.d.ts} +0 -0
@@ -0,0 +1,190 @@
1
+ import { Name } from '../../../common/index.js';
2
+ import { AccessorEntity, AnonymousFunctionEntity, FunctionEntity, FunctionTypeEntity, MethodEntity, NamedFunctionEntity, PackageEntity, ParameterEntity, TextTranslationEntity, TypeEntity, TypeEntityWithMembers, TypeExtensionEntity } from '../../../entities/index.js';
3
+ import { SourceFileM } from '../../../project/SourceFile.js';
4
+ import * as tree from '../../../tree/m/index.js';
5
+ import * as types from '../../../types/index.js';
6
+ import { DiagnosticArgumentFactory } from '../../DiagnosticArgumentFactory.js';
7
+ import { PackageMemberLookupContext } from '../../PackageMemberLookup.js';
8
+ import { TypeExtensionLookup, TypeMemberLookupContext } from '../../TypeMemberLookup.js';
9
+ import { Analyzer } from '../Analyzer.js';
10
+ import { NamedDeclaration, TagOrContainerWithTags, TypeOrContainerWithTypes } from './Declarations.js';
11
+ import { SemanticContext } from './SemanticContext.js';
12
+ export declare abstract class SemanticContextBase implements TypeExtensionLookup {
13
+ static readonly emptyTypesOrContainersWithTypes: readonly TypeOrContainerWithTypes[];
14
+ static readonly emptyTagsOrContainersWithTags: readonly TagOrContainerWithTags[];
15
+ static readonly emptyNamedDeclarations: readonly NamedDeclaration[];
16
+ static readonly emptyTypeExtensions: readonly TypeExtensionEntity[];
17
+ abstract readonly outer: SemanticContext | undefined;
18
+ protected abstract readonly asContext: SemanticContext;
19
+ abstract getContainingSubprogram(): SubprogramInfo | undefined;
20
+ abstract getContainingTypeOrTypeExtension(): TypeOrTypeExtension | undefined;
21
+ abstract getObjectVariableInfo(): ObjectVariableInfo | undefined;
22
+ abstract getTryStatementContext(): TryStatementContextKind | undefined;
23
+ abstract isStatic(): boolean;
24
+ abstract getTypeMemberLookupContext(): TypeMemberLookupContext;
25
+ abstract getOwnTypesOrContainersWithTypes(initialContext: SemanticContext): readonly TypeOrContainerWithTypes[];
26
+ abstract getOwnTypesOrContainersWithTypesByName(name: Name, initialContext: SemanticContext): readonly TypeOrContainerWithTypes[];
27
+ abstract getOwnTagsOrContainersWithTags(initialContext: SemanticContext): readonly TagOrContainerWithTags[];
28
+ abstract getOwnTagsOrContainersWithTagsByName(name: Name, initialContext: SemanticContext): readonly TagOrContainerWithTags[];
29
+ abstract getOwnNamedDeclarations(initialContext: SemanticContext, noInstanceMembers: boolean, lookupState: SemanticContextLookupState): readonly NamedDeclaration[];
30
+ abstract getOwnNamedDeclarationsByName(name: Name, initialContext: SemanticContext, noInstanceMembers: boolean, lookupResult: NamedDeclarationLookupResult): void;
31
+ getContainingSourceFile(): SourceFileM;
32
+ getContainingPackage(): PackageEntity;
33
+ getDiagnosticArgumentFactory(): DiagnosticArgumentFactory;
34
+ getPackageMemberLookupContext(): PackageMemberLookupContext;
35
+ getTypesOrContainersWithTypes(): readonly TypeOrContainerWithTypes[];
36
+ getTypesOrContainersWithTypesByName(name: Name): readonly TypeOrContainerWithTypes[];
37
+ getTagsOrContainersWithTags(): readonly TagOrContainerWithTags[];
38
+ getTagsOrContainersWithTagsByName(name: Name): readonly TagOrContainerWithTags[];
39
+ getNamedDeclarations(noInstanceMembers?: boolean): readonly NamedDeclaration[];
40
+ getNamedDeclarationsByName(name: Name, noInstanceMembers?: boolean): NamedDeclarationLookupResult;
41
+ getTypeExtensionsByType(type: TypeEntity): readonly TypeExtensionEntity[];
42
+ getTextTranslationEntityByTextKey(key: string): readonly TextTranslationEntity[];
43
+ private semanticContexts;
44
+ private getSourceFileContext;
45
+ }
46
+ export type SubprogramInfo = SubprogramInfo.Function | SubprogramInfo.Constructor | SubprogramInfo.Destructor | SubprogramInfo.Getter | SubprogramInfo.Setter | SubprogramInfo.FunctionLiteral | SubprogramInfo.TextTranslationFunction;
47
+ export declare namespace SubprogramInfo {
48
+ export class Function implements ISubprogramInfo {
49
+ readonly kind = "function";
50
+ private readonly analyzer;
51
+ private readonly node;
52
+ private readonly entity;
53
+ constructor(analyzer: Analyzer, node: tree.FunctionDeclaration, entity: NamedFunctionEntity);
54
+ getReturnType(): types.Type | undefined;
55
+ isGenerator(): boolean;
56
+ allowsAsyncCalls(): boolean;
57
+ getNode(): tree.FunctionDeclaration;
58
+ getEntity(): NamedFunctionEntity;
59
+ }
60
+ export class Constructor implements ISubprogramInfo {
61
+ readonly kind = "constructor";
62
+ private readonly analyzer;
63
+ private readonly node;
64
+ private readonly entity;
65
+ constructor(analyzer: Analyzer, node: tree.MethodDeclaration, entity: MethodEntity);
66
+ getReturnType(): types.Type | undefined;
67
+ isGenerator(): boolean;
68
+ allowsAsyncCalls(): boolean;
69
+ getEntity(): MethodEntity;
70
+ getNode(): tree.MethodDeclaration;
71
+ }
72
+ export class Destructor implements ISubprogramInfo {
73
+ readonly kind = "destructor";
74
+ private readonly analyzer;
75
+ private readonly node;
76
+ private readonly entity;
77
+ constructor(analyzer: Analyzer, node: tree.MethodDeclaration, entity: MethodEntity);
78
+ getReturnType(): types.Type | undefined;
79
+ isGenerator(): boolean;
80
+ allowsAsyncCalls(): boolean;
81
+ getNode(): tree.MethodDeclaration;
82
+ getEntity(): MethodEntity;
83
+ }
84
+ export class Getter implements ISubprogramInfo {
85
+ readonly kind = "getter";
86
+ private readonly analyzer;
87
+ private readonly node;
88
+ constructor(analyzer: Analyzer, node: tree.GetterDeclaration);
89
+ getReturnType(): types.Type | undefined;
90
+ isGenerator(): boolean;
91
+ allowsAsyncCalls(): boolean;
92
+ getNode(): tree.GetterDeclaration;
93
+ getEntity(): AccessorEntity;
94
+ }
95
+ export class Setter implements ISubprogramInfo {
96
+ readonly kind = "setter";
97
+ private readonly analyzer;
98
+ private readonly node;
99
+ constructor(analyzer: Analyzer, node: tree.SetterDeclaration);
100
+ getReturnType(): types.Type | undefined;
101
+ isGenerator(): boolean;
102
+ allowsAsyncCalls(): boolean;
103
+ getNode(): tree.SetterDeclaration;
104
+ getEntity(): AccessorEntity;
105
+ }
106
+ export class FunctionLiteral implements ISubprogramInfo {
107
+ readonly kind = "function-literal";
108
+ private readonly analyzer;
109
+ private readonly node;
110
+ constructor(analyzer: Analyzer, node: tree.RegularOrBlockFunctionLiteral);
111
+ getReturnType(): types.Type | undefined;
112
+ isGenerator(): boolean;
113
+ allowsAsyncCalls(): boolean;
114
+ getNode(): tree.RegularOrBlockFunctionLiteral;
115
+ getEntity(): AnonymousFunctionEntity;
116
+ }
117
+ export class TextTranslationFunction implements ISubprogramInfo {
118
+ readonly kind = "text-translation-function";
119
+ private readonly analyzer;
120
+ private readonly node;
121
+ constructor(analyzer: Analyzer, node: tree.TextTranslationFunctionDeclaration);
122
+ getReturnType(): types.Type | undefined;
123
+ isGenerator(): boolean;
124
+ allowsAsyncCalls(): boolean;
125
+ getNode(): tree.TextTranslationFunctionDeclaration;
126
+ getEntity(): TextTranslationEntity;
127
+ }
128
+ interface ISubprogramInfo {
129
+ getReturnType(): types.Type | undefined;
130
+ isGenerator(): boolean;
131
+ allowsAsyncCalls(): boolean;
132
+ getNode(): tree.SubprogramDeclarationOrLiteral;
133
+ getEntity(): SubprogramInfoEntity | undefined;
134
+ }
135
+ export {};
136
+ }
137
+ export type SubprogramInfoEntity = FunctionEntity | FunctionTypeEntity | TextTranslationEntity;
138
+ export type TypeOrTypeExtension = TypeOrTypeExtension.Type | TypeOrTypeExtension.TypeExtension;
139
+ export declare namespace TypeOrTypeExtension {
140
+ export class Type implements ITypeOrTypeExtension {
141
+ readonly value: TypeEntityWithMembers;
142
+ readonly kind = "type";
143
+ constructor(value: TypeEntityWithMembers);
144
+ getContextualTypeEntity(): TypeEntity | undefined;
145
+ getEntity(): TypeEntityWithMembers;
146
+ }
147
+ export class TypeExtension implements ITypeOrTypeExtension {
148
+ readonly value: TypeExtensionEntity;
149
+ readonly kind = "type-extension";
150
+ constructor(value: TypeExtensionEntity);
151
+ getContextualTypeEntity(): TypeEntity | undefined;
152
+ getEntity(): TypeExtensionEntity;
153
+ }
154
+ interface ITypeOrTypeExtension {
155
+ getContextualTypeEntity(): TypeEntity | undefined;
156
+ getEntity(): TypeEntityWithMembers | TypeExtensionEntity;
157
+ }
158
+ export {};
159
+ }
160
+ export type ObjectVariableInfo = ObjectVariableInfo.ContainingTypeContext | ObjectVariableInfo.ObjectParameter;
161
+ export declare namespace ObjectVariableInfo {
162
+ class ContainingTypeContext {
163
+ readonly typeOrExtension: TypeOrTypeExtension;
164
+ readonly kind = "containing-type-context";
165
+ constructor(typeOrExtension: TypeOrTypeExtension);
166
+ }
167
+ class ObjectParameter {
168
+ readonly parameter: ParameterEntity;
169
+ readonly kind = "object-parameter";
170
+ constructor(parameter: ParameterEntity);
171
+ }
172
+ }
173
+ export declare enum TryStatementContextKind {
174
+ InTryBlockWithCatchClause = 0,
175
+ InFinallyBlock = 1
176
+ }
177
+ export declare class SemanticContextLookupState {
178
+ hasSearchedInObjectVariable: boolean;
179
+ }
180
+ export declare class NamedDeclarationLookupResult {
181
+ hasSearchedInObjectVariable: boolean;
182
+ private declarations_;
183
+ private objectParameter_;
184
+ get declarations(): readonly NamedDeclaration[];
185
+ /**
186
+ * Параметр "объект", в типе которого были найден объявления.
187
+ */
188
+ get objectParameter(): ParameterEntity | undefined;
189
+ setDeclarations(declarations: readonly NamedDeclaration[], objectParameter: ParameterEntity | undefined): void;
190
+ }
@@ -0,0 +1,69 @@
1
+ import * as tree from '../../../tree/m/index.js';
2
+ import { Analyzer } from '../Analyzer.js';
3
+ import { SemanticContext } from './SemanticContext.js';
4
+ import { SourceFileSemanticContext } from './SourceFileSemanticContext.js';
5
+ import { ForStatementSemanticContext, StatementBlockSemanticContext, SubprogramParameterListSemanticContext, SubprogramTypeParameterSemanticContext, CatchClauseSemanticContext, StatementSemanticContextParent } from './SubprogramBodyAndParametersSemanticContext.js';
6
+ import { FunctionLiteralSemanticContext, FunctionSemanticContext, IndexedElementAccessorSemanticContext, OutermostSemanticContextOfSubprogram, TextTranslationFunctionDeclarationSemanticContext, VariableAccessorSemanticContext } from './SubprogramSemanticContext.js';
7
+ import { OutermostSemanticContextOfTypeOrExtension, ParametersOfFunctionTypeSemanticContext, TypeDeclarationWithTypeParameters, TypeOrExtensionDeclarationCreatingSemanticContext, TypeOrExtensionMembersSemanticContext, TypeParametersOfTypeSemanticContext } from './TypeSemanticContext.js';
8
+ export declare class SemanticContextBuilder {
9
+ private readonly analyzer;
10
+ private readonly sourceFileContexts;
11
+ private readonly indexedElementAccessorContexts;
12
+ private readonly fieldWithInitializerContexts;
13
+ private readonly forStatementContexts;
14
+ private readonly catchClauseSemanticContexts;
15
+ private readonly functionLiteralContexts;
16
+ private readonly variableAccessorContexts;
17
+ private readonly typeParametersOfTypeContexts;
18
+ private readonly parametersOfFunctionTypeContexts;
19
+ private readonly statementBlockContexts;
20
+ private readonly subprogramTypeParameterContexts;
21
+ private readonly subprogramParameterListContexts;
22
+ private readonly outermostContextsOfFunctionDeclaration;
23
+ private readonly outermostContextsOfTextTranslationFunctionDeclaration;
24
+ private readonly outermostContextsOfTypeOrExtensionDeclaration;
25
+ private readonly typeOrExtensionMembersContexts;
26
+ constructor(analyzer: Analyzer);
27
+ /**
28
+ * Возвращает контекст, содержащий узел. Если в качестве узла передан исходный файл,
29
+ * будет возвращён контекст исходного файла.
30
+ */
31
+ containing(node: tree.Node): SemanticContext;
32
+ containingWithOffset(node: tree.Node, offset: number): SemanticContext;
33
+ ofSourceFile(node: tree.SourceFile): SourceFileSemanticContext;
34
+ ofFunctionDeclarationParameters(node: tree.FunctionDeclaration): SubprogramParameterListSemanticContext;
35
+ ofVariableAccessorDeclarationParameters(node: tree.VariableAccessorDeclaration): SubprogramParameterListSemanticContext;
36
+ ofFunctionDeclarationTypeParameters(node: tree.FunctionDeclaration, typeParameterClause: tree.TypeParameterClause): SubprogramTypeParameterSemanticContext;
37
+ outermostSemanticContextOfFunctionDeclaration(node: tree.FunctionDeclaration): FunctionSemanticContext;
38
+ ofTypeWithMembersOrExtensionDeclaration(node: tree.TypeWithMembersOrExtensionDeclaration): TypeOrExtensionMembersSemanticContext;
39
+ ofLocalFunctionTypeDeclarationParameters(node: tree.LocalFunctionTypeDeclaration): ParametersOfFunctionTypeSemanticContext;
40
+ outermostSemanticContextOfTypeOrExtensionDeclaration(node: TypeOrExtensionDeclarationCreatingSemanticContext): OutermostSemanticContextOfTypeOrExtension;
41
+ ofTypeDeclarationTypeParameters(node: TypeDeclarationWithTypeParameters, typeParameterClause: tree.TypeParameterClause): TypeParametersOfTypeSemanticContext;
42
+ ofVariableAccessorDeclaration(node: tree.VariableAccessorDeclaration): VariableAccessorSemanticContext;
43
+ ofRegularOrBlockFunctionLiteralParameters(node: tree.RegularOrBlockFunctionLiteral): SubprogramParameterListSemanticContext;
44
+ ofTextTranslationDeclarationParameters(node: tree.TranslationTextTemplate): SubprogramParameterListSemanticContext;
45
+ outermostSemanticContextOfTextTranslationFunctionDeclaration(node: tree.TextTranslationFunctionDeclaration): TextTranslationFunctionDeclarationSemanticContext;
46
+ outermostSemanticContextOfRegularOrBlockFunctionLiteral(node: tree.RegularOrBlockFunctionLiteral): FunctionLiteralSemanticContext;
47
+ ofForStatement(node: tree.ForStatement): ForStatementSemanticContext;
48
+ ofStatementBlock(node: tree.StatementBlock): StatementBlockSemanticContext;
49
+ ofFunctionBlock(node: tree.FunctionBlock): StatementBlockSemanticContext;
50
+ ofStatementParent(node: tree.StatementParent): StatementSemanticContextParent;
51
+ ofIndexedElementAccessorDeclarationParameters(node: tree.IndexedElementAccessorDeclaration): SubprogramParameterListSemanticContext;
52
+ outermostSemanticContextOfIndexedElementAccessorDeclaration(node: tree.IndexedElementAccessorDeclaration): IndexedElementAccessorSemanticContext;
53
+ ofCatchClause(node: tree.CatchClause): CatchClauseSemanticContext;
54
+ ofFieldDeclarationWithInitializer(node: tree.FieldDeclaration | tree.StaticFieldDeclaration): SemanticContext;
55
+ ofSubprogram(node: tree.SubprogramDeclarationOrLiteral): OutermostSemanticContextOfSubprogram;
56
+ containingTypeMember(node: tree.TypeMemberDeclaration): TypeOrExtensionMembersSemanticContext;
57
+ containingPackageMember(node: tree.PackageMemberDeclaration): SourceFileSemanticContext;
58
+ private containingInternal;
59
+ private ofChildOfFunctionDeclaration;
60
+ private ofChildOfVariableAccessorDeclaration;
61
+ private ofChildOfTypeWithMembersOrExtensionDeclaration;
62
+ private ofChildOfLocalFunctionTypeDeclaration;
63
+ private ofChildOfFunctionLiteral;
64
+ private ofIndexedElementAccessorDeclarationChild;
65
+ private isOffsetInsideNode;
66
+ private isOffsetBetweenNodes;
67
+ private isOffsetInsideStatementBlock;
68
+ private isOffsetInsideFunctionBlock;
69
+ }
@@ -0,0 +1,51 @@
1
+ import { Name } from '../../../common/index.js';
2
+ import { DiagnosticAcceptor } from '../../../diagnostic/Diagnostic.js';
3
+ import { LocalStructuredTypeEntity, LocalVariableEntity, NestedFunctionEntity, ParameterEntity, TypeParameterEntity } from '../../../entities/index.js';
4
+ import * as tree from '../../../tree/m/index.js';
5
+ import { Analyzer } from '../Analyzer.js';
6
+ import { NamedDeclaration, TagOrContainerWithTags, TypeOrContainerWithTypes } from './Declarations.js';
7
+ import { SemanticContext } from './SemanticContext.js';
8
+ import { NamedDeclarationLookupResult, SemanticContextLookupState } from './SemanticContextBase.js';
9
+ import { SemanticContextWithParent } from './SemanticContextWithParent.js';
10
+ export interface NameConflictsValidator {
11
+ validateNameConflicts(diagnostics: DiagnosticAcceptor): void;
12
+ }
13
+ export declare abstract class SemanticContextValidatingNameConflictsBase extends SemanticContextWithParent implements NameConflictsValidator {
14
+ abstract readonly outer: SemanticContext;
15
+ abstract readonly node: tree.Node;
16
+ protected readonly analyzer: Analyzer;
17
+ private memberEntities_;
18
+ private memberEntitiesByNameKey;
19
+ private namedDeclarations_;
20
+ private typesOrContainerWithTypes_;
21
+ private tagsOrContainerWithTags_;
22
+ private namedDeclarationsByName_;
23
+ private typesOrContainerWithTypesByName_;
24
+ private tagsOrContainerWithTagsByName_;
25
+ private get memberEntities();
26
+ private get namedDeclarations();
27
+ private get typesOrContainerWithTypes();
28
+ private get tagsOrContainerWithTags();
29
+ private get namedDeclarationsByName();
30
+ private get typesOrContainerWithTypesByName();
31
+ private get tagsOrContainerWithTagsByName();
32
+ constructor(analyzer: Analyzer);
33
+ protected abstract createMemberEntities(): readonly MemberOfSemanticContextValidatingNameConflicts[];
34
+ protected abstract createMemberEntitiesForTypeLookup(): readonly MemberOfSemanticContextValidatingNameConflictsForTypeLookup[];
35
+ protected abstract createMemberEntitiesForTagLookup(): readonly MemberOfSemanticContextValidatingNameConflictsForTagLookup[];
36
+ getOwnTypesOrContainersWithTypes(_initialContext: SemanticContext): readonly TypeOrContainerWithTypes[];
37
+ getOwnTypesOrContainersWithTypesByName(name: Name, _initialContext: SemanticContext): readonly TypeOrContainerWithTypes[];
38
+ getOwnTagsOrContainersWithTags(_initialContext: SemanticContext): readonly TagOrContainerWithTags[];
39
+ getOwnTagsOrContainersWithTagsByName(name: Name, _initialContext: SemanticContext): readonly TagOrContainerWithTags[];
40
+ getOwnNamedDeclarations(_initialContext: SemanticContext, _noInstanceMembers: boolean, _lookupState: SemanticContextLookupState): readonly NamedDeclaration[];
41
+ getOwnNamedDeclarationsByName(name: Name, _initialContext: SemanticContext, _noInstanceMembers: boolean, lookupResult: NamedDeclarationLookupResult): void;
42
+ validateNameConflicts(diagnostics: DiagnosticAcceptor): void;
43
+ private getMemberEntityDictionary;
44
+ private validateNestedFunctionsConflicts;
45
+ private createNamedDeclarations;
46
+ private createTypesOrContainerWithTypes;
47
+ private createTagsOrContainerWithTags;
48
+ }
49
+ export type MemberOfSemanticContextValidatingNameConflicts = LocalVariableEntity | ParameterEntity | NestedFunctionEntity | TypeParameterEntity | LocalStructuredTypeEntity;
50
+ export type MemberOfSemanticContextValidatingNameConflictsForTypeLookup = TypeParameterEntity | LocalStructuredTypeEntity;
51
+ export type MemberOfSemanticContextValidatingNameConflictsForTagLookup = NestedFunctionEntity | TypeParameterEntity | LocalStructuredTypeEntity;
@@ -0,0 +1,12 @@
1
+ import { TypeMemberLookupContext } from '../../TypeMemberLookup.js';
2
+ import { SemanticContext } from './SemanticContext.js';
3
+ import { ObjectVariableInfo, SemanticContextBase, SubprogramInfo, TryStatementContextKind, TypeOrTypeExtension } from './SemanticContextBase.js';
4
+ export declare abstract class SemanticContextWithParent extends SemanticContextBase {
5
+ abstract readonly outer: SemanticContext;
6
+ getContainingSubprogram(): SubprogramInfo | undefined;
7
+ getContainingTypeOrTypeExtension(): TypeOrTypeExtension | undefined;
8
+ getObjectVariableInfo(): ObjectVariableInfo | undefined;
9
+ getTryStatementContext(): TryStatementContextKind | undefined;
10
+ isStatic(): boolean;
11
+ getTypeMemberLookupContext(): TypeMemberLookupContext;
12
+ }
@@ -0,0 +1,63 @@
1
+ import { Name } from '../../../common/index.js';
2
+ import { DiagnosticAcceptor } from '../../../diagnostic/Diagnostic.js';
3
+ import { PackageEntity, TextTranslationEntity, TypeEntity, TypeExtensionEntity } from '../../../entities/index.js';
4
+ import { SourceFileM } from '../../../project/SourceFile.js';
5
+ import * as tree from '../../../tree/m/index.js';
6
+ import { DiagnosticArgumentFactory } from '../../DiagnosticArgumentFactory.js';
7
+ import { PackageMemberLookupContext } from '../../PackageMemberLookup.js';
8
+ import { TypeMemberLookupContext } from '../../TypeMemberLookup.js';
9
+ import { Analyzer } from '../Analyzer.js';
10
+ import { NamedDeclaration, TagOrContainerWithTags, TypeOrContainerWithTypes } from './Declarations.js';
11
+ import { SemanticContext } from './SemanticContext.js';
12
+ import { NamedDeclarationLookupResult, ObjectVariableInfo, SemanticContextBase, SemanticContextLookupState, SubprogramInfo, TryStatementContextKind, TypeOrTypeExtension } from './SemanticContextBase.js';
13
+ export declare class SourceFileSemanticContext extends SemanticContextBase {
14
+ readonly kind = "source-file";
15
+ readonly outer: SemanticContext | undefined;
16
+ protected asContext: SemanticContext;
17
+ private readonly analyzer;
18
+ private readonly sourceFile;
19
+ private readonly containingPackageMemberLookup;
20
+ private readonly importedPackageMemberLookups;
21
+ private readonly packageAliases;
22
+ private readonly packageAliasesByNameKey_;
23
+ private readonly packageNameSegments;
24
+ private readonly packageNameSegmentsByNameKey_;
25
+ private readonly diagnosticArgumentFactory;
26
+ private readonly primaryTextTranslationPackage_;
27
+ private readonly packageMemberLookupContext;
28
+ private readonly typeMemberLookupContext;
29
+ private readonly localTypes_;
30
+ private readonly localTypesByNameKey_;
31
+ private get packageAliasesByNameKey();
32
+ private get packageNameSegmentsByNameKey();
33
+ private get primaryTextTranslationPackage();
34
+ private get localTypes();
35
+ private get localTypesByNameKey();
36
+ constructor(analyzer: Analyzer, node: tree.SourceFile);
37
+ getContainingSubprogram(): SubprogramInfo | undefined;
38
+ getContainingTypeOrTypeExtension(): TypeOrTypeExtension | undefined;
39
+ getObjectVariableInfo(): ObjectVariableInfo | undefined;
40
+ getSourceFile(): SourceFileM;
41
+ getPackage(): PackageEntity;
42
+ getTryStatementContext(): TryStatementContextKind | undefined;
43
+ isStatic(): boolean;
44
+ getPackageMemberLookupContext(): PackageMemberLookupContext;
45
+ getTypeMemberLookupContext(): TypeMemberLookupContext;
46
+ getDiagnosticArgumentFactory(): DiagnosticArgumentFactory;
47
+ getOwnTypesOrContainersWithTypes(initialContext: SemanticContext): readonly TypeOrContainerWithTypes[];
48
+ getOwnTypesOrContainersWithTypesByName(name: Name, initialContext: SemanticContext): readonly TypeOrContainerWithTypes[];
49
+ getOwnTagsOrContainersWithTags(initialContext: SemanticContext): readonly TagOrContainerWithTags[];
50
+ getOwnTagsOrContainersWithTagsByName(name: Name, initialContext: SemanticContext): readonly TagOrContainerWithTags[];
51
+ getOwnNamedDeclarations(initialContext: SemanticContext, _noInstanceMembers: boolean, _lookupState: SemanticContextLookupState): NamedDeclaration[];
52
+ getOwnNamedDeclarationsByName(name: Name, initialContext: SemanticContext, _noInstanceMembers: boolean, lookupResult: NamedDeclarationLookupResult): void;
53
+ getOwnTypeExtensionsByType(type: TypeEntity, initialContext: SemanticContext): TypeExtensionEntity[];
54
+ getTextTranslationEntityByTextKey(key: string): readonly TextTranslationEntity[];
55
+ validateNameConflicts(diagnostics: DiagnosticAcceptor): void;
56
+ validateLocalTypes(diagnostics: DiagnosticAcceptor): void;
57
+ private convertEntityToNamedDeclaration;
58
+ private convertEntityToTypeOrContainerWithTypes;
59
+ private convertEntityToTagOrContainerWithTags;
60
+ private convertPackageAliasToTypeOrContainerWithTypes;
61
+ private convertPackageAliasToTagOrContainerWithTags;
62
+ private convertPackageAliasToNamedDeclaration;
63
+ }
@@ -0,0 +1,26 @@
1
+ import { Name } from '../../../common/Name.js';
2
+ import * as tree from '../../../tree/m/index.js';
3
+ import { TypeMemberLookupContext } from '../../TypeMemberLookup.js';
4
+ import { Analyzer } from '../Analyzer.js';
5
+ import { TypeOrContainerWithTypes, TagOrContainerWithTags, NamedDeclaration } from './Declarations.js';
6
+ import { SemanticContext } from './SemanticContext.js';
7
+ import { SemanticContextLookupState, NamedDeclarationLookupResult } from './SemanticContextBase.js';
8
+ import { SemanticContextWithParent } from './SemanticContextWithParent.js';
9
+ export declare class StaticDeclarationSemanticContext extends SemanticContextWithParent {
10
+ readonly kind = "static-declaration";
11
+ readonly outer: SemanticContext;
12
+ protected readonly asContext: SemanticContext;
13
+ protected readonly analyzer: Analyzer;
14
+ private readonly node;
15
+ private readonly typeMemberLookupContext;
16
+ constructor(analyzer: Analyzer, node: tree.StaticDeclaration, outer: SemanticContext);
17
+ getTypeMemberLookupContext(): TypeMemberLookupContext;
18
+ getOwnTypesOrContainersWithTypes(_initialContext: SemanticContext): readonly TypeOrContainerWithTypes[];
19
+ getOwnTypesOrContainersWithTypesByName(_name: Name, _initialContext: SemanticContext): readonly TypeOrContainerWithTypes[];
20
+ getOwnTagsOrContainersWithTags(_initialContext: SemanticContext): readonly TagOrContainerWithTags[];
21
+ getOwnTagsOrContainersWithTagsByName(_name: Name, _initialContext: SemanticContext): readonly TagOrContainerWithTags[];
22
+ getOwnNamedDeclarations(_initialContext: SemanticContext, _noInstanceMembers: boolean, _lookupState: SemanticContextLookupState): readonly NamedDeclaration[];
23
+ getOwnNamedDeclarationsByName(_name: Name, _initialContext: SemanticContext, _noInstanceMembers: boolean, _lookupResult: NamedDeclarationLookupResult): void;
24
+ isStatic(): boolean;
25
+ private getContainingTypeOrExtension;
26
+ }
@@ -0,0 +1,108 @@
1
+ import { DiagnosticAcceptor } from '../../../diagnostic/Diagnostic.js';
2
+ import { LocalVariableEntity, ParameterEntity, TypeParameterEntity } from '../../../entities/index.js';
3
+ import * as tree from '../../../tree/m/index.js';
4
+ import { Analyzer } from '../Analyzer.js';
5
+ import { ReservedNameKind } from '../ReservedNameDictionary.js';
6
+ import { SemanticContext } from './SemanticContext.js';
7
+ import { TryStatementContextKind } from './SemanticContextBase.js';
8
+ import { MemberOfSemanticContextValidatingNameConflicts, MemberOfSemanticContextValidatingNameConflictsForTagLookup, MemberOfSemanticContextValidatingNameConflictsForTypeLookup, SemanticContextValidatingNameConflictsBase } from './SemanticContextValidatingNameConflicts.js';
9
+ import { SourceFileSemanticContext } from './SourceFileSemanticContext.js';
10
+ import { OutermostSemanticContextOfSubprogram } from './SubprogramSemanticContext.js';
11
+ export type SubprogramTypeParameterSemanticContextParent = OutermostSemanticContextOfSubprogram;
12
+ export declare class SubprogramTypeParameterSemanticContext extends SemanticContextValidatingNameConflictsBase {
13
+ readonly kind = "subprogram-type-parameter";
14
+ readonly outer: SubprogramTypeParameterSemanticContextParent;
15
+ readonly node: tree.TypeParameterClause;
16
+ protected readonly asContext: SemanticContext;
17
+ private readonly localTypes_;
18
+ private get localTypes();
19
+ constructor(analyzer: Analyzer, node: tree.TypeParameterClause, outer: SubprogramTypeParameterSemanticContextParent);
20
+ protected getTypeParameterEntities(): readonly TypeParameterEntity[];
21
+ validateNameConflicts(diagnostics: DiagnosticAcceptor): void;
22
+ protected createMemberEntities(): readonly MemberOfSemanticContextValidatingNameConflicts[];
23
+ protected createMemberEntitiesForTypeLookup(): readonly MemberOfSemanticContextValidatingNameConflictsForTypeLookup[];
24
+ protected createMemberEntitiesForTagLookup(): readonly MemberOfSemanticContextValidatingNameConflictsForTagLookup[];
25
+ }
26
+ export type SubprogramParameterListSemanticContextParent = SubprogramTypeParameterSemanticContext | OutermostSemanticContextOfSubprogram | SourceFileSemanticContext;
27
+ export declare abstract class SubprogramParameterListSemanticContext extends SemanticContextValidatingNameConflictsBase {
28
+ readonly kind = "subprogram-parameter-list";
29
+ readonly outer: SubprogramParameterListSemanticContextParent;
30
+ constructor(analyzer: Analyzer, outer: SubprogramParameterListSemanticContextParent);
31
+ protected abstract getParameterEntities(): readonly ParameterEntity[];
32
+ protected abstract getSpecialVariableKinds(): readonly ReservedNameKind[];
33
+ validateNameConflicts(diagnostics: DiagnosticAcceptor): void;
34
+ }
35
+ export declare class ExplicitSubprogramParameterListSemanticContext extends SubprogramParameterListSemanticContext {
36
+ readonly node: tree.ParameterList;
37
+ protected readonly asContext: SemanticContext;
38
+ private readonly localTypes_;
39
+ private get localTypes();
40
+ constructor(analyzer: Analyzer, node: tree.ParameterList, outer: SubprogramParameterListSemanticContextParent);
41
+ protected getParameterEntities(): readonly ParameterEntity[];
42
+ protected getSpecialVariableKinds(): readonly ReservedNameKind[];
43
+ protected createMemberEntities(): readonly MemberOfSemanticContextValidatingNameConflicts[];
44
+ protected createMemberEntitiesForTypeLookup(): readonly MemberOfSemanticContextValidatingNameConflictsForTypeLookup[];
45
+ protected createMemberEntitiesForTagLookup(): readonly MemberOfSemanticContextValidatingNameConflictsForTagLookup[];
46
+ }
47
+ export declare class FunctionBlockLiteralParameterListSemanticContext extends SubprogramParameterListSemanticContext {
48
+ readonly node: tree.FunctionBlockLiteral;
49
+ protected readonly asContext: SemanticContext;
50
+ private readonly localTypes_;
51
+ private get localTypes();
52
+ constructor(analyzer: Analyzer, node: tree.FunctionBlockLiteral, outer: SubprogramParameterListSemanticContextParent);
53
+ protected getParameterEntities(): readonly ParameterEntity[];
54
+ protected getSpecialVariableKinds(): readonly ReservedNameKind[];
55
+ protected createMemberEntities(): readonly MemberOfSemanticContextValidatingNameConflicts[];
56
+ protected createMemberEntitiesForTypeLookup(): readonly MemberOfSemanticContextValidatingNameConflictsForTypeLookup[];
57
+ protected createMemberEntitiesForTagLookup(): readonly MemberOfSemanticContextValidatingNameConflictsForTagLookup[];
58
+ }
59
+ export declare class TranslationTextTemplateParameterListSemanticContext extends SubprogramParameterListSemanticContext {
60
+ readonly node: tree.TranslationTextTemplate;
61
+ protected readonly asContext: SemanticContext;
62
+ constructor(analyzer: Analyzer, node: tree.TranslationTextTemplate, outer: SubprogramParameterListSemanticContextParent);
63
+ protected getParameterEntities(): readonly ParameterEntity[];
64
+ protected getSpecialVariableKinds(): readonly ReservedNameKind[];
65
+ protected createMemberEntities(): readonly MemberOfSemanticContextValidatingNameConflicts[];
66
+ protected createMemberEntitiesForTypeLookup(): readonly MemberOfSemanticContextValidatingNameConflictsForTypeLookup[];
67
+ protected createMemberEntitiesForTagLookup(): readonly MemberOfSemanticContextValidatingNameConflictsForTagLookup[];
68
+ }
69
+ export type StatementBlockSemanticContextParent = ForStatementSemanticContext | CatchClauseSemanticContext | SubprogramParameterListSemanticContext | OutermostSemanticContextOfSubprogram | StatementSemanticContextParent;
70
+ export declare class StatementBlockSemanticContext extends SemanticContextValidatingNameConflictsBase {
71
+ readonly kind = "statement-block";
72
+ readonly outer: StatementBlockSemanticContextParent;
73
+ readonly node: tree.StatementBlock | tree.FunctionBlock;
74
+ protected readonly asContext: SemanticContext;
75
+ private readonly localTypes_;
76
+ private get localTypes();
77
+ constructor(analyzer: Analyzer, node: tree.StatementBlock | tree.FunctionBlock, outer: StatementBlockSemanticContextParent);
78
+ getTryStatementContext(): TryStatementContextKind | undefined;
79
+ protected createMemberEntities(): readonly MemberOfSemanticContextValidatingNameConflicts[];
80
+ protected createMemberEntitiesForTypeLookup(): readonly MemberOfSemanticContextValidatingNameConflictsForTypeLookup[];
81
+ protected createMemberEntitiesForTagLookup(): readonly MemberOfSemanticContextValidatingNameConflictsForTagLookup[];
82
+ }
83
+ export type StatementSemanticContextParent = StatementBlockSemanticContext | SourceFileSemanticContext;
84
+ export declare class ForStatementSemanticContext extends SemanticContextValidatingNameConflictsBase {
85
+ readonly kind = "for-statement";
86
+ readonly outer: StatementSemanticContextParent;
87
+ readonly node: tree.ForStatement;
88
+ protected readonly asContext: SemanticContext;
89
+ private readonly localTypes_;
90
+ private get localTypes();
91
+ constructor(analyzer: Analyzer, node: tree.ForStatement, outer: StatementSemanticContextParent);
92
+ protected createMemberEntities(): readonly MemberOfSemanticContextValidatingNameConflicts[];
93
+ protected createMemberEntitiesForTypeLookup(): readonly MemberOfSemanticContextValidatingNameConflictsForTypeLookup[];
94
+ protected createMemberEntitiesForTagLookup(): readonly MemberOfSemanticContextValidatingNameConflictsForTagLookup[];
95
+ }
96
+ export declare class CatchClauseSemanticContext extends SemanticContextValidatingNameConflictsBase {
97
+ readonly kind = "catch-clause";
98
+ readonly outer: StatementSemanticContextParent;
99
+ readonly node: tree.CatchClause;
100
+ protected readonly asContext: SemanticContext;
101
+ private readonly localTypes_;
102
+ private get localTypes();
103
+ constructor(analyzer: Analyzer, node: tree.CatchClause, outer: StatementSemanticContextParent);
104
+ protected getErrorVariableEntities(): readonly LocalVariableEntity[];
105
+ protected createMemberEntities(): readonly MemberOfSemanticContextValidatingNameConflicts[];
106
+ protected createMemberEntitiesForTypeLookup(): readonly MemberOfSemanticContextValidatingNameConflictsForTypeLookup[];
107
+ protected createMemberEntitiesForTagLookup(): readonly MemberOfSemanticContextValidatingNameConflictsForTagLookup[];
108
+ }
@@ -0,0 +1,92 @@
1
+ import { Name } from '../../../common/index.js';
2
+ import { ParameterEntity } from '../../../entities/index.js';
3
+ import * as tree from '../../../tree/m/index.js';
4
+ import { Analyzer } from '../Analyzer.js';
5
+ import { NamedDeclaration, TagOrContainerWithTags, TypeOrContainerWithTypes } from './Declarations.js';
6
+ import { SemanticContext } from './SemanticContext.js';
7
+ import { NamedDeclarationLookupResult, ObjectVariableInfo, SemanticContextLookupState, SubprogramInfo, TryStatementContextKind } from './SemanticContextBase.js';
8
+ import { SemanticContextWithParent } from './SemanticContextWithParent.js';
9
+ import { SourceFileSemanticContext } from './SourceFileSemanticContext.js';
10
+ import { StaticDeclarationSemanticContext } from './StaticDeclarationSemanticContext.js';
11
+ import { TypeOrExtensionMembersSemanticContext } from './TypeSemanticContext.js';
12
+ export type LastSemanticContextOfSubprogramParent = SemanticContext;
13
+ /**
14
+ * Завершающий семантический контекст подпрограммы.
15
+ * Данный контекст располагается после контекста с параметрами (или параметрами типа) и переопределяет метод
16
+ * {@link SemanticContext.getContainingSubprogram}.
17
+ */
18
+ export declare abstract class OutermostSemanticContextOfSubprogram extends SemanticContextWithParent {
19
+ readonly kind = "outermost-of-subprogram";
20
+ protected abstract readonly analyzer: Analyzer;
21
+ private readonly objectVariableInfo;
22
+ private readonly objectParameter_;
23
+ private readonly objectParameterMemberLookup_;
24
+ private get objectParameter();
25
+ private get objectParameterMemberLookup();
26
+ abstract getContainingSubprogram(): SubprogramInfo;
27
+ protected abstract findObjectParameter(): ParameterEntity | undefined;
28
+ getObjectVariableInfo(): ObjectVariableInfo | undefined;
29
+ getTryStatementContext(): TryStatementContextKind | undefined;
30
+ getOwnTypesOrContainersWithTypes(_initialContext: SemanticContext): readonly TypeOrContainerWithTypes[];
31
+ getOwnTypesOrContainersWithTypesByName(_name: Name, _initialContext: SemanticContext): readonly TypeOrContainerWithTypes[];
32
+ getOwnTagsOrContainersWithTags(_initialContext: SemanticContext): readonly TagOrContainerWithTags[];
33
+ getOwnTagsOrContainersWithTagsByName(_name: Name, _initialContext: SemanticContext): readonly TagOrContainerWithTags[];
34
+ getOwnNamedDeclarations(initialContext: SemanticContext, noInstanceMembers: boolean, lookupState: SemanticContextLookupState): readonly NamedDeclaration[];
35
+ getOwnNamedDeclarationsByName(name: Name, initialContext: SemanticContext, noInstanceMembers: boolean, lookupResult: NamedDeclarationLookupResult): void;
36
+ private convertNamedMember;
37
+ }
38
+ export declare class FunctionSemanticContext extends OutermostSemanticContextOfSubprogram {
39
+ readonly outer: SemanticContext;
40
+ protected readonly asContext: SemanticContext;
41
+ protected readonly analyzer: Analyzer;
42
+ private readonly node;
43
+ private readonly subprogramInfo;
44
+ constructor(analyzer: Analyzer, node: tree.FunctionDeclaration, outer: SemanticContext);
45
+ getContainingSubprogram(): SubprogramInfo;
46
+ isStatic(): boolean;
47
+ protected findObjectParameter(): ParameterEntity | undefined;
48
+ }
49
+ export type VariableAccessorSemanticContextParent = TypeOrExtensionMembersSemanticContext | SourceFileSemanticContext | StaticDeclarationSemanticContext;
50
+ export declare class VariableAccessorSemanticContext extends OutermostSemanticContextOfSubprogram {
51
+ readonly outer: VariableAccessorSemanticContextParent;
52
+ protected readonly asContext: SemanticContext;
53
+ protected readonly analyzer: Analyzer;
54
+ private readonly node;
55
+ private readonly subprogramInfo;
56
+ constructor(analyzer: Analyzer, node: tree.VariableAccessorDeclaration, outer: VariableAccessorSemanticContextParent);
57
+ getContainingSubprogram(): SubprogramInfo;
58
+ isStatic(): boolean;
59
+ protected findObjectParameter(): ParameterEntity | undefined;
60
+ }
61
+ export type IndexedElementAccessorSemanticContextParent = TypeOrExtensionMembersSemanticContext | SourceFileSemanticContext;
62
+ export declare class IndexedElementAccessorSemanticContext extends OutermostSemanticContextOfSubprogram {
63
+ readonly outer: IndexedElementAccessorSemanticContextParent;
64
+ protected readonly asContext: SemanticContext;
65
+ protected readonly analyzer: Analyzer;
66
+ private readonly node;
67
+ private readonly subprogramInfo;
68
+ constructor(analyzer: Analyzer, node: tree.IndexedElementAccessorDeclaration, outer: IndexedElementAccessorSemanticContextParent);
69
+ getContainingSubprogram(): SubprogramInfo;
70
+ isStatic(): boolean;
71
+ protected findObjectParameter(): ParameterEntity | undefined;
72
+ }
73
+ export declare class FunctionLiteralSemanticContext extends OutermostSemanticContextOfSubprogram {
74
+ readonly outer: SemanticContext;
75
+ protected readonly asContext: SemanticContext;
76
+ protected readonly analyzer: Analyzer;
77
+ private readonly node;
78
+ private readonly subprogramInfo;
79
+ constructor(analyzer: Analyzer, node: tree.RegularOrBlockFunctionLiteral, outer: SemanticContext);
80
+ getContainingSubprogram(): SubprogramInfo;
81
+ protected findObjectParameter(): ParameterEntity | undefined;
82
+ }
83
+ export declare class TextTranslationFunctionDeclarationSemanticContext extends OutermostSemanticContextOfSubprogram {
84
+ readonly outer: SemanticContext;
85
+ protected readonly asContext: SemanticContext;
86
+ protected readonly analyzer: Analyzer;
87
+ private readonly node;
88
+ private readonly subprogramInfo;
89
+ constructor(analyzer: Analyzer, node: tree.TextTranslationFunctionDeclaration, outer: SemanticContext);
90
+ getContainingSubprogram(): SubprogramInfo;
91
+ protected findObjectParameter(): ParameterEntity | undefined;
92
+ }