@artel/artc 0.6.25226 → 0.6.25227
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 +10 -56
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +396 -315
- package/build/{chunk-YNR2KYMJ.js → chunk-74TFH7TE.js} +3 -3
- package/build/{chunk-VRQPLLYS.js → chunk-NOECPQMV.js} +5773 -5236
- package/build/{chunk-MHPX52MT.js → chunk-VD6OPILI.js} +3 -3
- package/build/types/analysis/Analyzer.d.ts +24 -70
- package/build/types/analysis/AssignmentChecker.d.ts +11 -0
- package/build/types/analysis/CallExpressionMeaning.d.ts +2 -0
- package/build/types/analysis/DiagnosticCollector.d.ts +6 -3
- package/build/types/analysis/IdentifierExpressionMeaning.d.ts +6 -6
- package/build/types/analysis/IndexedAccessExpressionMeaning.d.ts +3 -3
- package/build/types/analysis/MemberAccessExpressionMeaning.d.ts +9 -9
- package/build/types/analysis/NamedTypeResolver.d.ts +3 -2
- package/build/types/analysis/NamedTypeSpecifierResolver.d.ts +3 -2
- package/build/types/analysis/NodeTypeUtils.d.ts +3 -2
- package/build/types/analysis/TagMeaning.d.ts +3 -2
- package/build/types/analysis/TypeMemberLookup.d.ts +11 -11
- package/build/types/analysis/TypeNarrower.d.ts +0 -69
- package/build/types/analysis/control-flow/GraphBuilder.d.ts +1 -0
- package/build/types/analysis/control-flow/NarrowableReference.d.ts +73 -0
- package/build/types/analysis/control-flow/Nodes.d.ts +9 -0
- package/build/types/analysis/control-flow/index.d.ts +1 -0
- package/build/types/analysis/semantic-context/Declarations.d.ts +117 -0
- package/build/types/analysis/semantic-context/FieldWithInitializerSemanticContext.d.ts +22 -0
- package/build/types/analysis/semantic-context/SemanticContext.d.ts +13 -0
- package/build/types/analysis/semantic-context/SemanticContextBase.d.ts +168 -0
- package/build/types/analysis/semantic-context/SemanticContextBasedEntityHidingMatcher.d.ts +14 -0
- package/build/types/analysis/semantic-context/SemanticContextBuilder.d.ts +84 -0
- package/build/types/analysis/semantic-context/SemanticContextValidatingNameConflicts.d.ts +124 -0
- package/build/types/analysis/semantic-context/SemanticContextWithParent.d.ts +9 -0
- package/build/types/analysis/semantic-context/SourceFileSemanticContext.d.ts +42 -0
- package/build/types/analysis/semantic-context/SpecialLocalDeclarationsBuilder.d.ts +23 -0
- package/build/types/analysis/semantic-context/SubprogramSemanticContext.d.ts +122 -0
- package/build/types/analysis/semantic-context/TypeSemanticContext.d.ts +109 -0
- package/build/types/analysis/semantic-context/index.d.ts +9 -0
- package/build/types/api/Api.d.ts +3 -5
- package/build/types/common/Errors.d.ts +2 -0
- package/build/types/common/Lazy.d.ts +4 -0
- package/build/types/common/Query.d.ts +2 -1
- package/build/types/common/WithDiagnostics.d.ts +4 -3
- package/build/types/common/index.d.ts +1 -0
- package/build/types/diagnostic/DiagnosticCode.d.ts +26 -20
- package/build/types/emitter/IrBuilder.d.ts +1 -0
- package/build/types/emitter/Transformer.d.ts +1 -1
- package/build/types/entities/FunctionEntity.d.ts +2 -2
- package/build/types/entities/VariableEntity.d.ts +35 -19
- package/build/types/services/DefinitionService.d.ts +3 -0
- package/build/types/tree/KeywordKind.d.ts +31 -30
- package/build/types/tree/NodeKind.d.ts +81 -80
- package/build/types/tree/green/Nodes.d.ts +40 -18
- package/build/types/tree/red/Nodes.d.ts +31 -15
- package/build/types/types/TypeFactory.d.ts +0 -2
- package/package.json +1 -1
- package/build/types/analysis/Lookup.d.ts +0 -28
- package/build/types/analysis/Scope.d.ts +0 -205
- package/build/types/analysis/SemanticContext.d.ts +0 -367
- package/build/types/analysis/SemanticContextBuilder.d.ts +0 -59
- package/build/types/analysis/StatementBlockScopeBuilder.d.ts +0 -26
@@ -1,6 +1,6 @@
|
|
1
1
|
import {
|
2
2
|
Compiler
|
3
|
-
} from "./chunk-
|
3
|
+
} from "./chunk-74TFH7TE.js";
|
4
4
|
import {
|
5
5
|
ArtelVersion,
|
6
6
|
Cached,
|
@@ -14,7 +14,7 @@ import {
|
|
14
14
|
__async,
|
15
15
|
performanceMeasurementStageNames,
|
16
16
|
performanceMeasurementStages
|
17
|
-
} from "./chunk-
|
17
|
+
} from "./chunk-NOECPQMV.js";
|
18
18
|
|
19
19
|
// source/executor/FileSystemUri.ts
|
20
20
|
import { platform } from "os";
|
@@ -216,7 +216,7 @@ var NodeCompiler = class {
|
|
216
216
|
const standardLibraryUri = yield this.findStandardTypeScriptLibrary(nodeModulesSearchPaths, defaultTsLibraryPath);
|
217
217
|
if (standardLibraryUri === void 0) {
|
218
218
|
const diagnostic = new Diagnostic(DiagnosticData.withCode(
|
219
|
-
301 /*
|
219
|
+
301 /* CannotFindTsLibDirectoryBaseSearchPaths0 */,
|
220
220
|
[nodeModulesSearchPaths.map((p) => `'${p}'`).join(", ")]
|
221
221
|
), void 0);
|
222
222
|
diagnostics?.addDiagnostic(diagnostic);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import ts from 'typescript';
|
2
|
-
import { CancellationToken, Name, PackageLocale, Range, SearchName, WithDiagnostics } from '../common/index.js';
|
2
|
+
import { CancellationToken, Lazy, Name, PackageLocale, Range, SearchName, WithDiagnostics } from '../common/index.js';
|
3
3
|
import { Diagnostic, DiagnosticAcceptor, DiagnosticLocation } from '../diagnostic/Diagnostic.js';
|
4
4
|
import { DiagnosticCode } from '../diagnostic/DiagnosticCode.js';
|
5
5
|
import { DiagnosticFlags, DiagnosticKind } from '../diagnostic/DiagnosticData.js';
|
@@ -35,8 +35,6 @@ import { NamedTypeSpecifierResolutionResult } from './NamedTypeSpecifierResolver
|
|
35
35
|
import { DereferencedVariableAccessorDeclaration, FieldAccessorDeclaration, FunctionTypeDeclaration, GetterDeclaration, IndexedElementAccessorDeclaration, PackageVariableAccessorDeclaration, SetterDeclaration, StructuredTypeDeclaration, VariantTypeDeclaration } from './NodeTypeUtils.js';
|
36
36
|
import * as objectExpressionMeaning from './ObjectExpressionMeaning.js';
|
37
37
|
import * as operationOverloadResolver from './OperationOverloadResolver.js';
|
38
|
-
import * as scope from './Scope.js';
|
39
|
-
import { SemanticContextBuilder } from './SemanticContextBuilder.js';
|
40
38
|
import { SourceFileMembers as ActualSourceFileMembers } from './SourceFileMembers.js';
|
41
39
|
import * as tagMeaning from './TagMeaning.js';
|
42
40
|
import * as tags from './Tags.js';
|
@@ -44,6 +42,7 @@ import { TargetTypeHint } from './TargetTypeHint.js';
|
|
44
42
|
import * as typeOverloadResolver from './TypeOverloadResolver.js';
|
45
43
|
import * as controlFlow from './control-flow/index.js';
|
46
44
|
import { WellKnownDeclarations } from './index.js';
|
45
|
+
import * as semanticContext from './semantic-context/index.js';
|
47
46
|
export declare class Analyzer {
|
48
47
|
static readonly enumeratorMethodName = "\u043F\u0435\u0440\u0435\u0431\u043E\u0440";
|
49
48
|
static readonly functionTypeInvokeMethodName = "\u0432\u044B\u043F\u043E\u043B\u043D\u0438\u0442\u044C";
|
@@ -60,8 +59,7 @@ export declare class Analyzer {
|
|
60
59
|
readonly entity: Entity;
|
61
60
|
readonly resultLocalVariableEntity: ResultLocalVariableEntity;
|
62
61
|
readonly valueLocalVariableEntity: ValueLocalVariableEntity;
|
63
|
-
readonly
|
64
|
-
readonly semanticContext: SemanticContextBuilder;
|
62
|
+
readonly semanticContext: semanticContext.SemanticContextBuilder;
|
65
63
|
readonly argumentToParameterMatchResult: ArgumentToParameterMatchResult;
|
66
64
|
readonly defaultConstructors: DefaultConstructors;
|
67
65
|
readonly overriddenMember: OverriddenMember;
|
@@ -96,6 +94,7 @@ export declare class Analyzer {
|
|
96
94
|
private readonly _functionBlockWithYieldStatementCheckResults;
|
97
95
|
private readonly _namedDeclarationsUsageCountResults;
|
98
96
|
private readonly _controlFlowGraphs;
|
97
|
+
private readonly _diagnosticsComputedLazily;
|
99
98
|
get tsInterop(): TsInteropContext;
|
100
99
|
constructor(compilation: project.Compilation, tsInteropInputs: TsInteropInputs);
|
101
100
|
getProjectSourceFile(node: tree.SourceFile): project.SourceFile;
|
@@ -124,6 +123,7 @@ export declare class Analyzer {
|
|
124
123
|
enumeratePackageImports(packageImportDirectives: Iterable<tree.PackageImportDirective>): Iterable<tree.PackageImport>;
|
125
124
|
getSourceFileMembers(node: tree.SourceFile): ActualSourceFileMembers;
|
126
125
|
getCallExpressionMeaning(node: tree.CallExpression): callExpressionMeaning.Meaning;
|
126
|
+
getCallExpressionType(node: tree.CallExpression): types.Type;
|
127
127
|
getRespectiveParameter(node: tree.Argument): MatchResultValueParameter | undefined;
|
128
128
|
resolveIndexedAccessExpression(node: tree.IndexedAccessExpression): indexedAccessExpressionMeaning.ResolutionResult;
|
129
129
|
getDereferenceExpressionMeaning(node: tree.DereferenceExpression): dereferenceExpressionMeaning.Meaning;
|
@@ -157,7 +157,7 @@ export declare class Analyzer {
|
|
157
157
|
* а?[1]
|
158
158
|
* а?^
|
159
159
|
* а?()
|
160
|
-
* (
|
160
|
+
* (а?.б)
|
161
161
|
* ```
|
162
162
|
*/
|
163
163
|
isExpressionOptionalChainingSyntactically(node: tree.Expression): boolean;
|
@@ -237,7 +237,7 @@ export declare class Analyzer {
|
|
237
237
|
isValueParameterVariadic(entity: e.VariableEntity): boolean;
|
238
238
|
getDefaultTypeParameterConstraint(): types.Type;
|
239
239
|
getOriginalSignatureTypeOfFunctionEntity(entity: e.FunctionEntity): types.FunctionType;
|
240
|
-
getFunctionBlockLiteralValueParameters(node: tree.FunctionBlockLiteral): readonly e.
|
240
|
+
getFunctionBlockLiteralValueParameters(node: tree.FunctionBlockLiteral): readonly e.ParameterVariableEntity[];
|
241
241
|
getExtendedType(node: tree.TypeExtensionDeclaration): WithDiagnostics<e.NamedTypeEntity>;
|
242
242
|
getAnalyzedTranslationPackageIfTargetResolved(package_: project.TranslationPackage): AnalyzedTranslationPackage | undefined;
|
243
243
|
getAnalyzedTranslationPackageForPackage(entity: e.PackageEntity, locale: PackageLocale): AnalyzedTranslationPackage | undefined;
|
@@ -265,9 +265,15 @@ export declare class Analyzer {
|
|
265
265
|
} | undefined;
|
266
266
|
getControlFlowGraph(sourceFile: project.SourceFile): controlFlow.GraphBuildResult;
|
267
267
|
createAmbiguousEntityAccessDiagnostic(entities: readonly WithLocalization<e.Entity>[], lctx: LocalizationContext, node: tree.Node): Diagnostic;
|
268
|
+
createAmbiguousEntityAccessLazyDiagnostic(entities: readonly WithLocalization<e.Entity>[], lctx: LocalizationContext, node: tree.Node): Lazy<Diagnostic>;
|
268
269
|
createAmbiguousFunctionAccessDiagnostic(functions: readonly WithLocalization<AccessedFunction>[], lctx: LocalizationContext, node: tree.Node): Diagnostic;
|
270
|
+
createAmbiguousFunctionAccessLazyDiagnostic(functions: readonly WithLocalization<AccessedFunction>[], lctx: LocalizationContext, node: tree.Node): Lazy<Diagnostic>;
|
269
271
|
createAmbiguousTypeMemberAccessDiagnostic(members: readonly WithLocalization<types.TypeMember>[], lctx: LocalizationContext, node: tree.Node): Diagnostic;
|
270
|
-
|
272
|
+
createAmbiguousTypeMemberAccessLazyDiagnostic(members: readonly WithLocalization<types.TypeMember>[], lctx: LocalizationContext, node: tree.Node): Lazy<Diagnostic>;
|
273
|
+
createAmbiguousNamedScopeDeclarationAccessDiagnostic(declarations: readonly WithLocalization<semanticContext.NamedDeclaration>[], lctx: LocalizationContext, node: tree.Node): Diagnostic;
|
274
|
+
createAmbiguousNamedScopeDeclarationAccessLazyDiagnostic(declarations: readonly WithLocalization<semanticContext.NamedDeclaration>[], lctx: LocalizationContext, node: tree.Node): Lazy<Diagnostic>;
|
275
|
+
addNodeDiagnosticComputedLazily(node: tree.Node, diagnostic: Diagnostic): void;
|
276
|
+
getDiagnosticsComputedLazily(sourceFile: project.SourceFile): readonly Diagnostic[];
|
271
277
|
private createTsInterop;
|
272
278
|
}
|
273
279
|
export declare class TsInteropInputs {
|
@@ -322,6 +328,7 @@ declare class Type {
|
|
322
328
|
private ofReferenceExpression;
|
323
329
|
private ofDereferenceExpression;
|
324
330
|
private ofWhenTernaryExpression;
|
331
|
+
private ofConditionalExpression;
|
325
332
|
private ofTextTemplateLiteral;
|
326
333
|
private ofIdentifierExpression;
|
327
334
|
private ofTokenExpression;
|
@@ -452,66 +459,10 @@ declare class ValueLocalVariableEntity {
|
|
452
459
|
private readonly _analyzer;
|
453
460
|
private readonly _entities;
|
454
461
|
constructor(_analyzer: Analyzer);
|
455
|
-
ofPackageVariableSetterDeclaration(node: tree.PackageVariableSetterDeclaration): e.
|
456
|
-
ofFieldSetterDeclaration(node: tree.FieldSetterDeclaration): e.
|
457
|
-
ofIndexedElementSetterDeclaration(node: tree.IndexedElementSetterDeclaration): e.
|
458
|
-
ofDereferencedVariableSetterDeclaration(node: tree.DereferencedVariableSetterDeclaration): e.
|
459
|
-
}
|
460
|
-
declare class Scope {
|
461
|
-
private readonly _analyzer;
|
462
|
-
private readonly _sourceFileScopes;
|
463
|
-
private readonly _functionBlockLiteralScopes;
|
464
|
-
private readonly _packageFunctionDeclarationTypeParametersScopes;
|
465
|
-
private readonly _packageFunctionDeclarationValueParametersScopes;
|
466
|
-
private readonly _structuredMethodDeclarationTypeParametersScopes;
|
467
|
-
private readonly _structuredMethodDeclarationValueParametersScopes;
|
468
|
-
private readonly _nestedFunctionDeclarationTypeParametersScopes;
|
469
|
-
private readonly _nestedFunctionDeclarationValueParametersScopes;
|
470
|
-
private readonly _functionLiteralScopes;
|
471
|
-
private readonly _functionBlockScopes;
|
472
|
-
private readonly _statementBlockScopes;
|
473
|
-
private readonly _forEachStatementScopes;
|
474
|
-
private readonly _catchClauseScopes;
|
475
|
-
private readonly _packageStructuredTypeDeclarationTypeParametersScopes;
|
476
|
-
private readonly _structuredTypeDeclarationBodyScopes;
|
477
|
-
private readonly _packageFunctionTypeDeclarationTypeParametersScopes;
|
478
|
-
private readonly _functionTypeDeclarationBodyScopes;
|
479
|
-
private readonly _packageVariantTypeDeclarationTypeParametersScopes;
|
480
|
-
private readonly _variantTypeDeclarationBodyScopes;
|
481
|
-
private readonly _aliasTypeDeclarationBodyScopes;
|
482
|
-
private readonly _packageAliasTypeDeclarationTypeParametersScopes;
|
483
|
-
private readonly _operatorDeclarationScopes;
|
484
|
-
private readonly _structuredConstructorDeclarationScopes;
|
485
|
-
private readonly _structuredDestructorDeclarationScopes;
|
486
|
-
private readonly _indexedElementAccessorDeclarationParametersScopes;
|
487
|
-
private readonly _typeExtensionDeclarationScopes;
|
488
|
-
constructor(_analyzer: Analyzer);
|
489
|
-
ofSourceFile(node: tree.SourceFile): scope.IScope;
|
490
|
-
ofFunctionBlockLiteral(node: tree.FunctionBlockLiteral): scope.IScope;
|
491
|
-
ofPackageFunctionDeclarationTypeParameters(node: tree.PackageFunctionDeclaration): scope.IScope;
|
492
|
-
ofPackageFunctionDeclarationValueParameters(node: tree.PackageFunctionDeclaration): scope.IScope;
|
493
|
-
ofMethodDeclarationTypeParameters(node: tree.MethodDeclaration): scope.IScope;
|
494
|
-
ofMethodDeclarationValueParameters(node: tree.MethodDeclaration): scope.IScope;
|
495
|
-
ofNestedFunctionDeclarationTypeParameters(node: tree.NestedFunctionDeclaration): scope.IScope;
|
496
|
-
ofNestedFunctionDeclarationValueParameters(node: tree.NestedFunctionDeclaration): scope.IScope;
|
497
|
-
ofFunctionLiteral(node: tree.FunctionLiteral): scope.IScope;
|
498
|
-
ofFunctionBlock(node: tree.FunctionBlock): scope.IScope;
|
499
|
-
ofStatementBlock(node: tree.StatementBlock): scope.IScope;
|
500
|
-
ofForStatement(node: tree.ForStatement): scope.IScope;
|
501
|
-
ofCatchClause(node: tree.CatchClause): scope.IScope;
|
502
|
-
ofPackageStructuredTypeDeclarationTypeParameters(node: tree.PackageStructuredTypeDeclaration): scope.IScope;
|
503
|
-
ofStructuredTypeDeclarationBody(node: tree.StructuredTypeDeclarationBody): scope.IScope;
|
504
|
-
ofPackageFunctionTypeDeclarationTypeParameters(node: tree.PackageFunctionTypeDeclaration): scope.IScope;
|
505
|
-
ofFunctionTypeDeclarationBody(node: tree.FunctionTypeDeclarationBody): scope.IScope;
|
506
|
-
ofPackageVariantTypeDeclarationTypeParameters(node: tree.PackageVariantTypeDeclaration): scope.IScope;
|
507
|
-
ofVariantTypeDeclarationBody(node: tree.VariantTypeDeclarationBody): scope.IScope;
|
508
|
-
ofAliasTypeDeclarationBody(node: tree.AliasTypeDeclarationBody): scope.IScope;
|
509
|
-
ofPackageAliasTypeDeclarationTypeParameters(node: tree.PackageAliasTypeDeclaration): scope.IScope;
|
510
|
-
ofOperatorDeclaration(node: tree.OperatorDeclaration): scope.IScope;
|
511
|
-
ofConstructorDeclaration(node: tree.ConstructorDeclaration): scope.IScope;
|
512
|
-
ofDestructorDeclaration(node: tree.DestructorDeclaration): scope.IScope;
|
513
|
-
ofIndexedElementAccessorDeclarationParameters(node: IndexedElementAccessorDeclaration): scope.IScope;
|
514
|
-
ofTypeExtensionDeclaration(node: tree.TypeExtensionDeclaration): scope.IScope;
|
462
|
+
ofPackageVariableSetterDeclaration(node: tree.PackageVariableSetterDeclaration): e.LocalVariableEntity;
|
463
|
+
ofFieldSetterDeclaration(node: tree.FieldSetterDeclaration): e.LocalVariableEntity;
|
464
|
+
ofIndexedElementSetterDeclaration(node: tree.IndexedElementSetterDeclaration): e.LocalVariableEntity;
|
465
|
+
ofDereferencedVariableSetterDeclaration(node: tree.DereferencedVariableSetterDeclaration): e.LocalVariableEntity;
|
515
466
|
}
|
516
467
|
declare class DefaultConstructors {
|
517
468
|
private readonly _analyzer;
|
@@ -662,10 +613,13 @@ export declare class TypeUtils {
|
|
662
613
|
private readonly _analyzer;
|
663
614
|
constructor(_analyzer: Analyzer);
|
664
615
|
getCommonObjectAndAspectTypesOfUnion(unionType: types.UnionType): readonly types.StructuredType[];
|
665
|
-
|
616
|
+
removeBaseTypesInPlace(types: types.Type[]): void;
|
617
|
+
removeDerivedTypesInPlace(types: types.Type[]): void;
|
618
|
+
private getBaseTypesForCommonTypesSearch;
|
666
619
|
private addTypeAndCollectAllBaseTypes;
|
667
620
|
private addTypeIfUnique;
|
668
|
-
private
|
621
|
+
private getFlattenedConstituentTypesForCommonTypesSearch;
|
622
|
+
private flattenTypeParameterConstraint;
|
669
623
|
}
|
670
624
|
export declare class ExpressionDenotesFunctionCheckResult {
|
671
625
|
readonly candidates: readonly WithLocalization<AccessedFunction>[];
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { Analyzer } from './Analyzer.js';
|
2
|
+
import * as controlFlow from './control-flow/index.js';
|
3
|
+
export declare class AssignmentChecker {
|
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
|
+
}
|
@@ -11,8 +11,10 @@ export declare class Resolver {
|
|
11
11
|
constructor(_analyzer: Analyzer, _node: CallExpression);
|
12
12
|
private get callee();
|
13
13
|
resolve(): Meaning;
|
14
|
+
resolveType(meaning: Meaning | undefined): types.Type;
|
14
15
|
private resolveConstructorCallExpressionMeaning;
|
15
16
|
private getNodeForDiagnostics;
|
17
|
+
private getTypeFromMeaning;
|
16
18
|
}
|
17
19
|
export type Meaning = Meaning_functionCall | Meaning_operatorCall | Meaning_objectFunctionCall | Meaning_constructorCall | Meaning_unresolved;
|
18
20
|
declare class Meaning_functionCall {
|
@@ -47,10 +47,11 @@ export declare class DiagnosticCollector {
|
|
47
47
|
private checkTypeMemberBodyPresence;
|
48
48
|
private tryGetTypeMemberDeclarationEntity;
|
49
49
|
private isAspectTypeMemberDeclaration;
|
50
|
-
private
|
51
|
-
private
|
50
|
+
private checkIdentifierExpression;
|
51
|
+
private checkLocalVariableUsedBeforeDeclaration;
|
52
|
+
private checkLocalVariableIsUsedBeforeBeingAssigned;
|
53
|
+
private checkMemberAccessExpression;
|
52
54
|
private addDiagnosticsFromMatchResult;
|
53
|
-
private checkStatementForVariablesUsedBeforeBeingAssigned;
|
54
55
|
private checkExpressionTypeAssignableToTargetType;
|
55
56
|
private addTypeAssignabilityDiagnosticIfBothTypesResolved;
|
56
57
|
private checkAssignmentIsValid;
|
@@ -75,4 +76,6 @@ export declare class DiagnosticCollector {
|
|
75
76
|
private checkIfVariableIsUnused;
|
76
77
|
private addDiagnostic;
|
77
78
|
private addDiagnostics;
|
79
|
+
private addMaybeLazyDiagnostic;
|
80
|
+
private addMaybeLazyDiagnostics;
|
78
81
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { AccessKind, Name } from '../common/index.js';
|
1
|
+
import { AccessKind, MaybeLazy, Name } from '../common/index.js';
|
2
2
|
import { Diagnostic } from '../diagnostic/Diagnostic.js';
|
3
3
|
import { NamedTypeEntity, PackageAliasEntity, VariableEntity } from '../entities/index.js';
|
4
4
|
import * as tree from '../tree/index.js';
|
@@ -6,8 +6,8 @@ import * as types from '../types/index.js';
|
|
6
6
|
import { AccessedFunction } from './AccessedFunction.js';
|
7
7
|
import { FoundAnonymousDeclaration, FoundNamedDeclaration } from './FoundDeclaration.js';
|
8
8
|
import { PackageNameTreeNode } from './ImportedPackageNameTree.js';
|
9
|
-
import * as scope from './Scope.js';
|
10
9
|
import { Analyzer, TargetTypeHint } from './index.js';
|
10
|
+
import { NamedDeclaration } from './semantic-context/index.js';
|
11
11
|
export declare class Resolver {
|
12
12
|
private readonly _semanticContext;
|
13
13
|
private readonly _analyzer;
|
@@ -23,12 +23,12 @@ export declare class Resolver {
|
|
23
23
|
}
|
24
24
|
export declare class ResolutionResult {
|
25
25
|
readonly meaning: Meaning;
|
26
|
-
readonly diagnostic?: Diagnostic | undefined;
|
26
|
+
readonly diagnostic?: MaybeLazy<Diagnostic> | undefined;
|
27
27
|
/**
|
28
28
|
* Может ли измениться результат, если посчитать его с другим целевым типом?
|
29
29
|
*/
|
30
30
|
readonly dependsOnTargetType: boolean;
|
31
|
-
constructor(meaning: Meaning, diagnostic?: Diagnostic | undefined,
|
31
|
+
constructor(meaning: Meaning, diagnostic?: MaybeLazy<Diagnostic> | undefined,
|
32
32
|
/**
|
33
33
|
* Может ли измениться результат, если посчитать его с другим целевым типом?
|
34
34
|
*/
|
@@ -73,9 +73,9 @@ declare class Meaning_typeAccess {
|
|
73
73
|
constructor(candidates: readonly FoundNamedDeclaration<NamedTypeEntity>[], suitableTypes: readonly FoundNamedDeclaration<types.Type>[]);
|
74
74
|
}
|
75
75
|
declare class Meaning_mixedAmbiguousAccess {
|
76
|
-
readonly declarations: readonly FoundNamedDeclaration<
|
76
|
+
readonly declarations: readonly FoundNamedDeclaration<NamedDeclaration>[];
|
77
77
|
readonly kind = "mixed-ambiguous-access";
|
78
|
-
constructor(declarations: readonly FoundNamedDeclaration<
|
78
|
+
constructor(declarations: readonly FoundNamedDeclaration<NamedDeclaration>[]);
|
79
79
|
}
|
80
80
|
declare class Meaning_unresolved {
|
81
81
|
readonly kind = "unresolved";
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { AccessKind } from '../common/index.js';
|
1
|
+
import { AccessKind, MaybeLazy } from '../common/index.js';
|
2
2
|
import { Diagnostic } from '../diagnostic/Diagnostic.js';
|
3
3
|
import { IndexedAccessExpression } from '../tree/index.js';
|
4
4
|
import * as types from '../types/index.js';
|
@@ -16,8 +16,8 @@ export declare class Resolver {
|
|
16
16
|
}
|
17
17
|
export declare class ResolutionResult {
|
18
18
|
readonly meaning: Meaning;
|
19
|
-
readonly diagnostic?: Diagnostic | undefined;
|
20
|
-
constructor(meaning: Meaning, diagnostic?: Diagnostic | undefined);
|
19
|
+
readonly diagnostic?: MaybeLazy<Diagnostic> | undefined;
|
20
|
+
constructor(meaning: Meaning, diagnostic?: MaybeLazy<Diagnostic> | undefined);
|
21
21
|
}
|
22
22
|
export type Meaning = Meaning_resolved | Meaning_unresolved;
|
23
23
|
declare class Meaning_resolved {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { AccessKind } from '../common/index.js';
|
1
|
+
import { AccessKind, MaybeLazy } from '../common/index.js';
|
2
2
|
import { Diagnostic } from '../diagnostic/Diagnostic.js';
|
3
3
|
import { Entity, PackageTypeEntity, PackageVariableEntity } from '../entities/index.js';
|
4
4
|
import * as tree from '../tree/index.js';
|
@@ -6,8 +6,8 @@ import * as types from '../types/index.js';
|
|
6
6
|
import { AccessedFunction } from './AccessedFunction.js';
|
7
7
|
import { FoundAnonymousDeclaration, FoundNamedDeclaration } from './FoundDeclaration.js';
|
8
8
|
import { PackageNameTreeNode } from './ImportedPackageNameTree.js';
|
9
|
-
import { WithLocalization } from './Localization.js';
|
10
9
|
import { Analyzer, TargetTypeHint } from './index.js';
|
10
|
+
import { WithLocalization } from './Localization.js';
|
11
11
|
export declare class Resolver {
|
12
12
|
private readonly _semanticContext;
|
13
13
|
private readonly _analyzer;
|
@@ -31,18 +31,18 @@ export declare class Resolver {
|
|
31
31
|
}
|
32
32
|
export declare class ResolutionResult {
|
33
33
|
readonly meaning: Meaning;
|
34
|
-
readonly diagnostic?: Diagnostic | undefined;
|
34
|
+
readonly diagnostic?: MaybeLazy<Diagnostic> | undefined;
|
35
35
|
/**
|
36
36
|
* Может ли измениться результат, если посчитать его с другим целевым типом?
|
37
37
|
*/
|
38
38
|
readonly dependsOnTargetType: boolean;
|
39
|
-
constructor(meaning: Meaning, diagnostic?: Diagnostic | undefined,
|
39
|
+
constructor(meaning: Meaning, diagnostic?: MaybeLazy<Diagnostic> | undefined,
|
40
40
|
/**
|
41
41
|
* Может ли измениться результат, если посчитать его с другим целевым типом?
|
42
42
|
*/
|
43
43
|
dependsOnTargetType?: boolean);
|
44
44
|
}
|
45
|
-
export type Meaning = Meaning_packageVariableAccess | Meaning_packageFunctionAccess | Meaning_packageTypeAccess | Meaning_packageNameSegmentAccess |
|
45
|
+
export type Meaning = Meaning_packageVariableAccess | Meaning_packageFunctionAccess | Meaning_packageTypeAccess | Meaning_packageNameSegmentAccess | Meaning_staticFieldAccess | Meaning_staticMethodAccess | Meaning_instanceFieldAccess | Meaning_instanceMethodAccess | Meaning_operatorAccess | Meaning_mixedAmbiguousAccess | Meaning_unresolved;
|
46
46
|
declare class Meaning_packageVariableAccess {
|
47
47
|
readonly variable: FoundNamedDeclaration<PackageVariableEntity>;
|
48
48
|
readonly accessKind: AccessKind;
|
@@ -68,11 +68,11 @@ declare class Meaning_packageNameSegmentAccess {
|
|
68
68
|
readonly kind = "package-name-segment-access";
|
69
69
|
constructor(packageTreeNode: PackageNameTreeNode);
|
70
70
|
}
|
71
|
-
declare class
|
71
|
+
declare class Meaning_staticFieldAccess {
|
72
72
|
readonly type: types.Type;
|
73
73
|
readonly variable: FoundNamedDeclaration<types.Variable>;
|
74
74
|
readonly accessKind: AccessKind;
|
75
|
-
readonly kind = "static-
|
75
|
+
readonly kind = "static-field-access";
|
76
76
|
constructor(type: types.Type, variable: FoundNamedDeclaration<types.Variable>, accessKind: AccessKind);
|
77
77
|
}
|
78
78
|
declare class Meaning_staticMethodAccess {
|
@@ -83,10 +83,10 @@ declare class Meaning_staticMethodAccess {
|
|
83
83
|
get singleSuitableFunction(): FoundNamedDeclaration<AccessedFunction> | undefined;
|
84
84
|
constructor(type: types.Type, candidates: readonly FoundNamedDeclaration<AccessedFunction>[], suitableFunctions: readonly FoundNamedDeclaration<AccessedFunction>[]);
|
85
85
|
}
|
86
|
-
declare class
|
86
|
+
declare class Meaning_instanceFieldAccess {
|
87
87
|
readonly variable: FoundNamedDeclaration<types.Variable>;
|
88
88
|
readonly accessKind: AccessKind;
|
89
|
-
readonly kind = "instance-
|
89
|
+
readonly kind = "instance-field-access";
|
90
90
|
constructor(variable: FoundNamedDeclaration<types.Variable>, accessKind: AccessKind);
|
91
91
|
}
|
92
92
|
declare class Meaning_instanceMethodAccess {
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { MaybeLazy } from '../common/index.js';
|
1
2
|
import { Diagnostic } from '../diagnostic/Diagnostic.js';
|
2
3
|
import { NamedTypeEntity, PackageAliasEntity } from '../entities/index.js';
|
3
4
|
import { QualifiedName } from '../tree/index.js';
|
@@ -23,9 +24,9 @@ export declare class NamedTypeResolver {
|
|
23
24
|
export declare class NamedTypeResolutionResult {
|
24
25
|
readonly types: readonly FoundNamedDeclaration<NamedTypeEntity>[];
|
25
26
|
readonly resolvedQualifiers: readonly ResolvedQualifier[];
|
26
|
-
readonly diagnostics: readonly Diagnostic[];
|
27
|
+
readonly diagnostics: readonly MaybeLazy<Diagnostic>[];
|
27
28
|
readonly ambiguousDeclarations: readonly WithLocalization<EntityOrPackageNameTreeNode>[] | undefined;
|
28
|
-
constructor(types: readonly FoundNamedDeclaration<NamedTypeEntity>[], resolvedQualifiers: readonly ResolvedQualifier[], diagnostics: readonly Diagnostic[], ambiguousDeclarations: readonly WithLocalization<EntityOrPackageNameTreeNode>[] | undefined);
|
29
|
+
constructor(types: readonly FoundNamedDeclaration<NamedTypeEntity>[], resolvedQualifiers: readonly ResolvedQualifier[], diagnostics: readonly MaybeLazy<Diagnostic>[], ambiguousDeclarations: readonly WithLocalization<EntityOrPackageNameTreeNode>[] | undefined);
|
29
30
|
}
|
30
31
|
export type ResolvedQualifier = ResolvedQualifier_packageNameSegment | ResolvedQualifier_packageAlias | ResolvedQualifier_type;
|
31
32
|
export declare class ResolvedQualifier_packageNameSegment {
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { MaybeLazy } from '../common/index.js';
|
1
2
|
import { Diagnostic } from '../diagnostic/Diagnostic.js';
|
2
3
|
import { NamedTypeSpecifier } from '../tree/index.js';
|
3
4
|
import * as types from '../types/index.js';
|
@@ -16,7 +17,7 @@ export declare class NamedTypeSpecifierResolver {
|
|
16
17
|
export declare class NamedTypeSpecifierResolutionResult {
|
17
18
|
readonly type: FoundNamedDeclaration<types.Type> | undefined;
|
18
19
|
readonly resolvedQualifiers: readonly ResolvedQualifier[];
|
19
|
-
readonly diagnostics: readonly Diagnostic[];
|
20
|
+
readonly diagnostics: readonly MaybeLazy<Diagnostic>[];
|
20
21
|
readonly ambiguousDeclarations: readonly WithLocalization<EntityOrPackageNameTreeNode>[] | undefined;
|
21
|
-
constructor(type: FoundNamedDeclaration<types.Type> | undefined, resolvedQualifiers: readonly ResolvedQualifier[], diagnostics: readonly Diagnostic[], ambiguousDeclarations: readonly WithLocalization<EntityOrPackageNameTreeNode>[] | undefined);
|
22
|
+
constructor(type: FoundNamedDeclaration<types.Type> | undefined, resolvedQualifiers: readonly ResolvedQualifier[], diagnostics: readonly MaybeLazy<Diagnostic>[], ambiguousDeclarations: readonly WithLocalization<EntityOrPackageNameTreeNode>[] | undefined);
|
22
23
|
}
|
@@ -12,7 +12,6 @@ export declare class NodeTypeUtils {
|
|
12
12
|
static isFunctionDeclaration(node: tree.Node): node is FunctionDeclaration;
|
13
13
|
static isVariableDeclaration(node: tree.Node): node is VariableDeclaration;
|
14
14
|
static isVariantTypeDeclaration(node: tree.Node): node is VariantTypeDeclaration;
|
15
|
-
static isSubprogramDeclaration(node: tree.Node): node is SubprogramDeclaration;
|
16
15
|
static isNoneLiteral(node: tree.Node): boolean;
|
17
16
|
}
|
18
17
|
export type PackageTypeDeclaration = tree.PackageAliasTypeDeclaration | tree.PackageFunctionTypeDeclaration | tree.PackageStructuredTypeDeclaration | tree.PackageVariantTypeDeclaration;
|
@@ -29,4 +28,6 @@ export type PackageVariableAccessorDeclaration = tree.PackageVariableGetterDecla
|
|
29
28
|
export type FieldAccessorDeclaration = tree.FieldGetterDeclaration | tree.FieldSetterDeclaration;
|
30
29
|
export type IndexedElementAccessorDeclaration = tree.IndexedElementGetterDeclaration | tree.IndexedElementSetterDeclaration;
|
31
30
|
export type DereferencedVariableAccessorDeclaration = tree.DereferencedVariableGetterDeclaration | tree.DereferencedVariableSetterDeclaration;
|
32
|
-
export type SubprogramDeclaration = tree.FunctionBlockParent
|
31
|
+
export type SubprogramDeclaration = tree.FunctionBlockParent;
|
32
|
+
export type RegularOrBlockFunctionLiteral = tree.FunctionLiteral | tree.FunctionBlockLiteral;
|
33
|
+
export type SubprogramDeclarationOrLiteral = SubprogramDeclaration | RegularOrBlockFunctionLiteral;
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { MaybeLazy } from '../common/index.js';
|
1
2
|
import { Diagnostic } from '../diagnostic/Diagnostic.js';
|
2
3
|
import { FunctionEntity, NamedTypeEntity, PackageAliasEntity } from '../entities/index.js';
|
3
4
|
import { Tag } from '../tree/index.js';
|
@@ -26,9 +27,9 @@ export declare class Resolver {
|
|
26
27
|
export declare class ResolutionResult {
|
27
28
|
readonly meaning: Meaning;
|
28
29
|
readonly resolvedQualifiers: readonly ResolvedQualifier[];
|
29
|
-
readonly diagnostic?: Diagnostic | undefined;
|
30
|
+
readonly diagnostic?: MaybeLazy<Diagnostic> | undefined;
|
30
31
|
readonly ambiguousDeclarations?: readonly WithLocalization<EntityOrPackageNameTreeNode>[] | undefined;
|
31
|
-
constructor(meaning: Meaning, resolvedQualifiers: readonly ResolvedQualifier[], diagnostic?: Diagnostic | undefined, ambiguousDeclarations?: readonly WithLocalization<EntityOrPackageNameTreeNode>[] | undefined);
|
32
|
+
constructor(meaning: Meaning, resolvedQualifiers: readonly ResolvedQualifier[], diagnostic?: MaybeLazy<Diagnostic> | undefined, ambiguousDeclarations?: readonly WithLocalization<EntityOrPackageNameTreeNode>[] | undefined);
|
32
33
|
}
|
33
34
|
export type Meaning = Meaning_tagType | Meaning_tagFunction | Meaning_unresolved;
|
34
35
|
declare class Meaning_tagType {
|
@@ -4,7 +4,7 @@ import * as types from '../types/index.js';
|
|
4
4
|
import { Analyzer } from './Analyzer.js';
|
5
5
|
import { FoundAnonymousDeclaration, FoundNamedDeclaration } from './FoundDeclaration.js';
|
6
6
|
import { LocalizationContext } from './LocalizationContext.js';
|
7
|
-
import {
|
7
|
+
import { SemanticContext } from './semantic-context/SemanticContext.js';
|
8
8
|
export declare class TypeMemberLookup {
|
9
9
|
private readonly _analyzer;
|
10
10
|
private readonly _typeOrExtension;
|
@@ -19,13 +19,13 @@ export declare class TypeMemberLookup {
|
|
19
19
|
static ofTypeEntity(analyzer: Analyzer, entity: TypeEntity, localizationContext: LocalizationContext | undefined): TypeMemberLookup;
|
20
20
|
static ofTypeExtension(analyzer: Analyzer, typeExtension: TypeExtensionEntity, localizationContext: LocalizationContext | undefined): TypeMemberLookup;
|
21
21
|
static ofTypeOrExtension(analyzer: Analyzer, typeOrExtension: TypeOrExtension, localizationContext: LocalizationContext | undefined): TypeMemberLookup;
|
22
|
-
getNamedMembers(options?: TypeMemberLookupOptions, hidingMatcher?: IEntityHidingMatcher,
|
23
|
-
getNamedMembersByName(name: SearchName, options?: TypeMemberLookupOptions, hidingMatcher?: IEntityHidingMatcher,
|
24
|
-
getOperators(options?: TypeMemberLookupOptions, hidingMatcher?: IEntityHidingMatcher,
|
25
|
-
getOperatorsByKind(kind: OperatorKind, options?: TypeMemberLookupOptions, hidingMatcher?: IEntityHidingMatcher,
|
26
|
-
getConstructors(hidingMatcher?: IEntityHidingMatcher,
|
27
|
-
getIndexers(options?: TypeMemberLookupOptions, hidingMatcher?: IEntityHidingMatcher,
|
28
|
-
getDereferenceOperators(options?: TypeMemberLookupOptions, hidingMatcher?: IEntityHidingMatcher,
|
22
|
+
getNamedMembers(options?: TypeMemberLookupOptions, hidingMatcher?: IEntityHidingMatcher, typeExtensionLookup?: SemanticContext): readonly FoundNamedDeclaration<types.NamedTypeMember>[];
|
23
|
+
getNamedMembersByName(name: SearchName, options?: TypeMemberLookupOptions, hidingMatcher?: IEntityHidingMatcher, typeExtensionLookup?: SemanticContext): readonly FoundNamedDeclaration<types.NamedTypeMember>[];
|
24
|
+
getOperators(options?: TypeMemberLookupOptions, hidingMatcher?: IEntityHidingMatcher, typeExtensionLookup?: SemanticContext): readonly FoundAnonymousDeclaration<types.Operator>[];
|
25
|
+
getOperatorsByKind(kind: OperatorKind, options?: TypeMemberLookupOptions, hidingMatcher?: IEntityHidingMatcher, typeExtensionLookup?: SemanticContext): readonly FoundAnonymousDeclaration<types.Operator>[];
|
26
|
+
getConstructors(hidingMatcher?: IEntityHidingMatcher, typeExtensionLookup?: SemanticContext): readonly FoundAnonymousDeclaration<types.Constructor>[];
|
27
|
+
getIndexers(options?: TypeMemberLookupOptions, hidingMatcher?: IEntityHidingMatcher, typeExtensionLookup?: SemanticContext): readonly FoundAnonymousDeclaration<types.Indexer>[];
|
28
|
+
getDereferenceOperators(options?: TypeMemberLookupOptions, hidingMatcher?: IEntityHidingMatcher, typeExtensionLookup?: SemanticContext): readonly FoundAnonymousDeclaration<types.DereferenceOperator>[];
|
29
29
|
private getLocaleOfTypeEntity;
|
30
30
|
}
|
31
31
|
export declare class BoundTypeMemberLookup {
|
@@ -34,9 +34,9 @@ export declare class BoundTypeMemberLookup {
|
|
34
34
|
private readonly _hidingMatcher;
|
35
35
|
private readonly _typeExtensionLookup;
|
36
36
|
private constructor();
|
37
|
-
static ofType(analyzer: Analyzer, type: types.Type, localizationContext: LocalizationContext | undefined, options: TypeMemberLookupOptions | undefined, hidingMatcher: IEntityHidingMatcher | undefined, typeExtensionLookup:
|
38
|
-
static ofTypeEntity(analyzer: Analyzer, entity: TypeEntity, localizationContext: LocalizationContext | undefined, options: TypeMemberLookupOptions | undefined, hidingMatcher: IEntityHidingMatcher | undefined, typeExtensionLookup:
|
39
|
-
static ofTypeExtension(analyzer: Analyzer, typeExtension: TypeExtensionEntity, localizationContext: LocalizationContext | undefined, options: TypeMemberLookupOptions | undefined, hidingMatcher: IEntityHidingMatcher | undefined, typeExtensionLookup:
|
37
|
+
static ofType(analyzer: Analyzer, type: types.Type, localizationContext: LocalizationContext | undefined, options: TypeMemberLookupOptions | undefined, hidingMatcher: IEntityHidingMatcher | undefined, typeExtensionLookup: SemanticContext | undefined): BoundTypeMemberLookup;
|
38
|
+
static ofTypeEntity(analyzer: Analyzer, entity: TypeEntity, localizationContext: LocalizationContext | undefined, options: TypeMemberLookupOptions | undefined, hidingMatcher: IEntityHidingMatcher | undefined, typeExtensionLookup: SemanticContext | undefined): BoundTypeMemberLookup;
|
39
|
+
static ofTypeExtension(analyzer: Analyzer, typeExtension: TypeExtensionEntity, localizationContext: LocalizationContext | undefined, options: TypeMemberLookupOptions | undefined, hidingMatcher: IEntityHidingMatcher | undefined, typeExtensionLookup: SemanticContext | undefined): BoundTypeMemberLookup;
|
40
40
|
getNamedMembers(): readonly FoundNamedDeclaration<types.NamedTypeMember>[];
|
41
41
|
getNamedMembersByName(name: SearchName): readonly FoundNamedDeclaration<types.NamedTypeMember>[];
|
42
42
|
getOperators(): readonly FoundAnonymousDeclaration<types.Operator>[];
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { LocalVariableEntity, PackageVariableEntity, ParameterVariableEntity } from '../entities/VariableEntity.js';
|
2
1
|
import * as types from '../types/index.js';
|
3
2
|
import { Analyzer } from './Analyzer.js';
|
4
3
|
import * as controlFlow from './control-flow/index.js';
|
@@ -26,72 +25,4 @@ export declare class TypeNarrower {
|
|
26
25
|
private checkIfVariableIsAssignedInLoop;
|
27
26
|
private checkIfVariableIsAssignedAtNode;
|
28
27
|
private isSameReferenceAsNarrowedExpression;
|
29
|
-
private getReferenceAtNodeIfNarrowable;
|
30
|
-
private getReferenceAtNode;
|
31
|
-
private getReferenceAtLocalVariableDeclaration;
|
32
|
-
}
|
33
|
-
export type NarrowableReference = NarrowableReference.LocalVariable | NarrowableReference.PackageVariable | NarrowableReference.ObjectField | NarrowableReference.StaticField | NarrowableReference.ObjectAutoVariable;
|
34
|
-
export declare namespace NarrowableReference {
|
35
|
-
export class LocalVariable implements INarrowableReference {
|
36
|
-
private readonly _analyzer;
|
37
|
-
readonly entity: LocalVariableEntity | ParameterVariableEntity;
|
38
|
-
readonly kind = "local-variable";
|
39
|
-
constructor(_analyzer: Analyzer, entity: LocalVariableEntity | ParameterVariableEntity);
|
40
|
-
equals(other: NarrowableReference): boolean;
|
41
|
-
contains(_other: NarrowableReference): boolean;
|
42
|
-
equalsExpression(expression: controlFlow.NarrowableReferenceExpression): boolean;
|
43
|
-
containsExpression(_expression: controlFlow.NarrowableReferenceExpression): boolean;
|
44
|
-
}
|
45
|
-
export class PackageVariable implements INarrowableReference {
|
46
|
-
private readonly _analyzer;
|
47
|
-
readonly entity: PackageVariableEntity;
|
48
|
-
readonly kind = "package-variable";
|
49
|
-
constructor(_analyzer: Analyzer, entity: PackageVariableEntity);
|
50
|
-
equals(other: NarrowableReference): boolean;
|
51
|
-
contains(_other: NarrowableReference): boolean;
|
52
|
-
equalsExpression(expression: controlFlow.NarrowableReferenceExpression): boolean;
|
53
|
-
containsExpression(_expression: controlFlow.NarrowableReferenceExpression): boolean;
|
54
|
-
}
|
55
|
-
export class ObjectField implements INarrowableReference {
|
56
|
-
private readonly _analyzer;
|
57
|
-
readonly variable: types.Variable;
|
58
|
-
readonly receiver: NarrowableReference;
|
59
|
-
readonly kind = "object-field";
|
60
|
-
constructor(_analyzer: Analyzer, variable: types.Variable, receiver: NarrowableReference);
|
61
|
-
equals(other: NarrowableReference): boolean;
|
62
|
-
contains(other: NarrowableReference): boolean;
|
63
|
-
equalsExpression(expression: controlFlow.NarrowableReferenceExpression): boolean;
|
64
|
-
containsExpression(expression: controlFlow.NarrowableReferenceExpression): boolean;
|
65
|
-
}
|
66
|
-
export class StaticField implements INarrowableReference {
|
67
|
-
private readonly _analyzer;
|
68
|
-
readonly variable: types.Variable;
|
69
|
-
readonly kind = "static-field";
|
70
|
-
constructor(_analyzer: Analyzer, variable: types.Variable);
|
71
|
-
equals(other: NarrowableReference): boolean;
|
72
|
-
contains(_other: NarrowableReference): boolean;
|
73
|
-
equalsExpression(expression: controlFlow.NarrowableReferenceExpression): boolean;
|
74
|
-
containsExpression(_expression: controlFlow.NarrowableReferenceExpression): boolean;
|
75
|
-
}
|
76
|
-
export class ObjectAutoVariable implements INarrowableReference {
|
77
|
-
readonly kind = "object-auto-variable";
|
78
|
-
equals(other: NarrowableReference): boolean;
|
79
|
-
contains(_other: NarrowableReference): boolean;
|
80
|
-
equalsExpression(expression: controlFlow.NarrowableReferenceExpression): boolean;
|
81
|
-
containsExpression(_expression: controlFlow.NarrowableReferenceExpression): boolean;
|
82
|
-
}
|
83
|
-
interface INarrowableReference {
|
84
|
-
equals(other: NarrowableReference): boolean;
|
85
|
-
contains(other: NarrowableReference): boolean;
|
86
|
-
/**
|
87
|
-
* Отличается от метода `equals` тем, что выполняет сравнение лениво. Например, при сравнении с выражением
|
88
|
-
* `а.б` сперва будут сравнены части слева от точки (выражение `а` с `receiver`), и только при равенстве будет
|
89
|
-
* связано и сравнено имя `б`. Если выражение `а` не равно `receiver`, то сразу будет возвращено `false` и
|
90
|
-
* связывание для имени `б` выполняться не будет. Такое поведение необходимо при анализе циклов,
|
91
|
-
* чтобы избежать рекурсии.
|
92
|
-
*/
|
93
|
-
equalsExpression(expression: controlFlow.NarrowableReferenceExpression): boolean;
|
94
|
-
containsExpression(expression: controlFlow.NarrowableReferenceExpression): boolean;
|
95
|
-
}
|
96
|
-
export {};
|
97
28
|
}
|
@@ -28,6 +28,7 @@ export declare class GraphBuilder {
|
|
28
28
|
private visitErrorStatement;
|
29
29
|
private visitLocalVariableDeclaration;
|
30
30
|
private visitWhenTernaryExpression;
|
31
|
+
private visitConditionalExpression;
|
31
32
|
private visitCondition;
|
32
33
|
private visitBinaryExpression;
|
33
34
|
private visitPrefixUnaryExpressionInCondition;
|