@artel/artc 0.6.25264 → 0.6.25266
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 +8 -10
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +327 -341
- package/build/{chunk-3V2UPAG3.js → chunk-2Y343AG7.js} +1 -1
- package/build/{chunk-WTJNZUBE.js → chunk-4YMBG4SM.js} +3664 -2958
- package/build/{chunk-26UG42AZ.js → chunk-MHMPJB2Y.js} +2 -2
- package/build/types/analysis/AnalyzedTextTranslationPackage.d.ts +21 -0
- package/build/types/analysis/Analyzer.d.ts +15 -9
- package/build/types/analysis/DiagnosticCollector.d.ts +2 -0
- package/build/types/analysis/control-flow/NarrowableReference.d.ts +3 -3
- package/build/types/analysis/semantic-context/SemanticContext.d.ts +2 -3
- package/build/types/analysis/semantic-context/SemanticContextBase.d.ts +11 -1
- package/build/types/analysis/semantic-context/SemanticContextBuilder.d.ts +10 -10
- package/build/types/analysis/semantic-context/SemanticContextValidatingNameConflicts.d.ts +7 -7
- package/build/types/analysis/semantic-context/SpecialLocalDeclarationsBuilder.d.ts +1 -0
- package/build/types/analysis/semantic-context/SubprogramBodyAndParametersSemanticContext.d.ts +34 -12
- package/build/types/analysis/semantic-context/SubprogramSemanticContext.d.ts +9 -0
- package/build/types/common/Query.d.ts +1 -0
- package/build/types/diagnostic/DiagnosticCode.d.ts +1 -0
- package/build/types/emitter/EmitPhaseName.d.ts +3 -0
- package/build/types/emitter/Emitter.d.ts +1 -2
- package/build/types/emitter/EmitterContext.d.ts +1 -0
- package/build/types/emitter/Entities.d.ts +5 -0
- package/build/types/emitter/GeneralLowering.d.ts +1 -2
- package/build/types/emitter/IrBuilder.d.ts +5 -3
- package/build/types/emitter/IrFactory.d.ts +118 -0
- package/build/types/emitter/Transformer.d.ts +0 -2
- package/build/types/emitter/ir/Nodes.d.ts +328 -323
- package/build/types/emitter/ir/types.d.ts +2 -2
- package/build/types/entities/PackageEntity.d.ts +14 -3
- package/build/types/entities/StructuredTypeEntity.d.ts +1 -0
- package/build/types/entities/TextTranslationEntity.d.ts +45 -0
- package/build/types/entities/VariableEntity.d.ts +7 -16
- package/build/types/entities/index.d.ts +4 -4
- package/build/types/entities/translated/TranslatedPackageEntity.d.ts +3 -2
- package/build/types/parser/TokenKind.d.ts +56 -55
- package/build/types/parser/UnescapeText.d.ts +1 -0
- package/build/types/project/SourcePackage.d.ts +7 -3
- package/build/types/project/configuration/ConfigurationConverter.d.ts +3 -0
- package/build/types/project/configuration/types/PackageConfigurationEn.d.ts +3 -0
- package/build/types/project/configuration/types/PackageConfigurationRu.d.ts +3 -0
- package/build/types/services/DisplayService.d.ts +1 -1
- package/build/types/services/NodeSemanticInfo.d.ts +8 -2
- package/build/types/tree/NodeKind.d.ts +21 -20
- package/build/types/tree/Nodes.d.ts +45 -18
- package/build/types/tree/Token.d.ts +4 -1
- package/build/types/ts-interop/Entities.d.ts +5 -3
- package/build/types/ts-interop/TsInteropContext.d.ts +3 -2
- package/package.json +1 -1
- package/build/types/analysis/semantic-context/TranslationTextTemplateSemanticContext.d.ts +0 -13
- package/build/types/entities/LocalizableTextEntity.d.ts +0 -80
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Compiler
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2Y343AG7.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-4YMBG4SM.js";
|
|
18
18
|
|
|
19
19
|
// source/executor/FileSystemUri.ts
|
|
20
20
|
import { platform } from "os";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PackageLocale } from '../common/index.js';
|
|
2
|
+
import { PackageEntity } from '../entities/PackageEntity.js';
|
|
3
|
+
import { TextTranslationEntity, TextTranslationEntityKey } from '../entities/TextTranslationEntity.js';
|
|
4
|
+
import { PackageName, TextTranslationPackage } from '../project/index.js';
|
|
5
|
+
import { Analyzer } from './Analyzer.js';
|
|
6
|
+
export declare class AnalyzedTextTranslationPackage {
|
|
7
|
+
private readonly analyzer;
|
|
8
|
+
private readonly package_;
|
|
9
|
+
private readonly targetPackage;
|
|
10
|
+
private readonly entitiesByTextKey;
|
|
11
|
+
constructor(analyzer: Analyzer, package_: TextTranslationPackage, targetPackage: PackageEntity);
|
|
12
|
+
isPrimary(): boolean;
|
|
13
|
+
getTargetPackage(): PackageEntity;
|
|
14
|
+
getDefinition(): TextTranslationPackage;
|
|
15
|
+
getTargetPackageName(): PackageName;
|
|
16
|
+
getTranslationLocale(): PackageLocale;
|
|
17
|
+
getEntitiesByTextKey(textKey: TextTranslationEntityKey): readonly TextTranslationEntity[] | undefined;
|
|
18
|
+
private createEntitiesByTextKey;
|
|
19
|
+
private enumerableTextTranslationDeclarations;
|
|
20
|
+
private enumerableTranslationsDeclarations;
|
|
21
|
+
}
|
|
@@ -4,7 +4,6 @@ import { Diagnostic, DiagnosticAcceptor, DiagnosticLocation } from '../diagnosti
|
|
|
4
4
|
import { DiagnosticCode } from '../diagnostic/DiagnosticCode.js';
|
|
5
5
|
import { DiagnosticFlags, DiagnosticKind } from '../diagnostic/DiagnosticData.js';
|
|
6
6
|
import { BinaryOperatorKind } from '../entities/OperatorKind.js';
|
|
7
|
-
import { PackageEntityMembers } from '../entities/PackageMembers.js';
|
|
8
7
|
import * as e from '../entities/index.js';
|
|
9
8
|
import { ReservedIdentifierKind } from '../parser/ReservedIdentifierDictionary.js';
|
|
10
9
|
import * as project from '../project/index.js';
|
|
@@ -15,6 +14,7 @@ import * as types from '../types/index.js';
|
|
|
15
14
|
import { TypeFactory } from '../types/index.js';
|
|
16
15
|
import { AccessedFunction } from './AccessedFunction.js';
|
|
17
16
|
import { AnalyzedTranslationPackage } from './AnalyzedTranslationPackage.js';
|
|
17
|
+
import { AnalyzedTextTranslationPackage } from './AnalyzedTextTranslationPackage.js';
|
|
18
18
|
import { ArgumentToParameterMatchResult, MatchResultParameter } from './ArgumentToParameterMatchResult.js';
|
|
19
19
|
import * as autotypeCallExpressionMeaning from './AutotypeCallExpressionMeaning.js';
|
|
20
20
|
import * as baseExpressionMeaning from './BaseExpressionMeaning.js';
|
|
@@ -31,7 +31,7 @@ import { NamedTypeSpecifierResolutionResult } from './NamedTypeSpecifierResolver
|
|
|
31
31
|
import { DereferencedVariableAccessorDeclaration, FieldAccessorDeclaration, FunctionDeclaration, FunctionTypeDeclaration, GetterDeclaration, IndexedElementAccessorDeclaration, PackageVariableAccessorDeclaration, RegularOrBlockFunctionLiteral, SetterDeclaration, StructuredTypeDeclaration, TypeDeclaration, TypeWithMembersDeclaration, VariantTypeDeclaration } from './NodeTypeUtils.js';
|
|
32
32
|
import * as objectExpressionMeaning from './ObjectExpressionMeaning.js';
|
|
33
33
|
import { OwnAndBaseConstructorCallsCheckResult } from './OwnAndBaseConstructorCallsChecker.js';
|
|
34
|
-
import { SourceFileMembers
|
|
34
|
+
import { SourceFileMembers } from './SourceFileMembers.js';
|
|
35
35
|
import * as tagMeaning from './TagMeaning.js';
|
|
36
36
|
import * as tags from './Tags.js';
|
|
37
37
|
import { TypeMemberImplementationCheckResult } from './TypeMemberImplementationChecker.js';
|
|
@@ -94,6 +94,8 @@ export declare class Analyzer {
|
|
|
94
94
|
private readonly parametersOfFunctionBlockLiterals;
|
|
95
95
|
private readonly extendedTypes;
|
|
96
96
|
private readonly analyzedTranslationPackages;
|
|
97
|
+
private readonly analyzedTextTranslationPackages;
|
|
98
|
+
private textTranslationPackagesMap;
|
|
97
99
|
private readonly linkedMultiPlatformPackagesByPlatform;
|
|
98
100
|
private readonly isFunctionGeneratorCheckResults;
|
|
99
101
|
private readonly namedDeclarationsUsageCountResults;
|
|
@@ -133,7 +135,7 @@ export declare class Analyzer {
|
|
|
133
135
|
resolveMemberAccessExpressionFirstStage(node: tree.MemberAccessExpression): memberAccessExpressionResolution.FirstStageResolutionResult;
|
|
134
136
|
resolveMemberAccessExpression(node: tree.MemberAccessExpression, analysisOptions?: ExpressionAnalysisOptions): memberAccessExpressionResolution.ResolutionResult;
|
|
135
137
|
enumeratePackageImports(packageImportDirectives: Iterable<tree.PackageImportDirective>): Iterable<tree.PackageImport>;
|
|
136
|
-
getSourceFileMembers(node: tree.SourceFile):
|
|
138
|
+
getSourceFileMembers(node: tree.SourceFile): SourceFileMembers;
|
|
137
139
|
resolveCallExpression(node: tree.CallExpression, analysisOptions?: ExpressionAnalysisOptions): callExpressionMeaning.ResolutionResult;
|
|
138
140
|
getRespectiveParameter(node: tree.Argument): MatchResultParameter | undefined;
|
|
139
141
|
resolveIndexedAccessExpression(node: tree.IndexedAccessExpression): indexedAccessExpressionMeaning.ResolutionResult;
|
|
@@ -257,12 +259,14 @@ export declare class Analyzer {
|
|
|
257
259
|
getFunctionBlockLiteralParameters(node: tree.FunctionBlockLiteral): readonly e.ParameterEntity[];
|
|
258
260
|
getExtendedType(node: tree.TypeExtensionDeclaration): WithDiagnostics<e.NamedTypeEntity>;
|
|
259
261
|
getAnalyzedTranslationPackageIfTargetResolved(package_: project.TranslationPackage): AnalyzedTranslationPackage | undefined;
|
|
262
|
+
getAnalyzedTextTranslationPackageIfTargetResolved(package_: project.TextTranslationPackage): AnalyzedTextTranslationPackage | undefined;
|
|
260
263
|
findAnalyzedTranslationPackageForLocale(entity: e.PackageEntity, locale: PackageLocale): AnalyzedTranslationPackage | undefined;
|
|
261
264
|
getLocalizedPackageWithLocale(originalPackageEntity: e.PackageEntity, locale: PackageLocale): e.PackageEntity | undefined;
|
|
262
265
|
enumerateAnalyzedTranslationPackages(): Query<AnalyzedTranslationPackage>;
|
|
266
|
+
enumerateAnalyzedTextTranslationPackages(): Iterable<AnalyzedTextTranslationPackage>;
|
|
263
267
|
getLinkedMultiPlatformPackagesByPlatform(entity: e.PackageEntity): ReadonlyMap<PlatformKind, LinkedMultiPlatformPackage> | undefined;
|
|
264
268
|
getLinkedMultiPlatformPackage(entity: e.PackageEntity, platform: PlatformKind): LinkedMultiPlatformPackage | undefined;
|
|
265
|
-
|
|
269
|
+
getTextTranslationPackagesMap(): ReadonlyMap<e.PackageEntity, ReadonlyMap<PackageLocale, AnalyzedTextTranslationPackage>>;
|
|
266
270
|
instantiateType(entity: e.TypeEntity, typeArguments: readonly types.Type[] | undefined): types.Type;
|
|
267
271
|
instantiateTypeWithSubstitutions(entity: e.TypeEntity, substitutions: types.Substitutions): types.Type;
|
|
268
272
|
instantiateTypeByIdentitySubstitution(entity: e.TypeEntity): types.Type;
|
|
@@ -283,7 +287,7 @@ export declare class Analyzer {
|
|
|
283
287
|
createNodeDiagnostic(code: DiagnosticCode, node: tree.Node, formatArguments?: readonly DisplayableOrPrimitive[], kind?: DiagnosticKind, flags?: DiagnosticFlags): Diagnostic;
|
|
284
288
|
createSourceFileRangeDiagnostic(code: DiagnosticCode, range: Range, nodeOrSourceFile: tree.Node | project.SourceFile, formatArguments?: readonly DisplayableOrPrimitive[], kind?: DiagnosticKind, flags?: DiagnosticFlags): Diagnostic;
|
|
285
289
|
createDiagnostic(code: DiagnosticCode, location: DiagnosticLocation | undefined, formatArguments?: readonly DisplayableOrPrimitive[], kind?: DiagnosticKind, flags?: DiagnosticFlags): Diagnostic;
|
|
286
|
-
|
|
290
|
+
getNodeDiagnosticLocation(node: tree.Node): DiagnosticLocation;
|
|
287
291
|
getDeclaredTypeMemberEntities(node: tree.TypeMemberDeclarationBlock): DeclaredTypeMemberEntities;
|
|
288
292
|
getBasicMethodOfOriginalTypeForBasicMethodOfAliasType(entity: e.MethodEntity): e.MethodEntity | undefined;
|
|
289
293
|
checkBodyOfBasicAliasTypeMethod(node: tree.MethodDeclaration, diagnostics?: DiagnosticAcceptor): {
|
|
@@ -314,6 +318,7 @@ export declare class Analyzer {
|
|
|
314
318
|
isTargetTypeDependentFunctionLiteral(node: tree.Expression): node is RegularOrBlockFunctionLiteral;
|
|
315
319
|
checkTypeArgumentCount(typeArgumentCount: number, typeParameters: readonly e.TypeParameterEntity[], diagnostics?: DiagnosticAcceptor, nodeForDiagnostic?: tree.Node): boolean;
|
|
316
320
|
checkTypeCanBeUsedAsValue(typeAccess: tree.Expression): boolean;
|
|
321
|
+
getEntityDiagnosticLocation(entity: e.Entity, chooseSetter?: boolean): DiagnosticLocation | undefined;
|
|
317
322
|
private createTsInterop;
|
|
318
323
|
}
|
|
319
324
|
export declare class TsInteropInputs {
|
|
@@ -441,6 +446,7 @@ declare class ReturnType {
|
|
|
441
446
|
ofDereferencedVariableGetterDeclaration(node: tree.DereferencedVariableGetterDeclaration): types.Type;
|
|
442
447
|
ofIndexedElementGetterDeclaration(node: tree.IndexedElementGetterDeclaration): types.Type;
|
|
443
448
|
ofFunctionDeclaration(node: FunctionDeclaration): types.Type;
|
|
449
|
+
ofTextTranslationFunctionDeclaration(node: tree.TextTranslationFunctionDeclaration): types.Type;
|
|
444
450
|
}
|
|
445
451
|
declare class Entity {
|
|
446
452
|
private readonly analyzer;
|
|
@@ -470,9 +476,7 @@ declare class Entity {
|
|
|
470
476
|
private readonly typeExtensionEntities;
|
|
471
477
|
private readonly packageAliasEntities;
|
|
472
478
|
private readonly translationTextTemplateParameterEntities;
|
|
473
|
-
private readonly
|
|
474
|
-
private readonly localizableTextTemplateEntities;
|
|
475
|
-
private readonly localizableTextEntitiesByPackage;
|
|
479
|
+
private readonly textTranslationDeclarationEntities;
|
|
476
480
|
constructor(analyzer: Analyzer);
|
|
477
481
|
ofPackage(pkg: SourcePackage): e.PackageEntity;
|
|
478
482
|
ofPackageVariableDeclaration(node: tree.PackageVariableDeclaration): e.PackageVariableEntity;
|
|
@@ -517,7 +521,8 @@ declare class Entity {
|
|
|
517
521
|
ofPackageImport(node: tree.PackageImport): e.PackageAliasEntity;
|
|
518
522
|
ofTypeWithMembersDeclaration(node: TypeWithMembersDeclaration): e.TypeEntityWithMembers;
|
|
519
523
|
ofTypeWithMembersOrExtensionDeclaration(node: TypeWithMembersOrTypeExtensionDeclaration): e.TypeWithMembersOrExtensionEntity;
|
|
520
|
-
ofTranslationTextTemplateParameter(node: tree.TranslationTextTemplateParameter): e.
|
|
524
|
+
ofTranslationTextTemplateParameter(node: tree.TranslationTextTemplateParameter): e.ParameterEntity;
|
|
525
|
+
ofTextTranslationDeclaration(node: tree.TextTranslationSource): e.TextTranslationEntity;
|
|
521
526
|
private getContainingPackageLoadedFromDts;
|
|
522
527
|
private createComputedFieldEntities;
|
|
523
528
|
private createDereferenceOperatorEntities;
|
|
@@ -540,6 +545,7 @@ declare class ResultLocalVariableEntity {
|
|
|
540
545
|
ofIndexedElementGetterDeclaration(node: tree.IndexedElementGetterDeclaration): e.LocalVariableEntity;
|
|
541
546
|
ofDereferencedVariableGetterDeclaration(node: tree.DereferencedVariableGetterDeclaration): e.LocalVariableEntity;
|
|
542
547
|
ofFunctionDeclaration(node: FunctionDeclaration): e.LocalVariableEntity;
|
|
548
|
+
ofTextTranslationFunctionDeclaration(node: tree.TextTranslationFunctionDeclaration): e.LocalVariableEntity;
|
|
543
549
|
private createResultLocalVariableEntity;
|
|
544
550
|
}
|
|
545
551
|
declare class ValueLocalVariableEntity {
|
|
@@ -8,12 +8,14 @@ export declare class DiagnosticCollector {
|
|
|
8
8
|
private readonly sourceFile;
|
|
9
9
|
private readonly diagnosticArgumentFactory;
|
|
10
10
|
private readonly translationPackage_;
|
|
11
|
+
private readonly textTranslationPackage_;
|
|
11
12
|
private readonly diagnostics;
|
|
12
13
|
private readonly diagnosticAcceptor;
|
|
13
14
|
private namedDeclarationsUsageMap;
|
|
14
15
|
private readonly modifierValidator;
|
|
15
16
|
private readonly standardTypes_;
|
|
16
17
|
private get translationPackage();
|
|
18
|
+
private get textTranslationPackage();
|
|
17
19
|
private get isInterfacePackageFile();
|
|
18
20
|
private get standardTypes();
|
|
19
21
|
constructor(analyzer: Analyzer, sourceFile: project.SourceFile);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FieldEntity, LocalVariableEntity, PackageVariableEntity, ParameterEntity
|
|
1
|
+
import { FieldEntity, LocalVariableEntity, PackageVariableEntity, ParameterEntity } from '../../entities/VariableEntity.js';
|
|
2
2
|
import * as tree from '../../tree/index.js';
|
|
3
3
|
import { Analyzer } from '../Analyzer.js';
|
|
4
4
|
import { NarrowableReferenceExpression } from '../control-flow/NarrowableExpression.js';
|
|
@@ -6,9 +6,9 @@ export type NarrowableReference = NarrowableReference.LocalVariable | Narrowable
|
|
|
6
6
|
export declare namespace NarrowableReference {
|
|
7
7
|
export class LocalVariable implements INarrowableReference {
|
|
8
8
|
private readonly analyzer;
|
|
9
|
-
readonly entity: LocalVariableEntity | ParameterEntity
|
|
9
|
+
readonly entity: LocalVariableEntity | ParameterEntity;
|
|
10
10
|
readonly kind = "local-variable";
|
|
11
|
-
constructor(analyzer: Analyzer, entity: LocalVariableEntity | ParameterEntity
|
|
11
|
+
constructor(analyzer: Analyzer, entity: LocalVariableEntity | ParameterEntity);
|
|
12
12
|
equals(other: NarrowableReference): boolean;
|
|
13
13
|
contains(_other: NarrowableReference): boolean;
|
|
14
14
|
equalsExpression(expression: NarrowableReferenceExpression): boolean;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { FieldWithInitializerSemanticContext } from './FieldWithInitializerSemanticContext.js';
|
|
2
2
|
import { SourceFileSemanticContext } from './SourceFileSemanticContext.js';
|
|
3
|
-
import { CatchClauseSemanticContext, ForStatementSemanticContext, FunctionBlockSemanticContext, SpecialLocalDeclarationSemanticContext, StatementBlockSemanticContext,
|
|
3
|
+
import { CatchClauseSemanticContext, ForStatementSemanticContext, FunctionBlockSemanticContext, SpecialLocalDeclarationSemanticContext, StatementBlockSemanticContext, SubprogramParameterListSemanticContext, SubprogramTypeParameterSemanticContext } from './SubprogramBodyAndParametersSemanticContext.js';
|
|
4
4
|
import { OutermostSemanticContextOfSubprogram } from './SubprogramSemanticContext.js';
|
|
5
|
-
import { TranslationTextTemplateSemanticContext } from './TranslationTextTemplateSemanticContext.js';
|
|
6
5
|
import { OutermostSemanticContextOfType, ParametersOfFunctionTypeSemanticContext, TypeBodySemanticContext, TypeExtensionBodySemanticContext, TypeParametersOfTypeSemanticContext } from './TypeSemanticContext.js';
|
|
7
6
|
/**
|
|
8
7
|
* Позволяет получить информацию, общую для определённой области
|
|
@@ -11,4 +10,4 @@ import { OutermostSemanticContextOfType, ParametersOfFunctionTypeSemanticContext
|
|
|
11
10
|
* Чтобы получить семантический контекст, в котором находится определённый узел,
|
|
12
11
|
* используйте `analyzer.semanticContext.containing(node)`.
|
|
13
12
|
*/
|
|
14
|
-
export type SemanticContext = SourceFileSemanticContext | OutermostSemanticContextOfType | TypeParametersOfTypeSemanticContext | TypeBodySemanticContext | TypeExtensionBodySemanticContext | ParametersOfFunctionTypeSemanticContext | OutermostSemanticContextOfSubprogram | SubprogramTypeParameterSemanticContext |
|
|
13
|
+
export type SemanticContext = SourceFileSemanticContext | OutermostSemanticContextOfType | TypeParametersOfTypeSemanticContext | TypeBodySemanticContext | TypeExtensionBodySemanticContext | ParametersOfFunctionTypeSemanticContext | OutermostSemanticContextOfSubprogram | SubprogramTypeParameterSemanticContext | SubprogramParameterListSemanticContext | SpecialLocalDeclarationSemanticContext | StatementBlockSemanticContext | FunctionBlockSemanticContext | FieldWithInitializerSemanticContext | ForStatementSemanticContext | CatchClauseSemanticContext;
|
|
@@ -39,7 +39,7 @@ export declare abstract class SemanticContextBase {
|
|
|
39
39
|
private enumerateSemanticContexts;
|
|
40
40
|
private getSourceFileContext;
|
|
41
41
|
}
|
|
42
|
-
export type SubprogramInfo = SubprogramInfo.Function | SubprogramInfo.Operator | SubprogramInfo.Constructor | SubprogramInfo.Destructor | SubprogramInfo.Getter | SubprogramInfo.Setter | SubprogramInfo.PackageConstructor | SubprogramInfo.PackageEntryPoint | SubprogramInfo.FunctionLiteral;
|
|
42
|
+
export type SubprogramInfo = SubprogramInfo.Function | SubprogramInfo.Operator | SubprogramInfo.Constructor | SubprogramInfo.Destructor | SubprogramInfo.Getter | SubprogramInfo.Setter | SubprogramInfo.PackageConstructor | SubprogramInfo.PackageEntryPoint | SubprogramInfo.FunctionLiteral | SubprogramInfo.TextTranslationFunction;
|
|
43
43
|
export declare namespace SubprogramInfo {
|
|
44
44
|
export class Function implements ISubprogramInfo {
|
|
45
45
|
readonly kind = "function";
|
|
@@ -136,6 +136,16 @@ export declare namespace SubprogramInfo {
|
|
|
136
136
|
getNode(): RegularOrBlockFunctionLiteral;
|
|
137
137
|
private getSignatureType;
|
|
138
138
|
}
|
|
139
|
+
export class TextTranslationFunction implements ISubprogramInfo {
|
|
140
|
+
readonly kind = "text-translation-function";
|
|
141
|
+
private readonly analyzer;
|
|
142
|
+
private readonly node;
|
|
143
|
+
constructor(analyzer: Analyzer, node: tree.TextTranslationFunctionDeclaration);
|
|
144
|
+
getReturnType(): types.Type | undefined;
|
|
145
|
+
isGenerator(): boolean;
|
|
146
|
+
allowsAsyncCalls(): boolean;
|
|
147
|
+
getNode(): tree.TextTranslationFunctionDeclaration;
|
|
148
|
+
}
|
|
139
149
|
interface ISubprogramInfo {
|
|
140
150
|
getReturnType(): types.Type | undefined;
|
|
141
151
|
isGenerator(): boolean;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as tree from '../../tree/index.js';
|
|
2
2
|
import { Analyzer } from '../Analyzer.js';
|
|
3
3
|
import { FunctionDeclaration, IndexedElementAccessorDeclaration, PackageTypeDeclaration, RegularOrBlockFunctionLiteral, SubprogramDeclarationOrLiteral } from '../NodeTypeUtils.js';
|
|
4
|
-
import { BlockSemanticContext, CatchClauseSemanticContext, ConstructorSemanticContext, DestructorSemanticContext, ForStatementSemanticContext, FunctionBlockSemanticContext, FunctionLiteralSemanticContext, FunctionSemanticContext, IndexedElementAccessorSemanticContext, OperatorSemanticContext, OutermostSemanticContextOfSubprogram, OutermostSemanticContextOfType, PackageConstructorSemanticContext, PackageEntryPointSemanticContext, ParametersOfFunctionTypeSemanticContext, SemanticContext, SemanticContextContainingTypeMember, SourceFileSemanticContext, SpecialLocalDeclarationSemanticContext, StatementBlockSemanticContext,
|
|
5
|
-
import { TranslationTextTemplateSemanticContext } from './TranslationTextTemplateSemanticContext.js';
|
|
4
|
+
import { BlockSemanticContext, CatchClauseSemanticContext, ConstructorSemanticContext, DestructorSemanticContext, ForStatementSemanticContext, FunctionBlockSemanticContext, FunctionLiteralSemanticContext, FunctionSemanticContext, IndexedElementAccessorSemanticContext, OperatorSemanticContext, OutermostSemanticContextOfSubprogram, OutermostSemanticContextOfType, PackageConstructorSemanticContext, PackageEntryPointSemanticContext, ParametersOfFunctionTypeSemanticContext, SemanticContext, SemanticContextContainingTypeMember, SourceFileSemanticContext, SpecialLocalDeclarationSemanticContext, StatementBlockSemanticContext, SubprogramParameterListSemanticContext, SubprogramTypeParameterSemanticContext, TextTranslationFunctionDeclarationSemanticContext, TypeBodySemanticContext, TypeDeclarationCreatingSemanticContext, TypeDeclarationWithMembersBody, TypeExtensionBodySemanticContext, TypeParametersOfTypeSemanticContext, VariableAccessorDeclaration, VariableAccessorSemanticContext } from '../semantic-context/index.js';
|
|
6
5
|
export declare class SemanticContextBuilder {
|
|
7
6
|
private readonly analyzer;
|
|
8
7
|
private readonly sourceFileContexts;
|
|
@@ -26,9 +25,9 @@ export declare class SemanticContextBuilder {
|
|
|
26
25
|
private readonly subprogramTypeParameterContexts;
|
|
27
26
|
private readonly subprogramParameterContexts;
|
|
28
27
|
private readonly outermostContextsOfFunctionDeclaration;
|
|
28
|
+
private readonly outermostContextsOfTextTranslationFunctionDeclaration;
|
|
29
29
|
private readonly outermostContextsOfTypeDeclaration;
|
|
30
30
|
private readonly typeExtensionDeclarationBodyContexts;
|
|
31
|
-
private readonly translationTextTemplateContexts;
|
|
32
31
|
constructor(analyzer: Analyzer);
|
|
33
32
|
/**
|
|
34
33
|
* Возвращает контекст, содержащий узел. Если в качестве узла передан исходный файл,
|
|
@@ -37,10 +36,10 @@ export declare class SemanticContextBuilder {
|
|
|
37
36
|
containing(node: tree.Node): SemanticContext;
|
|
38
37
|
containingWithOffset(node: tree.Node, offset: number): SemanticContext;
|
|
39
38
|
ofSourceFile(node: tree.SourceFile): SourceFileSemanticContext;
|
|
40
|
-
ofFunctionDeclarationParameters(node: FunctionDeclaration):
|
|
39
|
+
ofFunctionDeclarationParameters(node: FunctionDeclaration): SubprogramParameterListSemanticContext;
|
|
41
40
|
ofFunctionDeclarationTypeParameters(node: FunctionDeclaration, typeParameterClause: tree.TypeParameterClause): SubprogramTypeParameterSemanticContext;
|
|
42
41
|
outermostSemanticContextOfFunctionDeclaration(node: FunctionDeclaration): FunctionSemanticContext;
|
|
43
|
-
ofOperatorDeclarationParameters(node: tree.OperatorDeclaration):
|
|
42
|
+
ofOperatorDeclarationParameters(node: tree.OperatorDeclaration): SubprogramParameterListSemanticContext;
|
|
44
43
|
outermostSemanticContextOfOperatorDeclaration(node: tree.OperatorDeclaration): OperatorSemanticContext;
|
|
45
44
|
ofTypeDeclarationBody(node: TypeDeclarationWithMembersBody): TypeBodySemanticContext;
|
|
46
45
|
ofFunctionTypeDeclarationParameters(node: tree.FunctionTypeDeclarationBody): ParametersOfFunctionTypeSemanticContext;
|
|
@@ -50,25 +49,26 @@ export declare class SemanticContextBuilder {
|
|
|
50
49
|
ofVariableAccessorDeclaration(node: VariableAccessorDeclaration): VariableAccessorSemanticContext;
|
|
51
50
|
ofPackageConstructorDeclaration(node: tree.PackageConstructorDeclaration): PackageConstructorSemanticContext;
|
|
52
51
|
ofPackageEntryPointDeclaration(node: tree.PackageEntryPointDeclaration): PackageEntryPointSemanticContext;
|
|
53
|
-
ofRegularOrBlockFunctionLiteralParameters(node: RegularOrBlockFunctionLiteral):
|
|
52
|
+
ofRegularOrBlockFunctionLiteralParameters(node: RegularOrBlockFunctionLiteral): SubprogramParameterListSemanticContext;
|
|
53
|
+
ofTextTranslationDeclarationParameters(node: tree.TranslationTextTemplate): SubprogramParameterListSemanticContext;
|
|
54
|
+
outermostSemanticContextOfTextTranslationFunctionDeclaration(node: tree.TextTranslationFunctionDeclaration): TextTranslationFunctionDeclarationSemanticContext;
|
|
54
55
|
outermostSemanticContextOfRegularOrBlockFunctionLiteral(node: RegularOrBlockFunctionLiteral): FunctionLiteralSemanticContext;
|
|
55
56
|
ofForStatement(node: tree.ForStatement): ForStatementSemanticContext;
|
|
56
57
|
ofStatementBlock(node: tree.StatementBlock): StatementBlockSemanticContext;
|
|
57
58
|
ofFunctionBlock(node: tree.FunctionBlock): FunctionBlockSemanticContext;
|
|
58
59
|
withSpecialLocalDeclarations(node: tree.FunctionBlock): SpecialLocalDeclarationSemanticContext;
|
|
59
60
|
ofStatementBlockOrFunctionBlock(node: tree.StatementBlock | tree.FunctionBlock): BlockSemanticContext;
|
|
60
|
-
ofConstructorDeclarationParameters(node: tree.ConstructorDeclaration):
|
|
61
|
+
ofConstructorDeclarationParameters(node: tree.ConstructorDeclaration): SubprogramParameterListSemanticContext;
|
|
61
62
|
outermostSemanticContextOfConstructorDeclaration(node: tree.ConstructorDeclaration): ConstructorSemanticContext;
|
|
62
|
-
ofDestructorDeclarationParameters(node: tree.DestructorDeclaration):
|
|
63
|
+
ofDestructorDeclarationParameters(node: tree.DestructorDeclaration): SubprogramParameterListSemanticContext;
|
|
63
64
|
outermostSemanticContextOfDestructorDeclaration(node: tree.DestructorDeclaration): DestructorSemanticContext;
|
|
64
|
-
ofIndexedElementAccessorDeclarationParameters(node: IndexedElementAccessorDeclaration):
|
|
65
|
+
ofIndexedElementAccessorDeclarationParameters(node: IndexedElementAccessorDeclaration): SubprogramParameterListSemanticContext;
|
|
65
66
|
outermostSemanticContextOfIndexedElementAccessorDeclaration(node: IndexedElementAccessorDeclaration): IndexedElementAccessorSemanticContext;
|
|
66
67
|
ofCatchClause(node: tree.CatchClause): CatchClauseSemanticContext;
|
|
67
68
|
ofFieldDeclarationWithInitializer(node: tree.FieldDeclaration): SemanticContext;
|
|
68
69
|
ofSubprogram(node: SubprogramDeclarationOrLiteral): OutermostSemanticContextOfSubprogram;
|
|
69
70
|
containingTypeMember(node: tree.TypeMemberDeclaration): SemanticContextContainingTypeMember;
|
|
70
71
|
containingPackageMember(node: tree.PackageMemberDeclaration): SourceFileSemanticContext;
|
|
71
|
-
ofTranslationTextTemplate(node: tree.TranslationTextTemplate): TranslationTextTemplateSemanticContext;
|
|
72
72
|
private containingInternal;
|
|
73
73
|
private ofChildOfFunctionDeclaration;
|
|
74
74
|
private ofChildOfTypeDeclarationWithMemberBlock;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Name } from '../../common/index.js';
|
|
2
2
|
import { DiagnosticAcceptor } from '../../diagnostic/Diagnostic.js';
|
|
3
3
|
import { IEntityHidingMatcher } from '../../entities/EntityHiding.js';
|
|
4
|
-
import { LocalVariableEntity, NestedFunctionEntity, ParameterEntity,
|
|
4
|
+
import { LocalVariableEntity, NestedFunctionEntity, ParameterEntity, TypeParameterEntity } from '../../entities/index.js';
|
|
5
5
|
import * as tree from '../../tree/index.js';
|
|
6
6
|
import { Analyzer } from '../Analyzer.js';
|
|
7
7
|
import { NamedDeclaration, TypeOrContainerWithTypes } from './Declarations.js';
|
|
@@ -14,12 +14,12 @@ export declare abstract class SemanticContextValidatingNameConflictsBase extends
|
|
|
14
14
|
abstract readonly outer: SemanticContext;
|
|
15
15
|
abstract readonly node: tree.Node;
|
|
16
16
|
protected readonly analyzer: Analyzer;
|
|
17
|
-
private
|
|
17
|
+
private memberEntities_;
|
|
18
18
|
private memberEntitiesByNameKey;
|
|
19
|
-
private
|
|
20
|
-
private
|
|
21
|
-
private
|
|
22
|
-
private
|
|
19
|
+
private namedDeclarations_;
|
|
20
|
+
private typesOrContainerWithTypes_;
|
|
21
|
+
private namedDeclarationsByName_;
|
|
22
|
+
private typesOrContainerWithTypesByName_;
|
|
23
23
|
private get memberEntities();
|
|
24
24
|
private get namedDeclarations();
|
|
25
25
|
private get typesOrContainerWithTypes();
|
|
@@ -38,5 +38,5 @@ export declare abstract class SemanticContextValidatingNameConflictsBase extends
|
|
|
38
38
|
private createNamedDeclarations;
|
|
39
39
|
private createTypesOrContainerWithTypes;
|
|
40
40
|
}
|
|
41
|
-
export type MemberOfSemanticContextValidatingNameConflicts = LocalVariableEntity | ParameterEntity |
|
|
41
|
+
export type MemberOfSemanticContextValidatingNameConflicts = LocalVariableEntity | ParameterEntity | NestedFunctionEntity | TypeParameterEntity;
|
|
42
42
|
export type MemberOfSemanticContextValidatingNameConflictsForTypeLookup = TypeParameterEntity;
|
|
@@ -19,5 +19,6 @@ export declare class SpecialLocalDeclarationsBuilder {
|
|
|
19
19
|
static buildForConstructorDeclaration(analyzer: Analyzer, node: tree.ConstructorDeclaration): readonly SpecialLocalDeclarationEntity[];
|
|
20
20
|
static buildForMethodDeclaration(analyzer: Analyzer, node: tree.MethodDeclaration): readonly SpecialLocalDeclarationEntity[];
|
|
21
21
|
static buildForOperatorDeclaration(analyzer: Analyzer, node: tree.OperatorDeclaration): readonly SpecialLocalDeclarationEntity[];
|
|
22
|
+
static buildForTextTranslationFunctionDeclaration(analyzer: Analyzer, node: tree.TextTranslationFunctionDeclaration): readonly SpecialLocalDeclarationEntity[];
|
|
22
23
|
}
|
|
23
24
|
export {};
|
package/build/types/analysis/semantic-context/SubprogramBodyAndParametersSemanticContext.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { DiagnosticAcceptor } from '../../diagnostic/Diagnostic.js';
|
|
2
|
+
import { ParameterEntity } from '../../entities/index.js';
|
|
3
|
+
import { ReservedIdentifierKind } from '../../parser/ReservedIdentifierDictionary.js';
|
|
2
4
|
import * as tree from '../../tree/index.js';
|
|
3
5
|
import { Analyzer } from '../Analyzer.js';
|
|
4
6
|
import { SemanticContext } from './SemanticContext.js';
|
|
5
7
|
import { TryStatementContextKind } from './SemanticContextBase.js';
|
|
6
8
|
import { MemberOfSemanticContextValidatingNameConflicts, MemberOfSemanticContextValidatingNameConflictsForTypeLookup, SemanticContextValidatingNameConflictsBase } from './SemanticContextValidatingNameConflicts.js';
|
|
9
|
+
import { SourceFileSemanticContext } from './SourceFileSemanticContext.js';
|
|
7
10
|
import { OutermostSemanticContextOfSubprogram } from './SubprogramSemanticContext.js';
|
|
8
11
|
export type SubprogramTypeParameterSemanticContextParent = OutermostSemanticContextOfSubprogram;
|
|
9
12
|
export declare class SubprogramTypeParameterSemanticContext extends SemanticContextValidatingNameConflictsBase {
|
|
@@ -16,24 +19,43 @@ export declare class SubprogramTypeParameterSemanticContext extends SemanticCont
|
|
|
16
19
|
protected createMemberEntities(): readonly MemberOfSemanticContextValidatingNameConflicts[];
|
|
17
20
|
protected createMemberEntitiesForTypeLookup(): readonly MemberOfSemanticContextValidatingNameConflictsForTypeLookup[];
|
|
18
21
|
}
|
|
19
|
-
export type
|
|
20
|
-
export declare abstract class
|
|
21
|
-
readonly kind = "subprogram-parameter";
|
|
22
|
-
readonly outer:
|
|
23
|
-
constructor(analyzer: Analyzer, outer:
|
|
22
|
+
export type SubprogramParameterListSemanticContextParent = SubprogramTypeParameterSemanticContext | OutermostSemanticContextOfSubprogram | SourceFileSemanticContext;
|
|
23
|
+
export declare abstract class SubprogramParameterListSemanticContext extends SemanticContextValidatingNameConflictsBase {
|
|
24
|
+
readonly kind = "subprogram-parameter-list";
|
|
25
|
+
readonly outer: SubprogramParameterListSemanticContextParent;
|
|
26
|
+
constructor(analyzer: Analyzer, outer: SubprogramParameterListSemanticContextParent);
|
|
27
|
+
protected abstract get isSetterParameterList(): boolean;
|
|
28
|
+
protected abstract getParameterEntities(): readonly ParameterEntity[];
|
|
29
|
+
protected abstract getSpecialVariableKinds(): readonly ReservedIdentifierKind[];
|
|
30
|
+
validateNameConflicts(diagnostics: DiagnosticAcceptor): void;
|
|
24
31
|
}
|
|
25
|
-
export declare class
|
|
32
|
+
export declare class ExplicitSubprogramParameterListSemanticContext extends SubprogramParameterListSemanticContext {
|
|
26
33
|
readonly node: tree.ParameterList;
|
|
27
34
|
protected readonly asContext: SemanticContext;
|
|
28
|
-
constructor(analyzer: Analyzer, node: tree.ParameterList, outer:
|
|
29
|
-
|
|
35
|
+
constructor(analyzer: Analyzer, node: tree.ParameterList, outer: SubprogramParameterListSemanticContextParent);
|
|
36
|
+
protected get isSetterParameterList(): boolean;
|
|
37
|
+
protected getParameterEntities(): readonly ParameterEntity[];
|
|
38
|
+
protected getSpecialVariableKinds(): readonly ReservedIdentifierKind[];
|
|
30
39
|
protected createMemberEntities(): readonly MemberOfSemanticContextValidatingNameConflicts[];
|
|
31
40
|
protected createMemberEntitiesForTypeLookup(): readonly MemberOfSemanticContextValidatingNameConflictsForTypeLookup[];
|
|
32
41
|
}
|
|
33
|
-
export declare class
|
|
42
|
+
export declare class FunctionBlockLiteralParameterListSemanticContext extends SubprogramParameterListSemanticContext {
|
|
34
43
|
readonly node: tree.FunctionBlockLiteral;
|
|
35
44
|
protected readonly asContext: SemanticContext;
|
|
36
|
-
constructor(analyzer: Analyzer, node: tree.FunctionBlockLiteral, outer:
|
|
45
|
+
constructor(analyzer: Analyzer, node: tree.FunctionBlockLiteral, outer: SubprogramParameterListSemanticContextParent);
|
|
46
|
+
protected get isSetterParameterList(): boolean;
|
|
47
|
+
protected getParameterEntities(): readonly ParameterEntity[];
|
|
48
|
+
protected getSpecialVariableKinds(): readonly ReservedIdentifierKind[];
|
|
49
|
+
protected createMemberEntities(): readonly MemberOfSemanticContextValidatingNameConflicts[];
|
|
50
|
+
protected createMemberEntitiesForTypeLookup(): readonly MemberOfSemanticContextValidatingNameConflictsForTypeLookup[];
|
|
51
|
+
}
|
|
52
|
+
export declare class TranslationTextTemplateParameterListSemanticContext extends SubprogramParameterListSemanticContext {
|
|
53
|
+
readonly node: tree.TranslationTextTemplate;
|
|
54
|
+
protected readonly asContext: SemanticContext;
|
|
55
|
+
constructor(analyzer: Analyzer, node: tree.TranslationTextTemplate, outer: SubprogramParameterListSemanticContextParent);
|
|
56
|
+
protected get isSetterParameterList(): boolean;
|
|
57
|
+
protected getParameterEntities(): readonly ParameterEntity[];
|
|
58
|
+
protected getSpecialVariableKinds(): readonly ReservedIdentifierKind[];
|
|
37
59
|
protected createMemberEntities(): readonly MemberOfSemanticContextValidatingNameConflicts[];
|
|
38
60
|
protected createMemberEntitiesForTypeLookup(): readonly MemberOfSemanticContextValidatingNameConflictsForTypeLookup[];
|
|
39
61
|
}
|
|
@@ -49,7 +71,7 @@ export declare class StatementBlockSemanticContext extends SemanticContextValida
|
|
|
49
71
|
protected createMemberEntities(): readonly MemberOfSemanticContextValidatingNameConflicts[];
|
|
50
72
|
protected createMemberEntitiesForTypeLookup(): readonly MemberOfSemanticContextValidatingNameConflictsForTypeLookup[];
|
|
51
73
|
}
|
|
52
|
-
export type FunctionBlockSemanticContextParent =
|
|
74
|
+
export type FunctionBlockSemanticContextParent = SubprogramParameterListSemanticContext | OutermostSemanticContextOfSubprogram | SpecialLocalDeclarationSemanticContext;
|
|
53
75
|
export declare class FunctionBlockSemanticContext extends SemanticContextValidatingNameConflictsBase {
|
|
54
76
|
readonly kind = "function-block";
|
|
55
77
|
readonly outer: FunctionBlockSemanticContextParent;
|
|
@@ -59,7 +81,7 @@ export declare class FunctionBlockSemanticContext extends SemanticContextValidat
|
|
|
59
81
|
protected createMemberEntities(): readonly MemberOfSemanticContextValidatingNameConflicts[];
|
|
60
82
|
protected createMemberEntitiesForTypeLookup(): readonly MemberOfSemanticContextValidatingNameConflictsForTypeLookup[];
|
|
61
83
|
}
|
|
62
|
-
export type SpecialLocalDeclarationSemanticContextParent =
|
|
84
|
+
export type SpecialLocalDeclarationSemanticContextParent = SubprogramParameterListSemanticContext | OutermostSemanticContextOfSubprogram;
|
|
63
85
|
export declare class SpecialLocalDeclarationSemanticContext extends SemanticContextValidatingNameConflictsBase {
|
|
64
86
|
readonly kind = "special-local-declaration";
|
|
65
87
|
readonly outer: SpecialLocalDeclarationSemanticContextParent;
|
|
@@ -111,3 +111,12 @@ export declare class FunctionLiteralSemanticContext extends OutermostSemanticCon
|
|
|
111
111
|
constructor(analyzer: Analyzer, node: RegularOrBlockFunctionLiteral, outer: SemanticContext);
|
|
112
112
|
getContainingSubprogram(): SubprogramInfo;
|
|
113
113
|
}
|
|
114
|
+
export declare class TextTranslationFunctionDeclarationSemanticContext extends OutermostSemanticContextOfSubprogram {
|
|
115
|
+
readonly outer: SemanticContext;
|
|
116
|
+
protected readonly asContext: SemanticContext;
|
|
117
|
+
private readonly analyzer;
|
|
118
|
+
private readonly node;
|
|
119
|
+
private readonly subprogramInfo;
|
|
120
|
+
constructor(analyzer: Analyzer, node: tree.TextTranslationFunctionDeclaration, outer: SemanticContext);
|
|
121
|
+
getContainingSubprogram(): SubprogramInfo;
|
|
122
|
+
}
|
|
@@ -35,6 +35,7 @@ export declare enum DiagnosticCode {
|
|
|
35
35
|
TypeMemberTranslationExpected = 129,
|
|
36
36
|
TranslationExpected = 130,
|
|
37
37
|
TranslatedTextTemplateOrTranslationFunctionBlockExpected = 131,
|
|
38
|
+
TranslatedTextCannotBeginOrEndWithTilde = 132,
|
|
38
39
|
TypeCannotBeUsedAsValue = 201,
|
|
39
40
|
PackageNameCannotBeUsedAsValue = 202,
|
|
40
41
|
PackageAliasCannotBeUsedAsValue = 203,
|
|
@@ -35,4 +35,7 @@ export declare class EmitPhaseName {
|
|
|
35
35
|
static ofTypeExtension(locale: PackageLocale, extendedTypeName: string): string;
|
|
36
36
|
static ofOperator(locale: PackageLocale, kind: OperatorKind): string;
|
|
37
37
|
static ofSetterParameter(locale: PackageLocale): string;
|
|
38
|
+
static ofDictionaryLocalVariable(locale: PackageLocale): string;
|
|
39
|
+
static ofThisPackageVariable(locale: PackageLocale): string;
|
|
40
|
+
static ofTranslationFunctionValuesParameter(locale: PackageLocale): string;
|
|
38
41
|
}
|
|
@@ -30,12 +30,11 @@ export declare class Emitter {
|
|
|
30
30
|
}
|
|
31
31
|
export declare class EmitterPackage {
|
|
32
32
|
ir: ir.Package;
|
|
33
|
-
entity: PackageEntity;
|
|
34
33
|
outputUri: Uri;
|
|
35
34
|
packageLevelNames: ReadonlySet<string>;
|
|
36
35
|
entityNameOverrides: ReadonlyMap<NamedEntity, string> | undefined;
|
|
37
36
|
private referencedPackageMembers;
|
|
38
|
-
constructor(ir: ir.Package
|
|
37
|
+
constructor(ir: ir.Package);
|
|
39
38
|
getReferencedPackageMembers(): ReferencedPackageMembers;
|
|
40
39
|
}
|
|
41
40
|
export interface OutputAcceptor {
|
|
@@ -20,6 +20,7 @@ export declare class EmitterContext {
|
|
|
20
20
|
createIdentitySubstitutedType(entity: TypeOrExtensionEntity): Type;
|
|
21
21
|
unaliasTypeEntity(typeEntity: TypeOrExtensionEntity): Type;
|
|
22
22
|
unaliasType(type: Type): Type;
|
|
23
|
+
createUnionType(types: readonly Type[]): Type;
|
|
23
24
|
isTypeEmittedAsClass(entity: TypeOrExtensionEntity): boolean;
|
|
24
25
|
isRefOrPlainObjectTypeEntity(entity: TypeOrExtensionEntity): boolean;
|
|
25
26
|
isAspectTypeEntity(entity: TypeOrExtensionEntity): boolean;
|
|
@@ -139,6 +139,11 @@ export declare class PackageEntityDetails {
|
|
|
139
139
|
isJavaScriptPackage: JavaScriptImplementationConfig | undefined;
|
|
140
140
|
isSource: boolean;
|
|
141
141
|
isPackageWithMainFunction: boolean;
|
|
142
|
+
isTextTranslationPackage: boolean;
|
|
143
|
+
textTranslationLocale: PackageLocale | undefined;
|
|
144
|
+
translationTarget: PackageEntity | undefined;
|
|
145
|
+
thisPackageVariableEntity: VariableEntity | undefined;
|
|
146
|
+
isMainPackage: boolean;
|
|
142
147
|
}
|
|
143
148
|
export type Type = SimpleType | UnionOrIntersectionType;
|
|
144
149
|
export declare class SimpleType {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { EmitterPackage } from './Emitter.js';
|
|
2
2
|
import { EmitterContext } from './EmitterContext.js';
|
|
3
3
|
export declare class GeneralLowering {
|
|
4
|
-
private readonly
|
|
5
|
-
private readonly packages;
|
|
4
|
+
private readonly ctx;
|
|
6
5
|
constructor(ectx: EmitterContext, packages: readonly EmitterPackage[]);
|
|
7
6
|
lower(): void;
|
|
8
7
|
}
|
|
@@ -2,10 +2,11 @@ import { DeclarationsUsageMap } from '../analysis/DeclarationsUsageCounter.js';
|
|
|
2
2
|
import { Analyzer } from '../analysis/index.js';
|
|
3
3
|
import { SourceFile, SourcePackage } from '../project/index.js';
|
|
4
4
|
import * as tree from '../tree/index.js';
|
|
5
|
+
import { EmitterContext } from './EmitterContext.js';
|
|
5
6
|
import { EntityMap } from './EntityMap.js';
|
|
6
7
|
import * as ir from './ir/index.js';
|
|
7
8
|
export declare class IrBuilder {
|
|
8
|
-
private readonly
|
|
9
|
+
private readonly ectx;
|
|
9
10
|
private readonly entityMap;
|
|
10
11
|
private readonly declarationUsageInfoOfAllPackages;
|
|
11
12
|
private readonly typesCreatedFromAnonymousTypes;
|
|
@@ -15,8 +16,9 @@ export declare class IrBuilder {
|
|
|
15
16
|
private declarationsUsageInfoOfPackageSourceFiles;
|
|
16
17
|
private id;
|
|
17
18
|
private currentLoopLabel;
|
|
19
|
+
private get analyzer();
|
|
18
20
|
private get textTemplateToTextMethod();
|
|
19
|
-
constructor(
|
|
21
|
+
constructor(ectx: EmitterContext, entityMap: EntityMap, declarationUsageInfoOfAllPackages: ReadonlyMap<tree.SourceFile, DeclarationsUsageMap>);
|
|
20
22
|
build(pkg: SourcePackage): ir.Package;
|
|
21
23
|
private buildPackageMemberDeclarationList;
|
|
22
24
|
private buildPackageConstructorDeclaration;
|
|
@@ -121,7 +123,7 @@ export declare class IrBuilder {
|
|
|
121
123
|
private generateLoopLabel;
|
|
122
124
|
private buildTextTranslationDeclarationList;
|
|
123
125
|
private buildTextTranslationDeclaration;
|
|
124
|
-
private
|
|
126
|
+
private buildTextTranslationFunctionDeclaration;
|
|
125
127
|
private getSourceLocation;
|
|
126
128
|
}
|
|
127
129
|
export interface IrBuilderParams {
|