@artel/artc 0.6.25211 → 0.6.25213
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 +20 -18
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +748 -485
- package/build/{chunk-EYLAO2SF.js → chunk-6UMHRF7Y.js} +3 -3
- package/build/{chunk-Y3KGPV3L.js → chunk-X4XDV2CH.js} +10754 -10037
- package/build/{chunk-5BGDYCRQ.js → chunk-YFV3TSQP.js} +9 -8
- package/build/types/analysis/AnalyzedTranslationPackage.d.ts +3 -1
- package/build/types/analysis/Analyzer.d.ts +33 -15
- package/build/types/analysis/BaseExpressionMeaning.d.ts +8 -2
- package/build/types/analysis/CallExpressionMeaning.d.ts +6 -1
- package/build/types/analysis/DiagnosticCollector.d.ts +1 -0
- package/build/types/analysis/EntityLocalizationHelper.d.ts +3 -1
- package/build/types/analysis/IdentifierExpressionMeaning.d.ts +12 -4
- package/build/types/analysis/Lookup.d.ts +6 -2
- package/build/types/analysis/PrefixUnaryOperatorResolver.d.ts +1 -3
- package/build/types/analysis/PropertyAccessExpressionMeaning.d.ts +13 -4
- package/build/types/analysis/Scope.d.ts +17 -3
- package/build/types/analysis/SemanticContext.d.ts +18 -1
- package/build/types/analysis/SemanticContextBuilder.d.ts +2 -0
- package/build/types/analysis/StatementBlockScopeBuilder.d.ts +1 -0
- package/build/types/analysis/TypeMemberLookup.d.ts +3 -3
- package/build/types/analysis/UserDefinableBinaryOperatorResolver.d.ts +2 -2
- package/build/types/common/Cached.d.ts +1 -0
- package/build/types/common/Debug.d.ts +1 -1
- package/build/types/common/LocalizationHelper.d.ts +5 -2
- package/build/types/common/Uri.d.ts +11 -2
- package/build/types/common/index.d.ts +0 -1
- package/build/types/diagnostic/DiagnosticCode.d.ts +126 -115
- package/build/types/emitter/EmitterGeneratedDeclarationKind.d.ts +7 -0
- package/build/types/emitter/Entities.d.ts +1 -0
- package/build/types/emitter/EntityMap.d.ts +1 -2
- package/build/types/emitter/IrBuilder.d.ts +2 -0
- package/build/types/emitter/StatementTransformationResult.d.ts +3 -1
- package/build/types/emitter/ir/Nodes.d.ts +24 -22
- package/build/types/entities/OperatorEntity.d.ts +7 -9
- package/build/types/entities/OperatorKind.d.ts +19 -26
- package/build/types/entities/StructuredTypeEntity.d.ts +3 -3
- package/build/types/entities/TypeEntityMembers.d.ts +9 -14
- package/build/types/entities/TypeExtensionEntity.d.ts +0 -1
- package/build/types/entities/VariableEntity.d.ts +2 -2
- package/build/types/entities/index.d.ts +7 -12
- package/build/types/parser/Parser.d.ts +2 -2
- package/build/types/project/FileSystemTree.d.ts +1 -1
- package/build/types/services/CompletionService.d.ts +26 -20
- package/build/types/services/DisplayService.d.ts +42 -50
- package/build/types/services/NodeSemanticInfo.d.ts +6 -11
- package/build/types/services/SemanticTokensService.d.ts +4 -3
- package/build/types/tree/NodeKind.d.ts +105 -104
- package/build/types/tree/OperatorKind.d.ts +24 -7
- package/build/types/tree/green/Nodes.d.ts +28 -5
- package/build/types/tree/green/SyntaxToCode.d.ts +1 -0
- package/build/types/tree/green/Token.d.ts +4 -3
- package/build/types/tree/red/Nodes.d.ts +26 -8
- package/build/types/tree/red/Token.d.ts +3 -2
- package/build/types/types/TypeMembers.d.ts +20 -29
- package/package.json +3 -3
- package/build/types/analysis/BuiltInOperators.d.ts +0 -14
- package/build/types/common/UriTree.d.ts +0 -41
- package/build/types/entities/BinaryOperatorEntity.d.ts +0 -54
- package/build/types/entities/UnaryOperatorEntity.d.ts +0 -37
- package/build/types/parser/OperatorDictionary.d.ts +0 -11
@@ -18,5 +18,6 @@ export declare class StatementBlockScopeBuilder {
|
|
18
18
|
static buildScopeForMethodLiteral(analyzer: Analyzer, node: tree.StatementBlock, parent: tree.MethodLiteral): IScope;
|
19
19
|
static buildScopeForTypeConstructorDeclaration(analyzer: Analyzer, node: tree.StatementBlock, parent: tree.TypeConstructorDeclaration): IScope;
|
20
20
|
static buildScopeForTypeMethodDeclaration(analyzer: Analyzer, node: tree.StatementBlock, parent: tree.TypeMethodDeclaration): IScope;
|
21
|
+
static buildScopeForOperatorDeclaration(analyzer: Analyzer, node: tree.StatementBlock, parent: tree.OperatorDeclaration): IScope;
|
21
22
|
private static getLocalNamedDeclarations;
|
22
23
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { PackageLocale, Query, SearchName } from '../common/index.js';
|
2
|
-
import {
|
2
|
+
import { IEntityHidingMatcher, OperatorKind, TypeEntity } from '../entities/index.js';
|
3
3
|
import * as types from '../types/index.js';
|
4
4
|
import { Analyzer } from './Analyzer.js';
|
5
5
|
import { FoundAnonymousDeclaration, FoundNamedDeclaration } from './FoundDeclaration.js';
|
@@ -18,10 +18,10 @@ export declare class TypeMemberLookup {
|
|
18
18
|
static ofTypeEntity(analyzer: Analyzer, entity: TypeEntity, localizationContext: LocalizationContext | undefined): TypeMemberLookup;
|
19
19
|
getNamedMembers(hidingMatcher?: IEntityHidingMatcher, typeExtensionsLookup?: Lookup): Query<FoundNamedDeclaration<types.NamedTypeMember>>;
|
20
20
|
getNamedMembersByName(name: SearchName, hidingMatcher?: IEntityHidingMatcher, typeExtensionsLookup?: Lookup): Query<FoundNamedDeclaration<types.NamedTypeMember>>;
|
21
|
+
getOperators(hidingMatcher?: IEntityHidingMatcher, typeExtensionsLookup?: Lookup): Query<FoundAnonymousDeclaration<types.Operator>>;
|
22
|
+
getOperatorsByKind(kind: OperatorKind, hidingMatcher?: IEntityHidingMatcher, typeExtensionsLookup?: Lookup): Query<FoundAnonymousDeclaration<types.Operator>>;
|
21
23
|
getConstructors(hidingMatcher?: IEntityHidingMatcher, typeExtensionsLookup?: Lookup): Query<FoundAnonymousDeclaration<types.Constructor>>;
|
22
24
|
getIndexers(hidingMatcher?: IEntityHidingMatcher, typeExtensionsLookup?: Lookup): Query<FoundAnonymousDeclaration<types.Indexer>>;
|
23
25
|
getDereferenceOperators(hidingMatcher?: IEntityHidingMatcher, typeExtensionsLookup?: Lookup): Query<FoundAnonymousDeclaration<types.DereferenceOperator>>;
|
24
|
-
getBinaryOperators(kind: BinaryOperatorKind, hidingMatcher?: IEntityHidingMatcher, typeExtensionsLookup?: Lookup): Query<FoundAnonymousDeclaration<types.BinaryOperator>>;
|
25
|
-
getUnaryOperators(kind: UnaryOperatorKind, hidingMatcher?: IEntityHidingMatcher, typeExtensionsLookup?: Lookup): Query<FoundAnonymousDeclaration<types.UnaryOperator>>;
|
26
26
|
private getLocaleOfTypeEntity;
|
27
27
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { WithDiagnostics } from '../common/index.js';
|
2
|
-
import { BinaryOperatorKind } from '../entities/
|
2
|
+
import { BinaryOperatorKind } from '../entities/OperatorKind.js';
|
3
3
|
import { Expression, Node } from '../tree/index.js';
|
4
4
|
import * as types from '../types/index.js';
|
5
5
|
import { FoundAnonymousDeclaration } from './FoundDeclaration.js';
|
@@ -32,6 +32,6 @@ export declare class UserDefinableBinaryOperatorResolver {
|
|
32
32
|
private get leftType();
|
33
33
|
private get rightType();
|
34
34
|
constructor(_analyzer: Analyzer, _left: Expression, _right: Expression, _operatorKind: BinaryOperatorKind, _operatorNodeForDiagnostic: Node);
|
35
|
-
resolve(): WithDiagnostics<FoundAnonymousDeclaration<types.
|
35
|
+
resolve(): WithDiagnostics<FoundAnonymousDeclaration<types.Operator>>;
|
36
36
|
private chooseSuitableOperators;
|
37
37
|
}
|
@@ -8,6 +8,6 @@ export declare class Debug {
|
|
8
8
|
static cast<T>(_value: unknown): asserts _value is T;
|
9
9
|
static internalError(message?: string): never;
|
10
10
|
}
|
11
|
-
export type AreEqual<
|
11
|
+
export type AreEqual<A, B> = [A] extends [B] ? ([B] extends [A] ? true : false) : false;
|
12
12
|
export type IsTrue<_T extends true> = never;
|
13
13
|
export type IsNever<_T extends never> = never;
|
@@ -1,10 +1,13 @@
|
|
1
|
+
import { OperatorKind } from '../entities/OperatorKind.js';
|
1
2
|
import { ReservedIdentifierKind } from '../parser/ReservedIdentifierDictionary.js';
|
2
3
|
import * as tree from '../tree/index.js';
|
3
4
|
import { HelperPhraseKind } from './HelperPhrases.js';
|
4
5
|
import { PackageDialect, PackageLocale } from './index.js';
|
5
6
|
export declare class LocalizationHelper {
|
6
|
-
static localizeKeyword(kind: tree.KeywordKind, locale: PackageLocale, dialect
|
7
|
-
static localizeKeywordAndTakeFirst(kind: tree.KeywordKind, locale: PackageLocale, dialect
|
7
|
+
static localizeKeyword(kind: tree.KeywordKind, locale: PackageLocale, dialect?: PackageDialect): readonly string[];
|
8
|
+
static localizeKeywordAndTakeFirst(kind: tree.KeywordKind, locale: PackageLocale, dialect?: PackageDialect): string;
|
8
9
|
static localizeReservedIdentifier(kind: ReservedIdentifierKind, locale: PackageLocale): string;
|
9
10
|
static localizeHelperPhrase(kind: HelperPhraseKind, locale: PackageLocale): string;
|
11
|
+
static localizeOperatorKind(kind: OperatorKind, locale: PackageLocale, dialect?: PackageDialect): string;
|
12
|
+
static localizeSyntacticalOperatorKind(kind: tree.OperatorKind, locale: PackageLocale, dialect?: PackageDialect): string;
|
10
13
|
}
|
@@ -1,9 +1,18 @@
|
|
1
1
|
export declare class Uri {
|
2
2
|
readonly scheme: string;
|
3
|
+
readonly authority: string;
|
3
4
|
readonly segments: string[];
|
4
|
-
constructor(scheme: string, segments: string[]);
|
5
|
-
|
5
|
+
constructor(scheme: string, authority: string, segments: string[]);
|
6
|
+
/**
|
7
|
+
* @param path Путь, сегменты которого разделены прямым слэшем (`/`).
|
8
|
+
*/
|
9
|
+
static from(scheme: string, authority: string, path: string): Uri;
|
10
|
+
static empty(scheme: string, authority: string): Uri;
|
11
|
+
/**
|
12
|
+
* Создаёт Uri из текста, полученного вызовом метода `Uri.toString()`.
|
13
|
+
*/
|
6
14
|
static fromString(uri: string): Uri;
|
15
|
+
get path(): string;
|
7
16
|
isEmpty(): boolean;
|
8
17
|
isJust(segment: string): boolean;
|
9
18
|
parentUri(): Uri | undefined;
|
@@ -27,7 +27,6 @@ export * from './ThrottledCancellationToken.js';
|
|
27
27
|
export * from './TreeQuery.js';
|
28
28
|
export * from './TreeTraversal.js';
|
29
29
|
export * from './Uri.js';
|
30
|
-
export * from './UriTree.js';
|
31
30
|
export * from './UserLocale.js';
|
32
31
|
export * from './WithDiagnostics.js';
|
33
32
|
export * from './YieldExecution.js';
|
@@ -28,119 +28,130 @@ export declare enum DiagnosticCode {
|
|
28
28
|
ModifierListExpected = 26,
|
29
29
|
HidingLevelExpected = 27,
|
30
30
|
PropertyOrElementAccessExpected = 28,
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
31
|
+
NameMustNotStartWithTilde = 29,
|
32
|
+
OperatorNameCanOnlyBeUsedInOperatorDeclaration = 30,
|
33
|
+
ParameterNameCanContainOnlyOneBackQuote = 31,
|
34
|
+
FieldNameCanContainOnlyTwoBackQuote = 32,
|
35
|
+
BackQuotesCanOnlyBeUsedInParameterAndFieldNames = 33,
|
36
|
+
NameThatMatchesKeywordMustBeEnclosedInSingleQuotes = 34,
|
37
|
+
VariantNotFound = 35,
|
38
|
+
TypeCannotBeUsedAsValue = 36,
|
39
|
+
PackageMemberNotFound = 37,
|
40
|
+
CannotAccessMembersOfUnresolvedPackage = 38,
|
41
|
+
TypeMemberNotFound = 39,
|
42
|
+
OperatorNotFound = 40,
|
43
|
+
CannotAccessMembersOnMethodType = 41,
|
44
|
+
CannotAccessStaticMembersOnTypeParameter = 42,
|
45
|
+
CannotAccessStaticMembersOnUnionType = 43,
|
46
|
+
CannotAccessMembersOnUnresolvedType = 44,
|
47
|
+
CannotAccessInstanceMembersOnVariantType = 45,
|
48
|
+
CannotAccessInstanceMembersOnTypeParameterWithoutConstraint = 46,
|
49
|
+
CannotAccessIndexerOnVariantType = 47,
|
50
|
+
CannotAccessIndexerOnMethodType = 48,
|
51
|
+
CannotAccessIndexerOnTypeParameter = 49,
|
52
|
+
CannotAccessIndexerOnUnresolvedType = 50,
|
53
|
+
IndexerOfTheSpecifiedTypeNotFound = 51,
|
54
|
+
DereferenceOperatorOfTheSpecifiedTypeNotFound = 52,
|
55
|
+
IndexedGetterNotFound = 53,
|
56
|
+
IndexedSetterNotFound = 54,
|
57
|
+
IndexerNotFound = 55,
|
58
|
+
CannotCreateInstanceOfAspect = 56,
|
59
|
+
CannotCreateInstanceOfVariantType = 57,
|
60
|
+
CannotCreateInstanceOfMethodType = 58,
|
61
|
+
CannotCreateInstanceOfTypeParameter = 59,
|
62
|
+
CannotCreateInstanceOfUnresolvedType = 60,
|
63
|
+
CannotCreateInstanceOfInvalidType = 61,
|
64
|
+
TypeConstructorNotFound = 62,
|
65
|
+
CannotInvokeExpression = 63,
|
66
|
+
NamedArgumentExpectedButPositionalArgumentFound = 64,
|
67
|
+
ParameterWithGivenNameNotFound = 65,
|
68
|
+
ArgumentForParameterAlreadyPassed = 66,
|
69
|
+
PackageAliasCannotBeUsedAsValue = 67,
|
70
|
+
PackageNameCannotBeUsedAsValue = 68,
|
71
|
+
UnknownVariable = 69,
|
72
|
+
UnknownType = 70,
|
73
|
+
TypeWithArity0NotFound = 71,
|
74
|
+
CannotAccessMembersOnInvalidType = 72,
|
75
|
+
CannotAccessIndexerOnInvalidType = 73,
|
76
|
+
VariableUsedBeforeBeingDeclared = 74,
|
77
|
+
Type0IsNotAssignableToType1 = 75,
|
78
|
+
VariableNotFound = 76,
|
79
|
+
MethodNotFound = 77,
|
80
|
+
PackageAliasNotFound = 78,
|
81
|
+
VariantAliasExpected = 79,
|
82
|
+
UnknownPackage = 80,
|
83
|
+
CannotAssignValueToExpression = 81,
|
84
|
+
NotEveryRequiredParameterIsProvidedWithCallArgument = 82,
|
85
|
+
ParameterForPositionalCallArgumentNotFound = 83,
|
86
|
+
AliasTypeAliasMustNotContainMemberAliases = 84,
|
87
|
+
InvalidTypeAliasMustNotContainMemberAliases = 85,
|
88
|
+
CannotUseSpecialNameForLocalDeclaration = 86,
|
89
|
+
SpecialNameIsNotAllowed = 87,
|
90
|
+
MultipleValuesFound = 88,
|
91
|
+
CannotDetermineTargetTypeToCallTheConstructor = 89,
|
92
|
+
AmbiguousAccess = 90,
|
93
|
+
PackageNameConflictsWithDeclarationName = 91,
|
94
|
+
CannotAccessVariableDueToItsAccessibilityLevel = 92,
|
95
|
+
CannotAccessMethodDueToItsAccessibilityLevel = 93,
|
96
|
+
CannotAccessTypeDueToItsAccessibilityLevel = 94,
|
97
|
+
CanNotAssignValueToContextVariable = 95,
|
98
|
+
ExpectedPackageNameOrAliasButFoundType = 96,
|
99
|
+
TypeExpected = 97,
|
100
|
+
TypeOrPackageNotFound = 98,
|
101
|
+
TypeIsNotATag = 99,
|
102
|
+
ExpressionOfType0CanNotBeUsedForEnumeration = 100,
|
103
|
+
Operator0IsNotDefinedForTypes1And2 = 101,
|
104
|
+
Operator0IsNotDefinedForType1 = 102,
|
105
|
+
VariantMustHaveAssociatedValue = 103,
|
106
|
+
AssociatedValueMustBeANumberOrTextLiteral = 104,
|
107
|
+
PackageMemberOrPackageNotFound = 105,
|
108
|
+
TranslationsCanOnlyBeDeclaredInTranslationPackage = 106,
|
109
|
+
UnknownTranslatedPackage0 = 107,
|
110
|
+
BaseCannotBeUsedInThisContext = 108,
|
111
|
+
OverriddenMethodNotFound = 109,
|
112
|
+
ObjectCannotBeUsedInThisContext = 110,
|
113
|
+
BaseCannotBeUsedAsAnExpressionInItself = 111,
|
114
|
+
InterfacePackageMustNotContainImplementation = 112,
|
115
|
+
InterfacePackageVariablesMustNotHaveInitializers = 113,
|
116
|
+
InterfacePackageVariablesMustNotHaveAccessors = 114,
|
117
|
+
InterfacePackageIndexersMustNotHaveAccessors = 115,
|
118
|
+
BodyIsMissing = 116,
|
119
|
+
AbstractTypeMembersMustNotHaveBody = 117,
|
120
|
+
AbstractIndexersMustNotHaveAccessors = 118,
|
121
|
+
AbstractVariablesMustNotHaveInitializers = 119,
|
122
|
+
AbstractVariablesMustNotHaveAccessors = 120,
|
123
|
+
AccessorsAreMissing = 121,
|
124
|
+
PackageIsAlreadyImportedInAnotherLanguage = 122,
|
125
|
+
OnlySubprogramsWithReturnTypeCanReturnValue = 123,
|
126
|
+
MethodsUsingYieldStatementCanNotReturnValue = 124,
|
127
|
+
YieldStatementCanNotBeUsedInAnonymousMethods = 125,
|
128
|
+
YieldStatementCanNotBeUsedHere = 126,
|
129
|
+
MethodsUsingYieldStatementMustHaveEnumerableAsReturnType = 127,
|
130
|
+
YieldStatementCanNotBeUsedInRunStatementThatHasOnErrorClause = 128,
|
131
|
+
YieldStatementCanNotBeUsedInFinallyClause = 129,
|
132
|
+
SubprogramMustReturnValue = 130,
|
133
|
+
ResultVariableCanNotBeUsedInMethodsUsingYieldStatement = 131,
|
134
|
+
TypeAliasReferencesItself = 132,
|
135
|
+
TypeParameterHasCircularConstraint = 133,
|
136
|
+
BaseTypeCausesInheritanceCycle = 134,
|
137
|
+
OnlyGenericTypesAndFunctionsCanBeSpecialized = 135,
|
138
|
+
Expected0TypeArguments = 136,
|
139
|
+
ExpectedFrom0To1TypeArguments = 137,
|
140
|
+
Type0IsNotAssignableToConstraint1 = 138,
|
141
|
+
VariableIsDeclaredButNotUsed = 139,
|
142
|
+
DefaultConstructorArgumentsMustBeNamed = 140,
|
143
|
+
IncorrectBodyOfRedefinableAliasTypeMethod = 141,
|
144
|
+
TheFollowingDeclarationsAreNotTranslated0 = 142,
|
145
|
+
TheFollowingDeclarationAreNotTranslated0And1More = 143,
|
146
|
+
OperatorMustNotBeStatic = 144,
|
147
|
+
Operator0MustNotHaveParameters = 145,
|
148
|
+
Operator0MustHaveOneParameter = 146,
|
149
|
+
Operator0MustHaveNoMoreThanOneParameter = 147,
|
150
|
+
CanNotFindTsLibDirectoryBaseSearchPaths0 = 148,
|
151
|
+
SourceFile0IsNotPartOfThePackageAndWontBeLoaded = 149,
|
152
|
+
MainPackageConfigurationIsMissingProjectWontBeLoaded = 150,
|
153
|
+
ProgramWithoutMainPackageCanNotBeCompiled = 151,
|
154
|
+
JsonConfigurationValidationError = 152,
|
155
|
+
StandardPackage0NotFound = 153,
|
156
|
+
Declaration0NotFoundInStandardPackage1 = 154
|
146
157
|
}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { PackageLocale } from '../common/index.js';
|
2
|
+
import { OperatorKind } from '../entities/OperatorKind.js';
|
2
3
|
export declare const enum EmitterGeneratedDeclarationKind {
|
3
4
|
MainFunction = 0,
|
4
5
|
PackageConstructor = 1,
|
@@ -38,6 +39,11 @@ export declare const emitterGeneratedDeclarationNamesByLocale: {
|
|
38
39
|
[T in EmitterGeneratedDeclarationKind]: string;
|
39
40
|
};
|
40
41
|
};
|
42
|
+
export declare const operatorNamesByLocale: {
|
43
|
+
[T in PackageLocale]: {
|
44
|
+
[T in OperatorKind]: string;
|
45
|
+
};
|
46
|
+
};
|
41
47
|
export declare class EmitPhaseName {
|
42
48
|
static ofMainFunction(locale: PackageLocale): string;
|
43
49
|
static ofPackageConstructor(locale: PackageLocale): string;
|
@@ -71,4 +77,5 @@ export declare class EmitPhaseName {
|
|
71
77
|
static ofProxyVariable(locale: PackageLocale, originalName: string): string;
|
72
78
|
static ofTypeConstructor(locale: PackageLocale): string;
|
73
79
|
static ofTypeExtension(locale: PackageLocale, extendedTypeName: string): string;
|
80
|
+
static ofOperator(locale: PackageLocale, kind: OperatorKind): string;
|
74
81
|
}
|
@@ -27,6 +27,7 @@ export declare class MethodEntityDetails {
|
|
27
27
|
isEnumeratorMethod: boolean;
|
28
28
|
isDefaultExport: boolean;
|
29
29
|
isFormerInstanceAliasTypeOrExtensionMember: boolean;
|
30
|
+
isBuiltInOperator: boolean;
|
30
31
|
}
|
31
32
|
export interface VariableEntity {
|
32
33
|
readonly kind: 'variable';
|
@@ -22,12 +22,11 @@ export declare class EntityMap {
|
|
22
22
|
getVariableEntity(entity: analyzerEntities.VariableEntity): emitterEntities.VariableEntity;
|
23
23
|
getVariantEntity(entity: analyzerEntities.VariantEntity): emitterEntities.VariableEntity;
|
24
24
|
getMethodEntity(entity: analyzerEntities.MethodEntity): emitterEntities.MethodEntity;
|
25
|
+
getOperatorEntity(entity: analyzerEntities.OperatorEntity): emitterEntities.MethodEntity;
|
25
26
|
getConstructorEntity(entity: analyzerEntities.ConstructorEntity): emitterEntities.MethodEntity;
|
26
27
|
getDestructorEntity(entity: analyzerEntities.DestructorEntity): emitterEntities.MethodEntity;
|
27
28
|
getGetterEntity(entity: analyzerEntities.GetterEntity): emitterEntities.MethodEntity;
|
28
29
|
getSetterEntity(entity: analyzerEntities.SetterEntity): emitterEntities.MethodEntity;
|
29
|
-
getUnaryOperatorEntity(entity: analyzerEntities.UnaryOperatorEntity): emitterEntities.MethodEntity;
|
30
|
-
getBinaryOperatorEntity(entity: analyzerEntities.BinaryOperatorEntity): emitterEntities.MethodEntity;
|
31
30
|
getStructuredTypeEntity(entity: analyzerEntities.StructuredTypeEntity): emitterEntities.TypeOrExtensionEntity;
|
32
31
|
getVariantTypeEntity(entity: analyzerEntities.VariantTypeEntity): emitterEntities.TypeOrExtensionEntity;
|
33
32
|
getTypeParameterEntity(entity: analyzerEntities.TypeParameterEntity): emitterEntities.TypeOrExtensionEntity;
|
@@ -44,6 +44,7 @@ export declare class IrBuilder {
|
|
44
44
|
private buildTypeDereferencedVariableGetterDeclaration;
|
45
45
|
private buildTypeDereferencedVariableSetterDeclaration;
|
46
46
|
private buildTypeMethodDeclaration;
|
47
|
+
private buildOperatorDeclaration;
|
47
48
|
private buildTypeVariableDeclaration;
|
48
49
|
private buildTypeVariableGetterDeclaration;
|
49
50
|
private buildTypeVariableSetterDeclaration;
|
@@ -105,6 +106,7 @@ export declare class IrBuilder {
|
|
105
106
|
private buildAnonymousStructuredTypeDeclaration;
|
106
107
|
private buildAnonymousVariantTypeDeclaration;
|
107
108
|
private getUnderlyingTypeKind;
|
109
|
+
private createAccessedMethodFromOperator;
|
108
110
|
private expressionIsCallee;
|
109
111
|
private generateLoopLabel;
|
110
112
|
private getSourceLocation;
|
@@ -7,13 +7,15 @@ export declare const enum Kind {
|
|
7
7
|
}
|
8
8
|
export type Type = {
|
9
9
|
kind: Kind.Preserve;
|
10
|
+
hoistedLocalVariables?: readonly VariableEntity[];
|
10
11
|
} | {
|
11
12
|
kind: Kind.Replace;
|
12
13
|
statement: Statement;
|
13
14
|
hoistedLocalVariables?: readonly VariableEntity[];
|
14
15
|
} | {
|
15
16
|
kind: Kind.Remove;
|
17
|
+
hoistedLocalVariables: undefined;
|
16
18
|
};
|
17
|
-
export declare function preserve(): Type;
|
19
|
+
export declare function preserve(hoistedLocalVariables?: readonly VariableEntity[]): Type;
|
18
20
|
export declare function replace(statement: Statement, hoistedLocalVariables?: readonly VariableEntity[]): Type;
|
19
21
|
export declare function remove(): Type;
|
@@ -31,32 +31,26 @@ export declare class AssertionExpression {
|
|
31
31
|
}
|
32
32
|
export declare class AssignmentExpression {
|
33
33
|
left: LValueExpression;
|
34
|
-
|
34
|
+
operatorKind: AssignmentOperatorKind;
|
35
35
|
right: Expression;
|
36
|
+
operator: AccessedMethod | undefined;
|
36
37
|
sourceLocation: SourceLocation | undefined;
|
37
38
|
loweringOptions: AssignmentLoweringOptions;
|
38
39
|
readonly kind = NodeKind.AssignmentExpression;
|
39
|
-
constructor(left: LValueExpression,
|
40
|
+
constructor(left: LValueExpression, operatorKind: AssignmentOperatorKind, right: Expression, operator: AccessedMethod | undefined, sourceLocation: SourceLocation | undefined, loweringOptions?: AssignmentLoweringOptions);
|
40
41
|
clone(): AssignmentExpression;
|
41
42
|
}
|
42
43
|
export declare class AssignmentStatement {
|
43
44
|
left: LValueExpression;
|
44
|
-
|
45
|
+
operatorKind: AssignmentOperatorKind;
|
45
46
|
right: Expression;
|
47
|
+
operator: AccessedMethod | undefined;
|
46
48
|
sourceLocation: SourceLocation | undefined;
|
47
49
|
loweringOptions: AssignmentLoweringOptions;
|
48
50
|
readonly kind = NodeKind.AssignmentStatement;
|
49
|
-
constructor(left: LValueExpression,
|
51
|
+
constructor(left: LValueExpression, operatorKind: AssignmentOperatorKind, right: Expression, operator: AccessedMethod | undefined, sourceLocation: SourceLocation | undefined, loweringOptions?: AssignmentLoweringOptions);
|
50
52
|
clone(): AssignmentStatement;
|
51
53
|
}
|
52
|
-
export declare const enum AssignmentOperator {
|
53
|
-
Equals = 0,
|
54
|
-
AddEquals = 1,
|
55
|
-
SubtractEquals = 2,
|
56
|
-
MultiplyEquals = 3,
|
57
|
-
DivideEquals = 4,
|
58
|
-
IntegerDivideEquals = 5
|
59
|
-
}
|
60
54
|
export declare class AssumptionExpression {
|
61
55
|
expression: Expression;
|
62
56
|
sourceLocation: SourceLocation | undefined;
|
@@ -81,12 +75,13 @@ export declare class BaseExpression {
|
|
81
75
|
}
|
82
76
|
export declare class BinaryExpression {
|
83
77
|
left: Expression;
|
84
|
-
|
78
|
+
operatorKind: BinaryExpressionOperatorKind;
|
85
79
|
right: Expression;
|
86
80
|
type: Type;
|
81
|
+
operator: AccessedMethod | undefined;
|
87
82
|
sourceLocation: SourceLocation | undefined;
|
88
83
|
readonly kind = NodeKind.BinaryExpression;
|
89
|
-
constructor(left: Expression,
|
84
|
+
constructor(left: Expression, operatorKind: BinaryExpressionOperatorKind, right: Expression, type: Type, operator: AccessedMethod | undefined, sourceLocation: SourceLocation | undefined);
|
90
85
|
clone(): BinaryExpression;
|
91
86
|
}
|
92
87
|
export declare class BlockStatement {
|
@@ -256,9 +251,6 @@ export declare class IfStatement {
|
|
256
251
|
constructor(condition: Expression, thenStatement: BlockStatement, elseStatement: BlockStatement | undefined, sourceLocation: SourceLocation | undefined);
|
257
252
|
clone(): IfStatement;
|
258
253
|
}
|
259
|
-
export declare const enum ImplicitConversionKind {
|
260
|
-
TextTemplateToText = 0
|
261
|
-
}
|
262
254
|
export declare class IndexedAccessExpression {
|
263
255
|
expression: Expression;
|
264
256
|
isOptionalChaining: boolean;
|
@@ -490,9 +482,10 @@ export declare class NoneLiteral {
|
|
490
482
|
}
|
491
483
|
export declare class NotExpression {
|
492
484
|
expression: Expression;
|
485
|
+
operator: AccessedMethod | undefined;
|
493
486
|
sourceLocation: SourceLocation | undefined;
|
494
487
|
readonly kind = NodeKind.NotExpression;
|
495
|
-
constructor(expression: Expression, sourceLocation: SourceLocation | undefined);
|
488
|
+
constructor(expression: Expression, operator: AccessedMethod | undefined, sourceLocation: SourceLocation | undefined);
|
496
489
|
clone(): NotExpression;
|
497
490
|
}
|
498
491
|
export declare class NumericLiteral {
|
@@ -592,11 +585,12 @@ export declare class VariantDeclaration {
|
|
592
585
|
clone(): VariantDeclaration;
|
593
586
|
}
|
594
587
|
export declare class PrefixUnaryExpression {
|
595
|
-
|
588
|
+
operatorKind: PrefixUnaryExpressionOperatorKind;
|
596
589
|
expression: Expression;
|
590
|
+
operator: AccessedMethod | undefined;
|
597
591
|
sourceLocation: SourceLocation | undefined;
|
598
592
|
readonly kind = NodeKind.PrefixUnaryExpression;
|
599
|
-
constructor(
|
593
|
+
constructor(operatorKind: PrefixUnaryExpressionOperatorKind, expression: Expression, operator: AccessedMethod | undefined, sourceLocation: SourceLocation | undefined);
|
600
594
|
clone(): PrefixUnaryExpression;
|
601
595
|
}
|
602
596
|
export declare class ReferenceExpression {
|
@@ -981,12 +975,20 @@ export declare const enum NodeKind {
|
|
981
975
|
TypeDereferencedVariableSetterDeclaration = 93,
|
982
976
|
JsNamespaceDestructuringStatement = 94
|
983
977
|
}
|
984
|
-
export declare const enum
|
978
|
+
export declare const enum AssignmentOperatorKind {
|
979
|
+
Equals = 0,
|
980
|
+
AddEquals = 1,
|
981
|
+
SubtractEquals = 2,
|
982
|
+
MultiplyEquals = 3,
|
983
|
+
DivideEquals = 4,
|
984
|
+
IntegerDivideEquals = 5
|
985
|
+
}
|
986
|
+
export declare const enum PrefixUnaryExpressionOperatorKind {
|
985
987
|
Plus = 0,
|
986
988
|
Minus = 1,
|
987
989
|
BitwiseNot = 2
|
988
990
|
}
|
989
|
-
export declare const enum
|
991
|
+
export declare const enum BinaryExpressionOperatorKind {
|
990
992
|
Add = 0,
|
991
993
|
Subtract = 1,
|
992
994
|
Multiply = 2,
|
@@ -1,15 +1,13 @@
|
|
1
1
|
import { Analyzer } from '../analysis/index.js';
|
2
2
|
import { Tag } from '../analysis/Tags.js';
|
3
|
-
import
|
4
|
-
import { TypeMethodDeclaration } from '../tree/index.js';
|
3
|
+
import * as tree from '../tree/index.js';
|
5
4
|
import * as types from '../types/index.js';
|
6
5
|
import { DefinitionKind, EntityHidingLevel, EntityKind, OperatorKind, ParameterVariableEntity, TypeMemberEntityContainer } from './index.js';
|
7
6
|
export interface OperatorEntity {
|
8
7
|
readonly kind: EntityKind.Operator;
|
9
8
|
getOperatorKind(): OperatorKind;
|
10
|
-
getName(): Name;
|
11
9
|
getValueParameters(): readonly ParameterVariableEntity[];
|
12
|
-
|
10
|
+
getReturnType(): types.Type;
|
13
11
|
getDefinition(): OperatorDefinition;
|
14
12
|
getContainer(): TypeMemberEntityContainer;
|
15
13
|
isStatic(): boolean;
|
@@ -21,19 +19,18 @@ export interface OperatorEntity {
|
|
21
19
|
}
|
22
20
|
export type OperatorDefinition = {
|
23
21
|
kind: DefinitionKind.Source;
|
24
|
-
node:
|
22
|
+
node: tree.OperatorDeclaration;
|
25
23
|
};
|
26
24
|
export declare class OperatorDeclarationEntity implements OperatorEntity {
|
27
25
|
private readonly _analyzer;
|
28
26
|
private readonly _node;
|
29
|
-
private readonly _operatorKind;
|
30
27
|
readonly kind = EntityKind.Operator;
|
28
|
+
private readonly _operatorKind;
|
31
29
|
private readonly _valueParameters;
|
32
|
-
constructor(_analyzer: Analyzer, _node:
|
30
|
+
constructor(_analyzer: Analyzer, _node: tree.OperatorDeclaration);
|
33
31
|
getOperatorKind(): OperatorKind;
|
34
|
-
getName(): Name;
|
35
32
|
getValueParameters(): readonly ParameterVariableEntity[];
|
36
|
-
|
33
|
+
getReturnType(): types.Type;
|
37
34
|
getDefinition(): OperatorDefinition;
|
38
35
|
getContainer(): TypeMemberEntityContainer;
|
39
36
|
isStatic(): boolean;
|
@@ -42,4 +39,5 @@ export declare class OperatorDeclarationEntity implements OperatorEntity {
|
|
42
39
|
isAbstract(): boolean;
|
43
40
|
isHidden(): EntityHidingLevel | undefined;
|
44
41
|
getTags(): readonly Tag[];
|
42
|
+
private convertSyntaxOperatorKind;
|
45
43
|
}
|