@artel/artc 0.6.25210 → 0.6.25212

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/build/Cli.js +3 -3
  2. package/build/api/Api.js +26 -14
  3. package/build/api/ApiNodeJS.js +3 -3
  4. package/build/api/ApiServices.js +774 -526
  5. package/build/{chunk-3ORG7RXI.js → chunk-DYVLHEXS.js} +11186 -10587
  6. package/build/{chunk-CAQIZO5K.js → chunk-MRSDFDBD.js} +9 -8
  7. package/build/{chunk-HRQLSHI7.js → chunk-XGS3PSIF.js} +3 -3
  8. package/build/types/analysis/AnalyzedTranslationPackage.d.ts +3 -1
  9. package/build/types/analysis/Analyzer.d.ts +33 -16
  10. package/build/types/analysis/BaseExpressionMeaning.d.ts +8 -2
  11. package/build/types/analysis/CallExpressionMeaning.d.ts +6 -1
  12. package/build/types/analysis/DiagnosticCollector.d.ts +1 -0
  13. package/build/types/analysis/EntityLocalizationHelper.d.ts +3 -1
  14. package/build/types/analysis/IdentifierExpressionMeaning.d.ts +12 -4
  15. package/build/types/analysis/Lookup.d.ts +6 -2
  16. package/build/types/analysis/PrefixUnaryOperatorResolver.d.ts +1 -3
  17. package/build/types/analysis/PropertyAccessExpressionMeaning.d.ts +13 -4
  18. package/build/types/analysis/Scope.d.ts +17 -3
  19. package/build/types/analysis/SemanticContext.d.ts +18 -1
  20. package/build/types/analysis/SemanticContextBuilder.d.ts +2 -0
  21. package/build/types/analysis/StatementBlockScopeBuilder.d.ts +1 -0
  22. package/build/types/analysis/TypeMemberLookup.d.ts +3 -3
  23. package/build/types/analysis/UserDefinableBinaryOperatorResolver.d.ts +2 -2
  24. package/build/types/common/Cached.d.ts +1 -0
  25. package/build/types/common/Debug.d.ts +3 -0
  26. package/build/types/common/LocalizationHelper.d.ts +5 -2
  27. package/build/types/common/Logger.d.ts +1 -1
  28. package/build/types/common/Uri.d.ts +11 -2
  29. package/build/types/common/index.d.ts +0 -1
  30. package/build/types/diagnostic/DiagnosticCode.d.ts +126 -115
  31. package/build/types/emitter/EmitterGeneratedDeclarationKind.d.ts +7 -0
  32. package/build/types/emitter/Entities.d.ts +1 -0
  33. package/build/types/emitter/EntityMap.d.ts +1 -2
  34. package/build/types/emitter/IrBuilder.d.ts +2 -0
  35. package/build/types/emitter/StatementTransformationResult.d.ts +3 -1
  36. package/build/types/emitter/Transformer.d.ts +1 -1
  37. package/build/types/emitter/ir/Nodes.d.ts +38 -34
  38. package/build/types/entities/EntityHiding.d.ts +2 -2
  39. package/build/types/entities/OperatorEntity.d.ts +43 -0
  40. package/build/types/entities/OperatorKind.d.ts +56 -0
  41. package/build/types/entities/StructuredTypeEntity.d.ts +3 -3
  42. package/build/types/entities/TypeEntityMembers.d.ts +9 -14
  43. package/build/types/entities/TypeExtensionEntity.d.ts +0 -1
  44. package/build/types/entities/VariableEntity.d.ts +3 -13
  45. package/build/types/entities/index.d.ts +10 -12
  46. package/build/types/parser/Parser.d.ts +2 -2
  47. package/build/types/project/FileSystemTree.d.ts +1 -1
  48. package/build/types/services/CompletionService.d.ts +26 -20
  49. package/build/types/services/DisplayService.d.ts +47 -55
  50. package/build/types/services/NodeSemanticInfo.d.ts +6 -11
  51. package/build/types/services/SemanticTokensService.d.ts +4 -3
  52. package/build/types/tree/KeywordKind.d.ts +25 -29
  53. package/build/types/tree/NodeKind.d.ts +89 -92
  54. package/build/types/tree/OperatorKind.d.ts +40 -0
  55. package/build/types/tree/green/Nodes.d.ts +52 -85
  56. package/build/types/tree/green/SyntaxToCode.d.ts +1 -0
  57. package/build/types/tree/green/Token.d.ts +7 -5
  58. package/build/types/tree/green/index.d.ts +1 -0
  59. package/build/types/tree/index.d.ts +0 -3
  60. package/build/types/tree/red/Nodes.d.ts +44 -78
  61. package/build/types/tree/red/Token.d.ts +3 -2
  62. package/build/types/tree/red/index.d.ts +4 -0
  63. package/build/types/ts-interop/Entities.d.ts +0 -4
  64. package/build/types/types/TypeMembers.d.ts +20 -29
  65. package/package.json +6 -6
  66. package/build/types/analysis/BuiltInOperators.d.ts +0 -14
  67. package/build/types/common/UriTree.d.ts +0 -41
  68. package/build/types/emitter/IntrinsicEntities.d.ts +0 -118
  69. package/build/types/entities/BinaryOperatorEntity.d.ts +0 -51
  70. package/build/types/entities/UnaryOperatorEntity.d.ts +0 -36
  71. /package/build/types/emitter/{error-boundary.d.ts → ErrorBoundary.d.ts} +0 -0
@@ -26,7 +26,7 @@ export interface SemanticContext {
26
26
  getScopeLookup(): Lookup;
27
27
  getHidingMatcher(): IEntityHidingMatcher;
28
28
  }
29
- export type SubprogramInfo = SubprogramInfo.Method | SubprogramInfo.Constructor | SubprogramInfo.Destructor | SubprogramInfo.Getter | SubprogramInfo.Setter | SubprogramInfo.PackageConstructor | SubprogramInfo.PackageEntryPoint | SubprogramInfo.MethodLiteral;
29
+ export type SubprogramInfo = SubprogramInfo.Method | SubprogramInfo.Operator | SubprogramInfo.Constructor | SubprogramInfo.Destructor | SubprogramInfo.Getter | SubprogramInfo.Setter | SubprogramInfo.PackageConstructor | SubprogramInfo.PackageEntryPoint | SubprogramInfo.MethodLiteral;
30
30
  export declare namespace SubprogramInfo {
31
31
  export class Method implements ISubprogramInfo {
32
32
  readonly kind = "method";
@@ -36,6 +36,14 @@ export declare namespace SubprogramInfo {
36
36
  getReturnType(): types.Type | undefined;
37
37
  isGenerator(): boolean;
38
38
  }
39
+ export class Operator implements ISubprogramInfo {
40
+ readonly kind = "operator";
41
+ private readonly _analyzer;
42
+ private readonly _node;
43
+ constructor(analyzer: Analyzer, node: tree.OperatorDeclaration);
44
+ getReturnType(): types.Type | undefined;
45
+ isGenerator(): boolean;
46
+ }
39
47
  export class Constructor implements ISubprogramInfo {
40
48
  readonly kind = "constructor";
41
49
  private readonly _analyzer;
@@ -240,6 +248,15 @@ export declare class PackageEntryPointSemanticContext extends SemanticContextWit
240
248
  constructor(analyzer: Analyzer, node: tree.PackageEntryPointDeclaration, parentContext: SemanticContext);
241
249
  getContainingSubprogram(): SubprogramInfo | undefined;
242
250
  }
251
+ export declare class OperatorSemanticContext extends SemanticContextWithParent {
252
+ private readonly _analyzer;
253
+ private readonly _node;
254
+ private readonly _scopeChain;
255
+ private readonly _subprogramInfo;
256
+ constructor(analyzer: Analyzer, node: tree.OperatorDeclaration, parentContext: SemanticContext);
257
+ getScopeChain(): ScopeChain;
258
+ getContainingSubprogram(): SubprogramInfo | undefined;
259
+ }
243
260
  export declare class ConstructorSemanticContext extends SemanticContextWithParent {
244
261
  private readonly _analyzer;
245
262
  private readonly _node;
@@ -20,6 +20,7 @@ export declare class SemanticContextBuilder {
20
20
  * Контекст заголовка метода. Включает параметры-типы и параметры-значения (в зависимости от указанного `hint`).
21
21
  */
22
22
  ofMethodDeclarationHeader(node: MethodDeclaration, hint: 'type-parameters' | 'value-parameters'): SemanticContext;
23
+ ofOperatorDeclaration(node: tree.OperatorDeclaration): SemanticContext;
23
24
  ofTypeDeclarationBody(node: TypeDeclarationBody): SemanticContext;
24
25
  /**
25
26
  * Контекст заголовка типа. Включает параметры типа.
@@ -44,6 +45,7 @@ export declare class SemanticContextBuilder {
44
45
  private ofChildOfTypeDeclarationBodyWithMemberBlock;
45
46
  private ofChildOfMethodTypeDeclarationBody;
46
47
  private ofChildOfMethodLiteral;
48
+ private ofOperatorDeclarationChild;
47
49
  private ofTypeConstructorDeclarationChild;
48
50
  private ofTypeDestructorDeclarationChild;
49
51
  private ofTypeIndexedGetterDeclarationChild;
@@ -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 { BinaryOperatorKind, IEntityHidingMatcher, TypeEntity, UnaryOperatorKind } from '../entities/index.js';
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/index.js';
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.BinaryOperator>>;
35
+ resolve(): WithDiagnostics<FoundAnonymousDeclaration<types.Operator>>;
36
36
  private chooseSuitableOperators;
37
37
  }
@@ -1,6 +1,7 @@
1
1
  export declare class Cached<T> {
2
2
  private _hasValue;
3
3
  private _value?;
4
+ private _isEvaluating;
4
5
  getOrInsertWith(fn: () => T): T;
5
6
  clear(): void;
6
7
  }
@@ -8,3 +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<A, B> = [A] extends [B] ? ([B] extends [A] ? true : false) : false;
12
+ export type IsTrue<_T extends true> = never;
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: PackageDialect): readonly string[];
7
- static localizeKeywordAndTakeFirst(kind: tree.KeywordKind, locale: PackageLocale, dialect: PackageDialect): string;
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,4 +1,4 @@
1
- import { EmitterError } from '../emitter/error-boundary.js';
1
+ import { EmitterError } from '../emitter/ErrorBoundary.js';
2
2
  import { Node } from '../tree/index.js';
3
3
  export declare class Logger {
4
4
  static info(message: string): void;
@@ -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
- static empty(scheme: string): Uri;
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
- VariantNotFound = 29,
32
- TypeCannotBeUsedAsValue = 30,
33
- PackageMemberNotFound = 31,
34
- CannotAccessMembersOfUnresolvedPackage = 32,
35
- TypeMemberNotFound = 33,
36
- CannotAccessMembersOnMethodType = 34,
37
- CannotAccessStaticMembersOnTypeParameter = 35,
38
- CannotAccessStaticMembersOnUnionType = 36,
39
- CannotAccessMembersOnUnresolvedType = 37,
40
- CannotAccessInstanceMembersOnVariantType = 38,
41
- CannotAccessInstanceMembersOnTypeParameterWithoutConstraint = 39,
42
- CannotAccessIndexerOnVariantType = 40,
43
- CannotAccessIndexerOnMethodType = 41,
44
- CannotAccessIndexerOnTypeParameter = 42,
45
- CannotAccessIndexerOnUnresolvedType = 43,
46
- IndexerOfTheSpecifiedTypeNotFound = 44,
47
- DereferenceOperatorOfTheSpecifiedTypeNotFound = 45,
48
- IndexedGetterNotFound = 46,
49
- IndexedSetterNotFound = 47,
50
- IndexerNotFound = 48,
51
- CannotCreateInstanceOfAspect = 49,
52
- CannotCreateInstanceOfVariantType = 50,
53
- CannotCreateInstanceOfMethodType = 51,
54
- CannotCreateInstanceOfTypeParameter = 52,
55
- CannotCreateInstanceOfUnresolvedType = 53,
56
- CannotCreateInstanceOfInvalidType = 54,
57
- TypeConstructorNotFound = 55,
58
- CannotInvokeExpression = 56,
59
- NamedArgumentExpectedButPositionalArgumentFound = 57,
60
- ParameterWithGivenNameNotFound = 58,
61
- ArgumentForParameterAlreadyPassed = 59,
62
- PackageAliasCannotBeUsedAsValue = 60,
63
- PackageNameCannotBeUsedAsValue = 61,
64
- UnknownVariable = 62,
65
- UnknownType = 63,
66
- TypeWithArity0NotFound = 64,
67
- CannotAccessMembersOnInvalidType = 65,
68
- CannotAccessIndexerOnInvalidType = 66,
69
- VariableUsedBeforeBeingDeclared = 67,
70
- Type0IsNotAssignableToType1 = 68,
71
- VariableNotFound = 69,
72
- MethodNotFound = 70,
73
- PackageAliasNotFound = 71,
74
- VariantAliasExpected = 72,
75
- UnknownPackage = 73,
76
- CannotAssignValueToExpression = 74,
77
- NotEveryRequiredParameterIsProvidedWithCallArgument = 75,
78
- ParameterForPositionalCallArgumentNotFound = 76,
79
- AliasTypeAliasMustNotContainMemberAliases = 77,
80
- InvalidTypeAliasMustNotContainMemberAliases = 78,
81
- CannotUseSpecialNameForLocalDeclaration = 79,
82
- SpecialNameIsNotAllowed = 80,
83
- MultipleValuesFound = 81,
84
- CannotDetermineTargetTypeToCallTheConstructor = 82,
85
- AmbiguousAccess = 83,
86
- PackageNameConflictsWithDeclarationName = 84,
87
- CannotAccessVariableDueToItsAccessibilityLevel = 85,
88
- CannotAccessMethodDueToItsAccessibilityLevel = 86,
89
- CannotAccessTypeDueToItsAccessibilityLevel = 87,
90
- CanNotAssignValueToContextVariable = 88,
91
- ExpectedPackageNameOrAliasButFoundType = 89,
92
- TypeExpected = 90,
93
- TypeOrPackageNotFound = 91,
94
- TypeIsNotATag = 92,
95
- ExpressionOfType0CanNotBeUsedForEnumeration = 93,
96
- Operator0IsNotDefinedForTypes1And2 = 94,
97
- Operator0IsNotDefinedForType1 = 95,
98
- VariantMustHaveAssociatedValue = 96,
99
- AssociatedValueMustBeANumberOrTextLiteral = 97,
100
- PackageMemberOrPackageNotFound = 98,
101
- TranslationsCanOnlyBeDeclaredInTranslationPackage = 99,
102
- UnknownTranslatedPackage0 = 100,
103
- BaseCannotBeUsedInThisContext = 101,
104
- OverriddenMethodNotFound = 102,
105
- ObjectCannotBeUsedInThisContext = 103,
106
- BaseCannotBeUsedAsAnExpressionInItself = 104,
107
- InterfacePackageMustNotContainImplementation = 105,
108
- InterfacePackageVariablesMustNotHaveInitializers = 106,
109
- InterfacePackageVariablesMustNotHaveAccessors = 107,
110
- InterfacePackageIndexersMustNotHaveAccessors = 108,
111
- BodyIsMissing = 109,
112
- AbstractTypeMembersMustNotHaveBody = 110,
113
- AbstractIndexersMustNotHaveAccessors = 111,
114
- AbstractVariablesMustNotHaveInitializers = 112,
115
- AbstractVariablesMustNotHaveAccessors = 113,
116
- AccessorsAreMissing = 114,
117
- PackageIsAlreadyImportedInAnotherLanguage = 115,
118
- OnlySubprogramsWithReturnTypeCanReturnValue = 116,
119
- MethodsUsingYieldStatementCanNotReturnValue = 117,
120
- YieldStatementCanNotBeUsedInAnonymousMethods = 118,
121
- YieldStatementCanNotBeUsedHere = 119,
122
- MethodsUsingYieldStatementMustHaveEnumerableAsReturnType = 120,
123
- YieldStatementCanNotBeUsedInRunStatementThatHasOnErrorClause = 121,
124
- YieldStatementCanNotBeUsedInFinallyClause = 122,
125
- SubprogramMustReturnValue = 123,
126
- ResultVariableCanNotBeUsedInMethodsUsingYieldStatement = 124,
127
- TypeAliasReferencesItself = 125,
128
- TypeParameterHasCircularConstraint = 126,
129
- BaseTypeCausesInheritanceCycle = 127,
130
- OnlyGenericTypesAndFunctionsCanBeSpecialized = 128,
131
- Expected0TypeArguments = 129,
132
- ExpectedFrom0To1TypeArguments = 130,
133
- Type0IsNotAssignableToConstraint1 = 131,
134
- VariableIsDeclaredButNotUsed = 132,
135
- DefaultConstructorArgumentsMustBeNamed = 133,
136
- IncorrectBodyOfRedefinableAliasTypeMethod = 134,
137
- TheFollowingDeclarationsAreNotTranslated0 = 135,
138
- TheFollowingDeclarationAreNotTranslated0And1More = 136,
139
- CanNotFindTsLibDirectoryBaseSearchPaths0 = 137,
140
- SourceFile0IsNotPartOfThePackageAndWontBeLoaded = 138,
141
- MainPackageConfigurationIsMissingProjectWontBeLoaded = 139,
142
- ProgramWithoutMainPackageCanNotBeCompiled = 140,
143
- JsonConfigurationValidationError = 141,
144
- StandardPackage0NotFound = 142,
145
- Declaration0NotFoundInStandardPackage1 = 143
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;
@@ -1,7 +1,7 @@
1
1
  import { DebugStack } from './DebugStack.js';
2
2
  import { blockStatementTransformationResult, expressionTransformationResult, packageMemberDeclarationTransformationResult, simpleTransformationResult, statementTransformationResult, typeAccessExpressionTransformationResult, typeMemberDeclarationTransformationResult } from './Internal.js';
3
- import { TransformationContinuationAction } from './TransformationContinuationAction.js';
4
3
  import * as ir from './ir/index.js';
4
+ import { TransformationContinuationAction } from './TransformationContinuationAction.js';
5
5
  export declare class Transformer {
6
6
  readonly config: TransformationConfig;
7
7
  protected readonly _debugStack: DebugStack;