@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.
- package/build/Cli.js +3 -3
- package/build/api/Api.js +19 -15
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +11426 -5066
- package/build/{chunk-LTJPPRSR.js → chunk-55LNCV63.js} +87206 -50765
- package/build/{chunk-5VVFNKOH.js → chunk-6XVQ7FTB.js} +2 -2
- package/build/{chunk-AEW4TILW.js → chunk-PUDLDJ7V.js} +1 -1
- package/build/types/analysis/Analyzer.d.ts +6 -1
- package/build/types/analysis/TypeMemberLookup.d.ts +3 -1
- package/build/types/analysis/WellKnownDeclarations.d.ts +54 -0
- package/build/types/analysis/a/Analyzer.d.ts +4 -4
- package/build/types/analysis/a/IdentifierExpressionMeaning.d.ts +3 -3
- package/build/types/analysis/a/MemberAccessExpressionMeaning.d.ts +3 -3
- package/build/types/analysis/a/ModifierValidator.d.ts +3 -2
- package/build/types/analysis/a/ResolvedTranslationPackage.d.ts +2 -1
- package/build/types/analysis/a/SourceFileAnalyzer.d.ts +1 -1
- package/build/types/analysis/a/SourcePackageMembersCreator.d.ts +1 -2
- package/build/types/analysis/a/TreeQuery.d.ts +1 -2
- package/build/types/analysis/a/TypeMemberLookup.d.ts +3 -1
- package/build/types/analysis/a/semantic-context/FieldWithInitializerSemanticContext.d.ts +3 -3
- package/build/types/analysis/a/semantic-context/SemanticContext.d.ts +2 -2
- package/build/types/analysis/a/semantic-context/SemanticContextBuilder.d.ts +10 -12
- package/build/types/analysis/a/semantic-context/SpecialLocalDeclarationsBuilder.d.ts +0 -1
- package/build/types/analysis/a/semantic-context/SubprogramBodyAndParametersSemanticContext.d.ts +5 -4
- package/build/types/analysis/a/semantic-context/SubprogramSemanticContext.d.ts +11 -10
- package/build/types/analysis/a/semantic-context/TypeSemanticContext.d.ts +13 -13
- package/build/types/analysis/m/Analyzer.d.ts +425 -1
- package/build/types/analysis/m/ArgumentToParameterMatchResult.d.ts +23 -0
- package/build/types/analysis/m/ArgumentsToParametersMatcher.d.ts +40 -0
- package/build/types/analysis/m/BaseExpressionMeaning.d.ts +25 -0
- package/build/types/analysis/m/CallExpressionMeaning.d.ts +72 -0
- package/build/types/analysis/m/ConstructorCallResolver.d.ts +24 -0
- package/build/types/analysis/m/DeclarationsUsageCounter.d.ts +12 -0
- package/build/types/analysis/m/DereferenceExpressionMeaning.d.ts +28 -0
- package/build/types/analysis/m/ExpressionAnalysisOptions.d.ts +21 -0
- package/build/types/analysis/m/FunctionAccessResolver.d.ts +19 -0
- package/build/types/analysis/m/IdentifierExpressionMeaning.d.ts +137 -0
- package/build/types/analysis/m/IndexedAccessExpressionMeaning.d.ts +32 -0
- package/build/types/analysis/m/InstanceFieldsInitializationValidator.d.ts +18 -0
- package/build/types/analysis/m/MemberAccessExpressionMeaning.d.ts +137 -0
- package/build/types/analysis/m/ModifierFlags.d.ts +20 -0
- package/build/types/analysis/m/NamedTypeResolver.d.ts +44 -0
- package/build/types/analysis/m/NamedTypeSpecifierResolver.d.ts +19 -0
- package/build/types/analysis/m/ObjectExpressionMeaning.d.ts +29 -0
- package/build/types/analysis/m/OverloadResolver.d.ts +104 -0
- package/build/types/analysis/m/OwnAndBaseConstructorCallsChecker.d.ts +36 -0
- package/build/types/analysis/m/PackageAndStaticVariablesInitializationValidator.d.ts +17 -0
- package/build/types/analysis/m/ReachabilityChecker.d.ts +27 -0
- package/build/types/analysis/m/ReductionSourceMemberFinder.d.ts +17 -0
- package/build/types/analysis/m/ReservedNameDictionary.d.ts +15 -0
- package/build/types/analysis/m/ResolvedTranslationPackage.d.ts +68 -0
- package/build/types/analysis/m/ReturnTypeInferrer.d.ts +13 -0
- package/build/types/analysis/m/SourceFileAnalyzer.d.ts +131 -0
- package/build/types/analysis/m/SourcePackageMembersCreator.d.ts +7 -0
- package/build/types/analysis/m/SourceTypeMembersCreator.d.ts +9 -0
- package/build/types/analysis/m/StaticDeclarationMeaning.d.ts +32 -0
- package/build/types/analysis/m/SyntacticAccessKind.d.ts +6 -0
- package/build/types/analysis/m/TagMeaning.d.ts +70 -0
- package/build/types/analysis/m/TextIdentity.d.ts +7 -0
- package/build/types/analysis/m/TranslatedEntityNameConflictsValidator.d.ts +28 -0
- package/build/types/analysis/m/TreeQuery.d.ts +15 -0
- package/build/types/analysis/m/TypeArgumentInferrer.d.ts +52 -0
- package/build/types/analysis/m/TypeInferrer.d.ts +11 -0
- package/build/types/analysis/m/TypeMemberLookup.d.ts +4 -1
- package/build/types/analysis/m/TypeNarrower.d.ts +31 -0
- package/build/types/analysis/m/TypeOverloadResolver.d.ts +9 -0
- package/build/types/analysis/m/UserDefinableBinaryOperatorResolver.d.ts +34 -0
- package/build/types/analysis/m/UserDefinableUnaryOperatorResolver.d.ts +23 -0
- package/build/types/analysis/m/VariableIsAssignedChecker.d.ts +11 -0
- package/build/types/analysis/m/VariableIsNotAssignedChecker.d.ts +12 -0
- package/build/types/analysis/m/control-flow/GraphBuilder.d.ts +52 -0
- package/build/types/analysis/m/control-flow/GraphVisualizer.d.ts +12 -0
- package/build/types/analysis/m/control-flow/NarrowableExpression.d.ts +5 -0
- package/build/types/analysis/m/control-flow/NarrowableReference.d.ts +72 -0
- package/build/types/analysis/m/control-flow/Nodes.d.ts +112 -0
- package/build/types/analysis/m/control-flow/index.d.ts +5 -0
- package/build/types/analysis/m/semantic-context/Declarations.d.ts +94 -0
- package/build/types/analysis/m/semantic-context/FieldWithInitializerSemanticContext.d.ts +28 -0
- package/build/types/analysis/m/semantic-context/SemanticContext.d.ts +14 -0
- package/build/types/analysis/m/semantic-context/SemanticContextBase.d.ts +190 -0
- package/build/types/analysis/m/semantic-context/SemanticContextBuilder.d.ts +69 -0
- package/build/types/analysis/m/semantic-context/SemanticContextValidatingNameConflicts.d.ts +51 -0
- package/build/types/analysis/m/semantic-context/SemanticContextWithParent.d.ts +12 -0
- package/build/types/analysis/m/semantic-context/SourceFileSemanticContext.d.ts +63 -0
- package/build/types/analysis/m/semantic-context/StaticDeclarationSemanticContext.d.ts +26 -0
- package/build/types/analysis/m/semantic-context/SubprogramBodyAndParametersSemanticContext.d.ts +108 -0
- package/build/types/analysis/m/semantic-context/SubprogramSemanticContext.d.ts +92 -0
- package/build/types/analysis/m/semantic-context/TypeSemanticContext.d.ts +93 -0
- package/build/types/analysis/m/semantic-context/index.d.ts +10 -0
- package/build/types/common/LocalizationHelper.d.ts +3 -1
- package/build/types/common/LocalizationHelperA.d.ts +0 -2
- package/build/types/common/LocalizationHelperM.d.ts +13 -0
- package/build/types/common/Name.d.ts +1 -1
- package/build/types/common/index.d.ts +1 -0
- package/build/types/diagnostic/DiagnosticCode.d.ts +211 -192
- package/build/types/diagnostic/TokenDiagnosticM.d.ts +2 -0
- package/build/types/emitter/EmitPhaseName.d.ts +2 -2
- package/build/types/emitter/Entities.d.ts +4 -2
- package/build/types/emitter/IrBuilderM.d.ts +124 -0
- package/build/types/emitter/IrFactory.d.ts +2 -2
- package/build/types/entities/Entity.d.ts +8 -5
- package/build/types/entities/EntityLocalizationContext.d.ts +3 -2
- package/build/types/entities/OperatorKind.d.ts +13 -18
- package/build/types/entities/Translation.d.ts +4 -3
- package/build/types/entities/interfaces/AliasTypeEntity.d.ts +4 -1
- package/build/types/entities/interfaces/DereferenceOperatorEntity.d.ts +3 -1
- package/build/types/entities/interfaces/FunctionEntity.d.ts +3 -1
- package/build/types/entities/interfaces/FunctionTypeEntity.d.ts +3 -1
- package/build/types/entities/interfaces/IndexerEntity.d.ts +4 -1
- package/build/types/entities/interfaces/PackageAliasEntity.d.ts +4 -1
- package/build/types/entities/interfaces/PackageEntity.d.ts +2 -1
- package/build/types/entities/interfaces/ReducedTypeEntity.d.ts +3 -1
- package/build/types/entities/interfaces/StructuredTypeEntity.d.ts +9 -2
- package/build/types/entities/interfaces/TextTranslationEntity.d.ts +4 -1
- package/build/types/entities/interfaces/TypeExtensionEntity.d.ts +4 -1
- package/build/types/entities/interfaces/TypeParameterEntity.d.ts +7 -3
- package/build/types/entities/interfaces/VariableEntity.d.ts +3 -2
- package/build/types/entities/interfaces/VariantTypeEntity.d.ts +3 -1
- package/build/types/entities/interfaces/m/ConstructorEntityM.d.ts +10 -0
- package/build/types/entities/interfaces/m/DestructorEntityM.d.ts +8 -0
- package/build/types/entities/interfaces/m/index.d.ts +2 -0
- package/build/types/entities/source/a/SourceFunctionEntity.d.ts +1 -1
- package/build/types/entities/source/a/SourcePackageEntity.d.ts +2 -1
- package/build/types/entities/source/a/SourceStructuredTypeEntity.d.ts +3 -5
- package/build/types/entities/source/m/SourceAliasTypeEntity.d.ts +32 -0
- package/build/types/entities/source/m/SourceConstructorEntity.d.ts +40 -0
- package/build/types/entities/source/m/SourceDestructorEntity.d.ts +38 -0
- package/build/types/entities/source/m/SourceFunctionEntity.d.ts +252 -0
- package/build/types/entities/source/m/SourceFunctionTypeEntity.d.ts +35 -0
- package/build/types/entities/source/m/SourceGetterEntity.d.ts +122 -0
- package/build/types/entities/source/m/SourceIndexerEntity.d.ts +36 -0
- package/build/types/entities/source/m/SourcePackageAliasEntity.d.ts +22 -0
- package/build/types/entities/source/m/SourcePackageEntity.d.ts +68 -0
- package/build/types/entities/source/m/SourceSetterEntity.d.ts +122 -0
- package/build/types/entities/source/m/SourceStructuredTypeEntity.d.ts +111 -0
- package/build/types/entities/source/m/SourceTextTranslationEntity.d.ts +29 -0
- package/build/types/entities/source/m/SourceTypeParameterEntity.d.ts +30 -0
- package/build/types/entities/source/m/SourceVariableEntity.d.ts +447 -0
- package/build/types/entities/source/m/SourceVariantTypeEntity.d.ts +38 -0
- package/build/types/entities/source/m/index.d.ts +15 -0
- package/build/types/entities/translated/TranslatedPackageEntity.d.ts +2 -1
- package/build/types/entities/translated/TranslatedStructuredTypeEntity.d.ts +33 -1
- package/build/types/entities/translated/source/a/SourceTranslatedPackageStructuredTypeEntity.d.ts +8 -2
- package/build/types/entities/translated/source/m/SourceTranslatedAliasTypeEntity.d.ts +14 -0
- package/build/types/entities/translated/source/m/SourceTranslatedDestructorEntity.d.ts +12 -0
- package/build/types/entities/translated/source/m/SourceTranslatedFunctionEntity.d.ts +24 -0
- package/build/types/entities/translated/source/m/SourceTranslatedFunctionTypeEntity.d.ts +13 -0
- package/build/types/entities/translated/source/m/SourceTranslatedIndexerEntity.d.ts +12 -0
- package/build/types/entities/translated/source/m/SourceTranslatedPackageEntity.d.ts +19 -0
- package/build/types/entities/translated/source/m/SourceTranslatedPackageStructuredTypeEntity.d.ts +26 -0
- package/build/types/entities/translated/source/m/SourceTranslatedPackageVariantTypeEntity.d.ts +14 -0
- package/build/types/entities/translated/source/m/SourceTranslatedReducedTypeEntity.d.ts +14 -0
- package/build/types/entities/translated/source/m/index.d.ts +9 -0
- package/build/types/parser/a/KeywordDictionary.d.ts +2 -3
- package/build/types/parser/a/Parser.d.ts +2 -2
- package/build/types/parser/m/ConvertTokenKind.d.ts +3 -0
- package/build/types/parser/m/KeywordDictionary.d.ts +33 -0
- package/build/types/parser/m/Parser.d.ts +7 -0
- package/build/types/parser/m/Scanner.d.ts +56 -0
- package/build/types/parser/m/TokenKind.d.ts +81 -0
- package/build/types/parser/m/TriviaInterner.d.ts +8 -0
- package/build/types/project/SourceFile.d.ts +5 -6
- package/build/types/services/LanguageServer.d.ts +23 -12
- package/build/types/services/a/NodeSemanticInfo.d.ts +2 -2
- package/build/types/services/common/WorkspaceItemsService.d.ts +1 -0
- package/build/types/services/common/completion/Types.d.ts +8 -2
- package/build/types/services/common/display/DisplayService.d.ts +3 -0
- package/build/types/services/common/display/Types.d.ts +2 -2
- package/build/types/services/m/CodeActionsService.d.ts +10 -0
- package/build/types/services/m/CompletionService.d.ts +60 -0
- package/build/types/services/m/DefinitionService.d.ts +11 -0
- package/build/types/services/m/DisplayService.d.ts +52 -0
- package/build/types/services/m/EvaluatableExpressionService.d.ts +10 -0
- package/build/types/services/m/HoverService.d.ts +11 -0
- package/build/types/services/m/NodeSemanticInfo.d.ts +46 -0
- package/build/types/services/m/RenameService.d.ts +11 -0
- package/build/types/services/m/SelectionRangeService.d.ts +7 -0
- package/build/types/services/m/SemanticTokensService.d.ts +11 -0
- package/build/types/services/m/SourceFileItemsService.d.ts +10 -0
- package/build/types/services/m/TranslationService.d.ts +23 -0
- package/build/types/services/m/TranslationsGenerationService.d.ts +7 -0
- package/build/types/services/m/TreeUtils.d.ts +58 -0
- package/build/types/services/m/references/DefinitionInfoFinder.d.ts +6 -0
- package/build/types/services/m/references/ReferencesFinder.d.ts +7 -0
- package/build/types/services/m/signature-help/ParametersSignatureHelpProvider.d.ts +15 -0
- package/build/types/services/m/signature-help/SignatureHelpService.d.ts +6 -0
- package/build/types/services/m/signature-help/SignatureWithParameters.d.ts +94 -0
- package/build/types/services/m/signature-help/TypeParameterSignatureHelpProvider.d.ts +21 -0
- package/build/types/services/m/signature-help/utils.d.ts +9 -0
- package/build/types/tree/a/KeywordKind.d.ts +1 -3
- package/build/types/tree/a/NodeKind.d.ts +113 -114
- package/build/types/tree/a/Nodes.d.ts +6 -5
- package/build/types/tree/a/OperatorKind.d.ts +5 -0
- package/build/types/tree/a/Types.d.ts +9 -4
- package/build/types/tree/m/BaseNode.d.ts +8 -40
- package/build/types/tree/m/KeywordFlags.d.ts +4 -0
- package/build/types/tree/m/KeywordKind.d.ts +40 -0
- package/build/types/tree/m/NodeKind.d.ts +147 -2
- package/build/types/tree/m/Nodes.d.ts +2064 -9
- package/build/types/tree/m/NodesDebug.d.ts +9 -0
- package/build/types/tree/m/OperatorKind.d.ts +39 -0
- package/build/types/tree/m/SyntaxToCode.d.ts +107 -0
- package/build/types/tree/m/Token.d.ts +46 -0
- package/build/types/tree/m/TokenFlags.d.ts +12 -0
- package/build/types/tree/m/TokenKind.d.ts +61 -60
- package/build/types/tree/m/TreeTraversal.d.ts +18 -0
- package/build/types/tree/m/Types.d.ts +46 -0
- package/build/types/tree/m/Utils.d.ts +7 -0
- package/build/types/tree/m/index.d.ts +9 -0
- package/build/types/types/StandardTypes.d.ts +2 -0
- package/package.json +1 -1
- /package/build/types/diagnostic/{TokenDiagnostic.d.ts → TokenDiagnosticA.d.ts} +0 -0
|
@@ -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,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;
|