@artel/artc 0.6.26039 → 0.9.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 (213) 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-FLMCFMMG.js} +87218 -50777
  6. package/build/{chunk-AEW4TILW.js → chunk-V2TFXOVJ.js} +1 -1
  7. package/build/{chunk-5VVFNKOH.js → chunk-XMOVE7NP.js} +2 -2
  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 +10 -10
  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/EmitterContext.d.ts +4 -4
  99. package/build/types/emitter/Entities.d.ts +4 -2
  100. package/build/types/emitter/IrBuilderM.d.ts +124 -0
  101. package/build/types/emitter/IrFactory.d.ts +2 -2
  102. package/build/types/entities/Entity.d.ts +8 -5
  103. package/build/types/entities/EntityLocalizationContext.d.ts +3 -2
  104. package/build/types/entities/OperatorKind.d.ts +13 -18
  105. package/build/types/entities/Translation.d.ts +4 -3
  106. package/build/types/entities/interfaces/AliasTypeEntity.d.ts +4 -1
  107. package/build/types/entities/interfaces/DereferenceOperatorEntity.d.ts +3 -1
  108. package/build/types/entities/interfaces/FunctionEntity.d.ts +3 -1
  109. package/build/types/entities/interfaces/FunctionTypeEntity.d.ts +3 -1
  110. package/build/types/entities/interfaces/IndexerEntity.d.ts +4 -1
  111. package/build/types/entities/interfaces/PackageAliasEntity.d.ts +4 -1
  112. package/build/types/entities/interfaces/PackageEntity.d.ts +2 -1
  113. package/build/types/entities/interfaces/ReducedTypeEntity.d.ts +3 -1
  114. package/build/types/entities/interfaces/StructuredTypeEntity.d.ts +9 -2
  115. package/build/types/entities/interfaces/TextTranslationEntity.d.ts +4 -1
  116. package/build/types/entities/interfaces/TypeExtensionEntity.d.ts +4 -1
  117. package/build/types/entities/interfaces/TypeParameterEntity.d.ts +7 -3
  118. package/build/types/entities/interfaces/VariableEntity.d.ts +3 -2
  119. package/build/types/entities/interfaces/VariantTypeEntity.d.ts +3 -1
  120. package/build/types/entities/interfaces/m/ConstructorEntityM.d.ts +10 -0
  121. package/build/types/entities/interfaces/m/DestructorEntityM.d.ts +8 -0
  122. package/build/types/entities/interfaces/m/index.d.ts +2 -0
  123. package/build/types/entities/source/a/SourceFunctionEntity.d.ts +1 -1
  124. package/build/types/entities/source/a/SourcePackageEntity.d.ts +2 -1
  125. package/build/types/entities/source/a/SourceStructuredTypeEntity.d.ts +3 -5
  126. package/build/types/entities/source/m/SourceAliasTypeEntity.d.ts +32 -0
  127. package/build/types/entities/source/m/SourceConstructorEntity.d.ts +40 -0
  128. package/build/types/entities/source/m/SourceDestructorEntity.d.ts +38 -0
  129. package/build/types/entities/source/m/SourceFunctionEntity.d.ts +252 -0
  130. package/build/types/entities/source/m/SourceFunctionTypeEntity.d.ts +35 -0
  131. package/build/types/entities/source/m/SourceGetterEntity.d.ts +122 -0
  132. package/build/types/entities/source/m/SourceIndexerEntity.d.ts +36 -0
  133. package/build/types/entities/source/m/SourcePackageAliasEntity.d.ts +22 -0
  134. package/build/types/entities/source/m/SourcePackageEntity.d.ts +68 -0
  135. package/build/types/entities/source/m/SourceSetterEntity.d.ts +122 -0
  136. package/build/types/entities/source/m/SourceStructuredTypeEntity.d.ts +111 -0
  137. package/build/types/entities/source/m/SourceTextTranslationEntity.d.ts +29 -0
  138. package/build/types/entities/source/m/SourceTypeParameterEntity.d.ts +30 -0
  139. package/build/types/entities/source/m/SourceVariableEntity.d.ts +447 -0
  140. package/build/types/entities/source/m/SourceVariantTypeEntity.d.ts +38 -0
  141. package/build/types/entities/source/m/index.d.ts +15 -0
  142. package/build/types/entities/translated/TranslatedPackageEntity.d.ts +2 -1
  143. package/build/types/entities/translated/TranslatedStructuredTypeEntity.d.ts +33 -1
  144. package/build/types/entities/translated/source/a/SourceTranslatedPackageStructuredTypeEntity.d.ts +8 -2
  145. package/build/types/entities/translated/source/m/SourceTranslatedAliasTypeEntity.d.ts +14 -0
  146. package/build/types/entities/translated/source/m/SourceTranslatedDestructorEntity.d.ts +12 -0
  147. package/build/types/entities/translated/source/m/SourceTranslatedFunctionEntity.d.ts +24 -0
  148. package/build/types/entities/translated/source/m/SourceTranslatedFunctionTypeEntity.d.ts +13 -0
  149. package/build/types/entities/translated/source/m/SourceTranslatedIndexerEntity.d.ts +12 -0
  150. package/build/types/entities/translated/source/m/SourceTranslatedPackageEntity.d.ts +19 -0
  151. package/build/types/entities/translated/source/m/SourceTranslatedPackageStructuredTypeEntity.d.ts +26 -0
  152. package/build/types/entities/translated/source/m/SourceTranslatedPackageVariantTypeEntity.d.ts +14 -0
  153. package/build/types/entities/translated/source/m/SourceTranslatedReducedTypeEntity.d.ts +14 -0
  154. package/build/types/entities/translated/source/m/index.d.ts +9 -0
  155. package/build/types/parser/a/KeywordDictionary.d.ts +2 -3
  156. package/build/types/parser/a/Parser.d.ts +2 -2
  157. package/build/types/parser/m/ConvertTokenKind.d.ts +3 -0
  158. package/build/types/parser/m/KeywordDictionary.d.ts +33 -0
  159. package/build/types/parser/m/Parser.d.ts +7 -0
  160. package/build/types/parser/m/Scanner.d.ts +56 -0
  161. package/build/types/parser/m/TokenKind.d.ts +81 -0
  162. package/build/types/parser/m/TriviaInterner.d.ts +8 -0
  163. package/build/types/project/SourceFile.d.ts +5 -6
  164. package/build/types/services/LanguageServer.d.ts +23 -12
  165. package/build/types/services/a/NodeSemanticInfo.d.ts +2 -2
  166. package/build/types/services/common/WorkspaceItemsService.d.ts +1 -0
  167. package/build/types/services/common/completion/Types.d.ts +8 -2
  168. package/build/types/services/common/display/DisplayService.d.ts +3 -0
  169. package/build/types/services/common/display/Types.d.ts +2 -2
  170. package/build/types/services/m/CodeActionsService.d.ts +10 -0
  171. package/build/types/services/m/CompletionService.d.ts +60 -0
  172. package/build/types/services/m/DefinitionService.d.ts +11 -0
  173. package/build/types/services/m/DisplayService.d.ts +52 -0
  174. package/build/types/services/m/EvaluatableExpressionService.d.ts +10 -0
  175. package/build/types/services/m/HoverService.d.ts +11 -0
  176. package/build/types/services/m/NodeSemanticInfo.d.ts +46 -0
  177. package/build/types/services/m/RenameService.d.ts +11 -0
  178. package/build/types/services/m/SelectionRangeService.d.ts +7 -0
  179. package/build/types/services/m/SemanticTokensService.d.ts +11 -0
  180. package/build/types/services/m/SourceFileItemsService.d.ts +10 -0
  181. package/build/types/services/m/TranslationService.d.ts +23 -0
  182. package/build/types/services/m/TranslationsGenerationService.d.ts +7 -0
  183. package/build/types/services/m/TreeUtils.d.ts +58 -0
  184. package/build/types/services/m/references/DefinitionInfoFinder.d.ts +6 -0
  185. package/build/types/services/m/references/ReferencesFinder.d.ts +7 -0
  186. package/build/types/services/m/signature-help/ParametersSignatureHelpProvider.d.ts +15 -0
  187. package/build/types/services/m/signature-help/SignatureHelpService.d.ts +6 -0
  188. package/build/types/services/m/signature-help/SignatureWithParameters.d.ts +94 -0
  189. package/build/types/services/m/signature-help/TypeParameterSignatureHelpProvider.d.ts +21 -0
  190. package/build/types/services/m/signature-help/utils.d.ts +9 -0
  191. package/build/types/tree/a/KeywordKind.d.ts +1 -3
  192. package/build/types/tree/a/NodeKind.d.ts +113 -114
  193. package/build/types/tree/a/Nodes.d.ts +6 -5
  194. package/build/types/tree/a/OperatorKind.d.ts +5 -0
  195. package/build/types/tree/a/Types.d.ts +9 -4
  196. package/build/types/tree/m/BaseNode.d.ts +8 -40
  197. package/build/types/tree/m/KeywordFlags.d.ts +4 -0
  198. package/build/types/tree/m/KeywordKind.d.ts +40 -0
  199. package/build/types/tree/m/NodeKind.d.ts +147 -2
  200. package/build/types/tree/m/Nodes.d.ts +2064 -9
  201. package/build/types/tree/m/NodesDebug.d.ts +9 -0
  202. package/build/types/tree/m/OperatorKind.d.ts +39 -0
  203. package/build/types/tree/m/SyntaxToCode.d.ts +107 -0
  204. package/build/types/tree/m/Token.d.ts +46 -0
  205. package/build/types/tree/m/TokenFlags.d.ts +12 -0
  206. package/build/types/tree/m/TokenKind.d.ts +61 -60
  207. package/build/types/tree/m/TreeTraversal.d.ts +18 -0
  208. package/build/types/tree/m/Types.d.ts +46 -0
  209. package/build/types/tree/m/Utils.d.ts +7 -0
  210. package/build/types/tree/m/index.d.ts +9 -0
  211. package/build/types/types/StandardTypes.d.ts +2 -0
  212. package/package.json +2 -2
  213. /package/build/types/diagnostic/{TokenDiagnostic.d.ts → TokenDiagnosticA.d.ts} +0 -0
@@ -0,0 +1,52 @@
1
+ import { TypeParameterEntity } from '../../entities/index.js';
2
+ import * as tree from '../../tree/m/index.js';
3
+ import * as types from '../../types/index.js';
4
+ import { Analyzer } from './Analyzer.js';
5
+ import { ExpressionAnalysisOptions } from './ExpressionAnalysisOptions.js';
6
+ export type Argument = SourceArgument | IntrinsicArgument;
7
+ export interface SourceArgument {
8
+ readonly kind: 'source';
9
+ readonly expression: tree.Expression;
10
+ }
11
+ export interface IntrinsicArgument {
12
+ readonly kind: 'intrinsic';
13
+ readonly type: types.Type;
14
+ }
15
+ export declare class ArgumentWithTargetParameterInfo {
16
+ readonly value: Argument;
17
+ readonly parameterType: types.Type;
18
+ constructor(value: Argument, parameterType: types.Type);
19
+ }
20
+ export declare class TypeArgumentInferrer {
21
+ private readonly analyzer;
22
+ private readonly typeParameters;
23
+ private readonly arguments;
24
+ private readonly analysisOptions;
25
+ private readonly returnType;
26
+ private readonly outerSubstitutions;
27
+ private readonly inferenceStates;
28
+ /**
29
+ * Специальный экземпляр типа, который используется как признак того, что вывод аргументов типа не удался.
30
+ */
31
+ private readonly unresolvedType;
32
+ private inferenceHasFailed;
33
+ constructor(analyzer: Analyzer, typeParameters: readonly TypeParameterEntity[], args: readonly ArgumentWithTargetParameterInfo[], analysisOptions: ExpressionAnalysisOptions, returnType: types.Type | undefined, outerTypeSubstitutions: types.Substitutions | undefined);
34
+ infer(): readonly types.Type[] | undefined;
35
+ private inferFirstStage;
36
+ private inferSecondStage;
37
+ private inferFromTypes;
38
+ private inferToParameterType;
39
+ private inferToStructuredType;
40
+ private inferToReducedType;
41
+ private inferFromSubstitutions;
42
+ private inferToUnionType;
43
+ private inferFromFunctionTypes;
44
+ private inferFromUnionType;
45
+ private createSubstitutions;
46
+ private inferFromTargetTypeDependentExpression;
47
+ private tryGetInferredType;
48
+ private tryFixTypeParametersContainedByTypesOfFunctionParameters;
49
+ private typeContainsTypeParameter;
50
+ private substitutionsContainTypeParameter;
51
+ private isDefinitelyTargetTypeDependentExpression;
52
+ }
@@ -0,0 +1,11 @@
1
+ import * as types from '../../types/index.js';
2
+ import { Analyzer } from './Analyzer.js';
3
+ export declare class TypeInferrer {
4
+ private readonly analyzer;
5
+ private getType;
6
+ private typeInferringState;
7
+ private hasDetectedInferenceCycle_;
8
+ get hasDetectedInferenceCycle(): boolean;
9
+ constructor(analyzer: Analyzer, getType: () => types.Type);
10
+ inferType(): types.Type;
11
+ }
@@ -1,5 +1,5 @@
1
1
  import { Name } from '../../common/index.js';
2
- import { NamedTypeMemberEntity, TypeEntity, TypeExtensionEntity } from '../../entities/index.js';
2
+ import { NamedTypeMemberEntity, TypeEntity, TypeExtensionEntity, TypeWithMembersOrExtensionEntity, OperatorKind } from '../../entities/index.js';
3
3
  import * as types from '../../types/index.js';
4
4
  import { Analyzer } from '../Analyzer.js';
5
5
  import { DialectSpecificBoundTypeMemberLookup } from '../DialectSpecificBoundTypeMemberLookup.js';
@@ -10,11 +10,14 @@ export declare class TypeMemberLookupM {
10
10
  static ofType(analyzer: Analyzer, type: types.Type): TypeMemberLookupM;
11
11
  static ofTypeEntity(analyzer: Analyzer, entity: TypeEntity): TypeMemberLookupM;
12
12
  static ofTypeExtension(analyzer: Analyzer, typeExtension: TypeExtensionEntity): TypeMemberLookupM;
13
+ static ofTypeOrExtensionEntity(analyzer: Analyzer, typeEntity: TypeWithMembersOrExtensionEntity): TypeMemberLookupM;
13
14
  getNamedMembers(context: TypeMemberLookupContext | undefined, options?: TypeMemberLookupOptions): readonly types.NamedTypeMember[];
14
15
  getNamedMembersByName(name: Name, context: TypeMemberLookupContext | undefined, options?: TypeMemberLookupOptions): readonly types.NamedTypeMember[];
15
16
  getMatchingNamedMembersByName(name: Name, memberToMatch: NamedTypeMemberEntity, context: TypeMemberLookupContext | undefined, options?: TypeMemberLookupOptions): readonly types.NamedTypeMember[];
16
17
  getConstructors(context: TypeMemberLookupContext | undefined, options?: TypeMemberLookupOptions): readonly types.Method[];
17
18
  getDestructors(context: TypeMemberLookupContext | undefined, options?: TypeMemberLookupOptions): readonly types.Method[];
19
+ getOperators(context: TypeMemberLookupContext | undefined, options?: TypeMemberLookupOptions): readonly types.Method[];
20
+ getOperatorsByKind(kind: OperatorKind, context: TypeMemberLookupContext | undefined, options?: TypeMemberLookupOptions): readonly types.Method[];
18
21
  getIndexers(context: TypeMemberLookupContext | undefined, options?: TypeMemberLookupOptions): readonly types.Indexer[];
19
22
  getDereferenceOperators(context: TypeMemberLookupContext | undefined, options?: TypeMemberLookupOptions): readonly types.DereferenceOperator[];
20
23
  }
@@ -0,0 +1,31 @@
1
+ import { PackageLocale } from '../../common/index.js';
2
+ import * as types from '../../types/index.js';
3
+ import { Analyzer } from './Analyzer.js';
4
+ import * as controlFlow from './control-flow/index.js';
5
+ import { NarrowableReference } from './control-flow/index.js';
6
+ export declare class TypeNarrower {
7
+ private readonly analyzer;
8
+ private readonly reference;
9
+ private readonly initialType;
10
+ private readonly locale;
11
+ private readonly controlFlowNode;
12
+ private readonly typeByNode;
13
+ private readonly isVariableAssignedInLoopCheckResults;
14
+ constructor(analyzer: Analyzer, reference: NarrowableReference, locale: PackageLocale, initialType: types.Type, controlFlowNode: controlFlow.Node);
15
+ static getTypeOfExpression(analyzer: Analyzer, referenceExpression: controlFlow.NarrowableReferenceExpression, initialType: types.Type, controlFlowNode: controlFlow.Node): types.Type;
16
+ getType(): types.Type;
17
+ private getTypeAtControlFlowNode;
18
+ private getTypeAtCondition;
19
+ private getTypeAtAssignment;
20
+ private getTypeAtLocalOrPackageVariableDeclaration;
21
+ private getTypeAtSplit;
22
+ private getTypeAtLoop;
23
+ private getTypeAtAssignmentWithImplicitConversionOrToReducedType;
24
+ private getTypeAtIsFunctionCallExpression;
25
+ private getTypeAtComparisonWithNull;
26
+ private getTypeAtAssignmentOrDeclaration;
27
+ private addTypeIfUnique;
28
+ private checkIfVariableIsAssignedInLoop;
29
+ private checkIfVariableIsAssignedAtNode;
30
+ private isSameReferenceAsNarrowedExpression;
31
+ }
@@ -0,0 +1,9 @@
1
+ import { NamedTypeEntity } from '../../entities/index.js';
2
+ export declare class Resolver {
3
+ static resolve<TCandidate extends ICandidate>(candidates: readonly TCandidate[], argumentCount: number): readonly TCandidate[];
4
+ static resolveByNamedTypeEntities<T extends NamedTypeEntity>(candidates: readonly T[], argumentCount: number): readonly T[];
5
+ }
6
+ export interface ICandidate {
7
+ getParameterCount(): number;
8
+ getRequiredParameterCount(): number;
9
+ }
@@ -0,0 +1,34 @@
1
+ import { DiagnosticAcceptor } from '../../diagnostic/Diagnostic.js';
2
+ import { BinaryOperatorKind } from '../../entities/OperatorKind.js';
3
+ import * as tree from '../../tree/m/index.js';
4
+ import * as types from '../../types/index.js';
5
+ import { NodeOrDiagnosticLocation } from '../NodeOrDiagnosticLocation.js';
6
+ import { Analyzer } from './Analyzer.js';
7
+ /**
8
+ * Определяет подходящую двухместную операцию, определённую пользователем (+, *, == и др.).
9
+ *
10
+ * Алгоритм:
11
+ *
12
+ * 1. Определить тип левого выражение (targetType = undefined).
13
+ * 2. Найти в типе операторы необходимого вида.
14
+ * 3. Если операторы найдены:
15
+ * 1. Если найден один оператор - проверить, совместимы ли типы выражений с типами операндов.
16
+ * 2. Если найдено несколько операторов - решить перегрузку, представив двоичное выражение как операцию с
17
+ * двумя параметрами.
18
+ * 3. Если остался один подходящий оператор - алгоритм завершается. Если подошло несколько операторов -
19
+ * ошибка неоднозначного доступа. Если не подошёл ни один - алгоритм продолжается.
20
+ * 4. Определить тип правого выражения (targetType = undefined) и найти операторы в нём. Если операторы найдены -
21
+ * выполнить пункт 3.
22
+ * 5. Если ни один оператор не подошёл - алгоритм завершается с соответствующим сообщением об ошибке.
23
+ */
24
+ export declare class UserDefinableBinaryOperatorResolver {
25
+ private readonly analyzer;
26
+ private readonly left;
27
+ private readonly right;
28
+ private readonly operatorKind;
29
+ private readonly diagnosticLocation;
30
+ private readonly diagnostics;
31
+ constructor(analyzer: Analyzer, left: tree.Expression, right: tree.Expression, operatorKind: BinaryOperatorKind, diagnosticLocation: NodeOrDiagnosticLocation, diagnostics: DiagnosticAcceptor | undefined);
32
+ resolve(): types.Method | undefined;
33
+ private chooseSuitableOperators;
34
+ }
@@ -0,0 +1,23 @@
1
+ import { DiagnosticAcceptor } from '../../diagnostic/Diagnostic.js';
2
+ import * as tree from '../../tree/m/index.js';
3
+ import * as types from '../../types/index.js';
4
+ import { Analyzer } from './Analyzer.js';
5
+ /**
6
+ * Определяет подходящую одноместную операцию, определённую пользователем (+, -, не).
7
+ *
8
+ * Алгоритм:
9
+ *
10
+ * 1. Определить тип операнда.
11
+ * 2. Найти в типе операторы необходимого вида.
12
+ * 3. Если найден один оператор - проверить, совместим ли тип выражения с типом операнда.
13
+ * Если подошло несколько операторов - ошибка неоднозначного доступа.
14
+ * Если не подошёл ни один - алгоритм завершается с соответствующим сообщением об ошибке.
15
+ */
16
+ export declare class UserDefinableUnaryOperatorResolver {
17
+ private readonly analyzer;
18
+ private readonly node;
19
+ private readonly diagnostics;
20
+ constructor(analyzer: Analyzer, node: tree.PrefixUnaryExpression, diagnostics: DiagnosticAcceptor | undefined);
21
+ resolve(): types.Method | undefined;
22
+ private getOperatorKind;
23
+ }
@@ -0,0 +1,11 @@
1
+ import { Analyzer } from './Analyzer.js';
2
+ import * as controlFlow from './control-flow/index.js';
3
+ export declare class VariableIsAssignedChecker {
4
+ private readonly analyzer;
5
+ private readonly variableReference;
6
+ private readonly controlFlowNode;
7
+ private readonly checkResults;
8
+ constructor(analyzer: Analyzer, variableReference: controlFlow.NarrowableReference, controlFlowNode: controlFlow.Node);
9
+ checkVariableIsAssigned(): boolean;
10
+ private checkVariableIsAssignedAtNode;
11
+ }
@@ -0,0 +1,12 @@
1
+ import { Analyzer } from './Analyzer.js';
2
+ import * as controlFlow from './control-flow/index.js';
3
+ export declare class VariableIsNotAssignedChecker {
4
+ private readonly analyzer;
5
+ private readonly variableReference;
6
+ private readonly controlFlowNode;
7
+ private readonly checkResults;
8
+ private readonly loopNodesBeingChecked;
9
+ constructor(analyzer: Analyzer, variableReference: controlFlow.NarrowableReference, controlFlowNode: controlFlow.Node);
10
+ checkVariableIsNotAssigned(): boolean;
11
+ private checkVariableIsNotAssignedAtNode;
12
+ }
@@ -0,0 +1,52 @@
1
+ import { Diagnostic } from '../../../diagnostic/Diagnostic.js';
2
+ import { SourceFileM } from '../../../project/SourceFile.js';
3
+ import * as tree from '../../../tree/m/index.js';
4
+ import { NarrowableReferenceExpression } from './NarrowableExpression.js';
5
+ import { Node } from './Nodes.js';
6
+ export declare class GraphBuilder {
7
+ private readonly sourceFile;
8
+ private readonly controlFlowNodeByReference;
9
+ private readonly controlFlowNodesPrecedingErrorStatement;
10
+ private readonly controlFlowNodesEndingSubprogram;
11
+ private readonly controlFlowNodesEndingSourceFile;
12
+ private readonly unreachableCodeDiagnostics;
13
+ private isInRebuildingFinallyClauseGraphMode;
14
+ private currentPredecessor;
15
+ private currentContinueLoopTarget;
16
+ private currentBreakLoopTarget;
17
+ private currentErrorTarget;
18
+ private currentReturnTarget;
19
+ private currentRangeWithReportedUnreachableCodeDiagnostic;
20
+ constructor(sourceFile: SourceFileM);
21
+ build(): GraphBuildResult;
22
+ private visitNode;
23
+ private visitAssignmentStatement;
24
+ private visitIfStatement;
25
+ private visitWhileStatement;
26
+ private visitLoopStatement;
27
+ private visitForStatement;
28
+ private visitContinueLoopStatement;
29
+ private visitBreakLoopStatement;
30
+ private visitSwitchStatement;
31
+ private visitTryStatement;
32
+ private visitReturnStatement;
33
+ private visitErrorStatement;
34
+ private visitLocalVariableDeclaration;
35
+ private visitPackageVariableDeclaration;
36
+ private visitConditionalExpression;
37
+ private visitCondition;
38
+ private visitBinaryExpression;
39
+ private visitPrefixUnaryExpressionInCondition;
40
+ private visitCallExpressionInCondition;
41
+ private setAssignmentAsCurrentPredecessor;
42
+ private visitChildren;
43
+ private addUnreachableCodeDiagnostic;
44
+ }
45
+ export declare class GraphBuildResult {
46
+ readonly controlFlowNodeByReference: ReadonlyMap<NarrowableReferenceExpression, Node>;
47
+ readonly controlFlowNodesPrecedingErrorStatement: ReadonlyMap<tree.ErrorStatement, Node>;
48
+ readonly controlFlowNodesEndingSubprogram: ReadonlyMap<tree.SubprogramDeclarationOrLiteral, Node>;
49
+ readonly controlFlowNodesEndingSourceFile: ReadonlyMap<tree.SourceFile, Node>;
50
+ readonly unreachableCodeDiagnostics: readonly Diagnostic[];
51
+ constructor(controlFlowNodeByReference: ReadonlyMap<NarrowableReferenceExpression, Node>, controlFlowNodesPrecedingErrorStatement: ReadonlyMap<tree.ErrorStatement, Node>, controlFlowNodesEndingSubprogram: ReadonlyMap<tree.SubprogramDeclarationOrLiteral, Node>, controlFlowNodesEndingSourceFile: ReadonlyMap<tree.SourceFile, Node>, unreachableCodeDiagnostics: readonly Diagnostic[]);
52
+ }
@@ -0,0 +1,12 @@
1
+ import { Node } from './Nodes.js';
2
+ export declare class GraphVisualizer {
3
+ /**
4
+ * Создаёт описание графа на языке Dot.
5
+ *
6
+ * Визуализацию графа можно посмотреть по этой ссылке:
7
+ * https://dreampuf.github.io/GraphvizOnline/?engine=dot#digraph%20%7B%20%7D
8
+ */
9
+ static generateGraphDescriptionInDotLanguage(startNode: Node): string;
10
+ private static getLabel;
11
+ private static createGetIdFunction;
12
+ }
@@ -0,0 +1,5 @@
1
+ import * as tree from '../../../tree/m/index.js';
2
+ export declare function isNarrowableExpression(node: tree.Node): node is tree.Expression;
3
+ export type NarrowableReferenceExpression = tree.IdentifierExpression | tree.MemberAccessExpression | tree.ObjectExpression;
4
+ export declare function isNarrowableReferenceExpression(node: tree.Node): node is NarrowableReferenceExpression;
5
+ export declare function unwrapExpressionForNarrowableReferenceCheck(node: tree.Expression): tree.Expression;
@@ -0,0 +1,72 @@
1
+ import { FieldEntity, LocalVariableEntity, PackageVariableEntity, ParameterEntity } from '../../../entities/index.js';
2
+ import * as tree from '../../../tree/m/index.js';
3
+ import { Analyzer } from '../Analyzer.js';
4
+ import { NarrowableReferenceExpression } from './NarrowableExpression.js';
5
+ export type NarrowableReference = NarrowableReference.LocalVariable | NarrowableReference.PackageVariable | NarrowableReference.InstanceField | NarrowableReference.StaticField | NarrowableReference.ObjectAutoVariable;
6
+ export declare namespace NarrowableReference {
7
+ export class LocalVariable implements INarrowableReference {
8
+ private readonly analyzer;
9
+ readonly entity: LocalVariableEntity | ParameterEntity;
10
+ readonly kind = "local-variable";
11
+ constructor(analyzer: Analyzer, entity: LocalVariableEntity | ParameterEntity);
12
+ equals(other: NarrowableReference): boolean;
13
+ contains(_other: NarrowableReference): boolean;
14
+ equalsExpression(expression: NarrowableReferenceExpression): boolean;
15
+ containsExpression(_expression: NarrowableReferenceExpression): boolean;
16
+ }
17
+ export class PackageVariable implements INarrowableReference {
18
+ private readonly analyzer;
19
+ readonly entity: PackageVariableEntity;
20
+ readonly kind = "package-variable";
21
+ constructor(analyzer: Analyzer, entity: PackageVariableEntity);
22
+ equals(other: NarrowableReference): boolean;
23
+ contains(_other: NarrowableReference): boolean;
24
+ equalsExpression(expression: NarrowableReferenceExpression): boolean;
25
+ containsExpression(_expression: NarrowableReferenceExpression): boolean;
26
+ }
27
+ export class InstanceField implements INarrowableReference {
28
+ private readonly analyzer;
29
+ readonly field: FieldEntity;
30
+ readonly receiver: NarrowableReference;
31
+ readonly kind = "instance-field";
32
+ constructor(analyzer: Analyzer, field: FieldEntity, receiver: NarrowableReference);
33
+ equals(other: NarrowableReference): boolean;
34
+ contains(other: NarrowableReference): boolean;
35
+ equalsExpression(expression: NarrowableReferenceExpression): boolean;
36
+ containsExpression(expression: NarrowableReferenceExpression): boolean;
37
+ }
38
+ export class StaticField implements INarrowableReference {
39
+ private readonly analyzer;
40
+ readonly field: FieldEntity;
41
+ readonly kind = "static-field";
42
+ constructor(analyzer: Analyzer, field: FieldEntity);
43
+ equals(other: NarrowableReference): boolean;
44
+ contains(_other: NarrowableReference): boolean;
45
+ equalsExpression(expression: NarrowableReferenceExpression): boolean;
46
+ containsExpression(_expression: NarrowableReferenceExpression): boolean;
47
+ }
48
+ export class ObjectAutoVariable implements INarrowableReference {
49
+ readonly kind = "object-auto-variable";
50
+ equals(other: NarrowableReference): boolean;
51
+ contains(_other: NarrowableReference): boolean;
52
+ equalsExpression(expression: NarrowableReferenceExpression): boolean;
53
+ containsExpression(_expression: NarrowableReferenceExpression): boolean;
54
+ }
55
+ interface INarrowableReference {
56
+ equals(other: NarrowableReference): boolean;
57
+ contains(other: NarrowableReference): boolean;
58
+ /**
59
+ * Отличается от метода `equals` тем, что выполняет сравнение лениво. Например, при сравнении с выражением
60
+ * `а.б` сперва будут сравнены части слева от точки (выражение `а` с `receiver`), и только при равенстве будет
61
+ * связано и сравнено имя `б`. Если выражение `а` не равно `receiver`, то сразу будет возвращено `false` и
62
+ * связывание для имени `б` выполняться не будет. Такое поведение необходимо при анализе циклов,
63
+ * чтобы избежать рекурсии.
64
+ */
65
+ equalsExpression(expression: NarrowableReferenceExpression): boolean;
66
+ containsExpression(expression: NarrowableReferenceExpression): boolean;
67
+ }
68
+ export {};
69
+ }
70
+ export declare function getReferenceAtNarrowableExpression(analyzer: Analyzer, node: NarrowableReferenceExpression): NarrowableReference | undefined;
71
+ export declare function getReferenceAtExpressionIfNarrowable(analyzer: Analyzer, node: tree.Expression): NarrowableReference | undefined;
72
+ export declare function getNarrowableReferenceAtLocalOrPackageVariableDeclaration(analyzer: Analyzer, node: tree.LocalVariableDeclaration | tree.PackageVariableDeclaration): NarrowableReference;
@@ -0,0 +1,112 @@
1
+ import * as tree from '../../../tree/m/index.js';
2
+ export type Node = StartNode | ConditionNode | AssignmentNode | LocalVariableDeclarationNode | SplitNode | LoopNode | UnreachableNode | PackageVariableDeclarationNode;
3
+ declare abstract class ControlFlowNodeBase {
4
+ protected abstract thisAsNode: Node;
5
+ /**
6
+ * Для отладочных целей.
7
+ */
8
+ generateVisualizationCode(): string;
9
+ }
10
+ /**
11
+ * Начальный узел, не имеющий предшественников. Создаётся в начале функций, а также для переменных пакета и полей
12
+ * объекта с начальным значением, поскольку выражение-инициализатор может иметь собственный граф потока управления
13
+ * (например, если начальное значение - это трёхместная операция `когда` с проверкой на `пусто`).
14
+ */
15
+ export declare class StartNode extends ControlFlowNodeBase {
16
+ readonly kind = "start";
17
+ get debuggerDisplay(): string;
18
+ protected get thisAsNode(): Node;
19
+ }
20
+ export type ConditionExpression = tree.BinaryExpression | tree.CallExpression;
21
+ /**
22
+ * Хранит информацию об истинности некоторого условия. Например, если условие `а != пусто` истинно, то из типа
23
+ * переменной `а` необходимо исключить тип `Пусто`.
24
+ */
25
+ export declare class ConditionNode extends ControlFlowNodeBase {
26
+ readonly predecessor: Node;
27
+ readonly syntaxNode: ConditionExpression;
28
+ readonly isTrue: boolean;
29
+ readonly kind = "condition";
30
+ get debuggerDisplay(): string;
31
+ protected get thisAsNode(): Node;
32
+ constructor(predecessor: Node, syntaxNode: ConditionExpression, isTrue: boolean);
33
+ }
34
+ /**
35
+ * Создаётся в местах присваивания значений в переменную. После присваивания тип переменной меняется на тип выражения
36
+ * справа от равно.
37
+ */
38
+ export declare class AssignmentNode extends ControlFlowNodeBase {
39
+ readonly predecessor: Node;
40
+ readonly syntaxNode: tree.AssignmentStatement;
41
+ readonly kind = "assignment";
42
+ get debuggerDisplay(): string;
43
+ protected get thisAsNode(): Node;
44
+ constructor(predecessor: Node, syntaxNode: tree.AssignmentStatement);
45
+ }
46
+ /**
47
+ * Создаётся в местах объявления локальных переменных. Если переменной присваивается начальное значение, её тип будет
48
+ * взят как тип присваиваемого выражения.
49
+ */
50
+ export declare class LocalVariableDeclarationNode extends ControlFlowNodeBase {
51
+ readonly predecessor: Node;
52
+ readonly syntaxNode: tree.LocalVariableDeclaration;
53
+ readonly kind = "local-variable-declaration";
54
+ get debuggerDisplay(): string;
55
+ protected get thisAsNode(): Node;
56
+ constructor(predecessor: Node, syntaxNode: tree.LocalVariableDeclaration);
57
+ }
58
+ /**
59
+ * Вспомогательный узел, использующийся в местах, где происходит разветвление графа потока управления. Тип переменной
60
+ * для этого узла определяется как союзный тип из типов переменных в предшествующих узлах.
61
+ */
62
+ export declare class SplitNode extends ControlFlowNodeBase {
63
+ readonly predecessors: readonly Node[];
64
+ readonly kind = "split";
65
+ get debuggerDisplay(): string;
66
+ protected get thisAsNode(): Node;
67
+ constructor(predecessors: readonly Node[]);
68
+ }
69
+ /**
70
+ * Используется для циклов (пока, цикл - повтор пока, для-из). Отличается от узла {@link SplitNode} тем, что предшествующие
71
+ * узлы, указанные в массиве {@link loopingPredecessors}, образуют циклы в графе потока управления.
72
+ */
73
+ export declare abstract class LoopNode extends ControlFlowNodeBase {
74
+ readonly kind = "loop";
75
+ get debuggerDisplay(): string;
76
+ protected get thisAsNode(): Node;
77
+ /**
78
+ * Предшествующий узел, не образующий цикл в графе потока управления. Любой цикл имеет ровно один такой узел.
79
+ */
80
+ abstract predecessor: Node;
81
+ /**
82
+ * Предшествующие узлы, образующие цикл в графе управление. В простейшем случае имеет один элемент, поскольку
83
+ * управление в конце цикла возвращается в его начало (т.е. началу цикла предшествует его конец). Может иметь
84
+ * несколько элементов, если в теле цикла используются инструкции `следующий цикл`, или не иметь ни одного элемента,
85
+ * если это бесконечный цикл, содержащий инструкцию `прервать цикл`, или любую другую, прерывающую поток управления.
86
+ */
87
+ abstract loopingPredecessors: readonly Node[];
88
+ }
89
+ /**
90
+ * Обозначает недостижимый код. Соответствующая диагностика добавляется в
91
+ * {@link GraphBuildResult.unreachableCodeDiagnostics}. Класс {@link GraphBuilder} создаёт эти
92
+ * узлы для кода, недостижимость которого можно определить анализируя только синтаксическое дерево и не использую
93
+ * семантическую информацию. Например, инструкции, находящиеся после инструкции `возврат`, помечаются как недостижимые.
94
+ */
95
+ export declare class UnreachableNode extends ControlFlowNodeBase {
96
+ readonly kind = "unreachable";
97
+ get debuggerDisplay(): string;
98
+ protected get thisAsNode(): Node;
99
+ }
100
+ /**
101
+ * Создаётся в местах объявления пакетных переменных М. Если переменной присваивается начальное значение, её тип будет
102
+ * взят как тип присваиваемого выражения.
103
+ */
104
+ export declare class PackageVariableDeclarationNode extends ControlFlowNodeBase {
105
+ readonly predecessor: Node;
106
+ readonly syntaxNode: tree.PackageVariableDeclaration;
107
+ readonly kind = "package-variable-declaration";
108
+ get debuggerDisplay(): string;
109
+ protected get thisAsNode(): Node;
110
+ constructor(predecessor: Node, syntaxNode: tree.PackageVariableDeclaration);
111
+ }
112
+ export {};
@@ -0,0 +1,5 @@
1
+ export * from './GraphBuilder.js';
2
+ export * from './GraphVisualizer.js';
3
+ export * from './NarrowableExpression.js';
4
+ export * from './NarrowableReference.js';
5
+ export * from './Nodes.js';
@@ -0,0 +1,94 @@
1
+ import { Name } from '../../../common/index.js';
2
+ import { EntityHidingLevel, MethodEntity, NamedFunctionEntity, NamedTypeEntity, PackageAliasEntity, PackageOrLocalOrParameterVariableEntity, PackageOrNestedFunctionEntity, VariableEntity } from '../../../entities/index.js';
3
+ import * as types from '../../../types/index.js';
4
+ import { PackageNameTreeNode } from '../../ImportedPackageNameTree.js';
5
+ export type TypeOrContainerWithTypes = NamedDeclaration_type | NamedDeclaration_packageAlias | NamedDeclaration_packageNameSegment;
6
+ export type TagOrContainerWithTags = NamedDeclaration_function | NamedDeclaration_type | NamedDeclaration_packageAlias | NamedDeclaration_packageNameSegment;
7
+ export type NamedDeclaration = NamedDeclaration_function | NamedDeclaration_variable | NamedDeclaration_type | NamedDeclaration_packageAlias | NamedDeclaration_packageNameSegment;
8
+ export declare class NamedDeclaration_function implements INamedDeclaration {
9
+ readonly value: NamedDeclarationFunction;
10
+ readonly kind = "function";
11
+ constructor(value: NamedDeclarationFunction);
12
+ getName(): Name;
13
+ isHidden(): EntityHidingLevel | undefined;
14
+ }
15
+ export type NamedDeclarationFunction = NamedDeclarationFunction_entity | NamedDeclarationFunction_typeMember;
16
+ export declare class NamedDeclarationFunction_entity implements INamedDeclarationFunction {
17
+ readonly kind = "entity";
18
+ readonly value: PackageOrNestedFunctionEntity;
19
+ constructor(value: PackageOrNestedFunctionEntity);
20
+ getName(): Name;
21
+ getEntity(): PackageOrNestedFunctionEntity;
22
+ getTypeParameterArity(): number;
23
+ isHidden(): EntityHidingLevel | undefined;
24
+ }
25
+ export declare class NamedDeclarationFunction_typeMember implements INamedDeclarationFunction {
26
+ readonly kind = "type-member";
27
+ readonly value: types.Method;
28
+ constructor(value: types.Method);
29
+ getName(): Name;
30
+ getEntity(): MethodEntity;
31
+ getTypeParameterArity(): number;
32
+ isHidden(): EntityHidingLevel | undefined;
33
+ }
34
+ interface INamedDeclarationFunction {
35
+ getName(): Name;
36
+ getEntity(): NamedFunctionEntity;
37
+ getTypeParameterArity(): number;
38
+ isHidden(): EntityHidingLevel | undefined;
39
+ }
40
+ export declare class NamedDeclaration_variable implements INamedDeclaration {
41
+ readonly value: NamedDeclarationVariable;
42
+ readonly kind = "variable";
43
+ constructor(value: NamedDeclarationVariable);
44
+ getName(): Name;
45
+ isHidden(): EntityHidingLevel | undefined;
46
+ }
47
+ export type NamedDeclarationVariable = NamedDeclarationVariable_entity | NamedDeclarationVariable_typeMember;
48
+ export declare class NamedDeclarationVariable_entity implements INamedDeclarationVariable {
49
+ readonly value: PackageOrLocalOrParameterVariableEntity;
50
+ readonly kind = "entity";
51
+ constructor(value: PackageOrLocalOrParameterVariableEntity);
52
+ getName(): Name;
53
+ getEntity(): VariableEntity;
54
+ isHidden(): EntityHidingLevel | undefined;
55
+ }
56
+ export declare class NamedDeclarationVariable_typeMember implements INamedDeclarationVariable {
57
+ readonly value: types.Field;
58
+ readonly kind = "type-member";
59
+ constructor(value: types.Field);
60
+ getName(): Name;
61
+ getEntity(): VariableEntity;
62
+ isHidden(): EntityHidingLevel | undefined;
63
+ }
64
+ interface INamedDeclarationVariable {
65
+ getName(): Name;
66
+ getEntity(): VariableEntity;
67
+ isHidden(): EntityHidingLevel | undefined;
68
+ }
69
+ export declare class NamedDeclaration_type implements INamedDeclaration {
70
+ readonly value: NamedTypeEntity;
71
+ readonly kind = "type";
72
+ constructor(value: NamedTypeEntity);
73
+ getName(): Name;
74
+ isHidden(): EntityHidingLevel | undefined;
75
+ }
76
+ export declare class NamedDeclaration_packageAlias implements INamedDeclaration {
77
+ readonly value: PackageAliasEntity;
78
+ readonly kind = "package-alias";
79
+ constructor(value: PackageAliasEntity);
80
+ getName(): Name;
81
+ isHidden(): EntityHidingLevel | undefined;
82
+ }
83
+ export declare class NamedDeclaration_packageNameSegment implements INamedDeclaration {
84
+ readonly value: PackageNameTreeNode;
85
+ readonly kind = "package-name-segment";
86
+ constructor(value: PackageNameTreeNode);
87
+ getName(): Name;
88
+ isHidden(): EntityHidingLevel | undefined;
89
+ }
90
+ interface INamedDeclaration {
91
+ getName(): Name;
92
+ isHidden(): EntityHidingLevel | undefined;
93
+ }
94
+ export {};
@@ -0,0 +1,28 @@
1
+ import { Name } from '../../../common/index.js';
2
+ import * as tree from '../../../tree/m/index.js';
3
+ import { TypeMemberLookupContext } from '../../TypeMemberLookup.js';
4
+ import { Analyzer } from '../Analyzer.js';
5
+ import { NamedDeclaration, TagOrContainerWithTags, TypeOrContainerWithTypes } from './Declarations.js';
6
+ import { SemanticContext } from './SemanticContext.js';
7
+ import { NamedDeclarationLookupResult, SemanticContextLookupState } from './SemanticContextBase.js';
8
+ import { SemanticContextWithParent } from './SemanticContextWithParent.js';
9
+ import { StaticDeclarationSemanticContext } from './StaticDeclarationSemanticContext.js';
10
+ import { TypeOrExtensionMembersSemanticContext } from './TypeSemanticContext.js';
11
+ export type FieldWithInitializerSemanticContextParent = TypeOrExtensionMembersSemanticContext | StaticDeclarationSemanticContext;
12
+ export type FieldWithInitializerDeclaration = tree.FieldDeclaration | tree.StaticFieldDeclaration;
13
+ export declare class FieldWithInitializerSemanticContext extends SemanticContextWithParent {
14
+ readonly kind = "field-initializer";
15
+ readonly outer: FieldWithInitializerSemanticContextParent;
16
+ protected readonly asContext: SemanticContext;
17
+ private readonly analyzer;
18
+ private readonly node;
19
+ constructor(analyzer: Analyzer, node: FieldWithInitializerDeclaration, outer: FieldWithInitializerSemanticContextParent);
20
+ isStatic(): boolean;
21
+ getTypeMemberLookupContext(): TypeMemberLookupContext;
22
+ getOwnTypesOrContainersWithTypes(_initialContext: SemanticContext): readonly TypeOrContainerWithTypes[];
23
+ getOwnTypesOrContainersWithTypesByName(_name: Name, _initialContext: SemanticContext): readonly TypeOrContainerWithTypes[];
24
+ getOwnTagsOrContainersWithTags(_initialContext: SemanticContext): readonly TagOrContainerWithTags[];
25
+ getOwnTagsOrContainersWithTagsByName(_name: Name, _initialContext: SemanticContext): readonly TagOrContainerWithTags[];
26
+ getOwnNamedDeclarations(_initialContext: SemanticContext, _noInstanceMembers: boolean, _lookupState: SemanticContextLookupState): readonly NamedDeclaration[];
27
+ getOwnNamedDeclarationsByName(_name: Name, _initialContext: SemanticContext, _noInstanceMembers: boolean, _lookupResult: NamedDeclarationLookupResult): void;
28
+ }
@@ -0,0 +1,14 @@
1
+ import { FieldWithInitializerSemanticContext } from './FieldWithInitializerSemanticContext.js';
2
+ import { SourceFileSemanticContext } from './SourceFileSemanticContext.js';
3
+ import { StaticDeclarationSemanticContext } from './StaticDeclarationSemanticContext.js';
4
+ import { ForStatementSemanticContext, StatementBlockSemanticContext, SubprogramParameterListSemanticContext, SubprogramTypeParameterSemanticContext, CatchClauseSemanticContext } from './SubprogramBodyAndParametersSemanticContext.js';
5
+ import { OutermostSemanticContextOfSubprogram } from './SubprogramSemanticContext.js';
6
+ import { OutermostSemanticContextOfTypeOrExtension, ParametersOfFunctionTypeSemanticContext, TypeOrExtensionMembersSemanticContext, TypeParametersOfTypeSemanticContext } from './TypeSemanticContext.js';
7
+ /**
8
+ * Позволяет получить информацию, общую для определённой области
9
+ * исходного кода (блока инструкций, списка членов типа и др.) с учётом
10
+ * всех вышестоящих (родительских) контекстов.
11
+ * Чтобы получить семантический контекст, в котором находится определённый узел,
12
+ * используйте `analyzer.semanticContext.containing(node)`.
13
+ */
14
+ export type SemanticContext = SourceFileSemanticContext | OutermostSemanticContextOfTypeOrExtension | TypeParametersOfTypeSemanticContext | TypeOrExtensionMembersSemanticContext | ParametersOfFunctionTypeSemanticContext | OutermostSemanticContextOfSubprogram | SubprogramTypeParameterSemanticContext | SubprogramParameterListSemanticContext | StatementBlockSemanticContext | FieldWithInitializerSemanticContext | ForStatementSemanticContext | CatchClauseSemanticContext | StaticDeclarationSemanticContext;