@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.
Files changed (62) hide show
  1. package/build/Cli.js +3 -3
  2. package/build/api/Api.js +20 -18
  3. package/build/api/ApiNodeJS.js +3 -3
  4. package/build/api/ApiServices.js +748 -485
  5. package/build/{chunk-EYLAO2SF.js → chunk-6UMHRF7Y.js} +3 -3
  6. package/build/{chunk-Y3KGPV3L.js → chunk-X4XDV2CH.js} +10754 -10037
  7. package/build/{chunk-5BGDYCRQ.js → chunk-YFV3TSQP.js} +9 -8
  8. package/build/types/analysis/AnalyzedTranslationPackage.d.ts +3 -1
  9. package/build/types/analysis/Analyzer.d.ts +33 -15
  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 +1 -1
  26. package/build/types/common/LocalizationHelper.d.ts +5 -2
  27. package/build/types/common/Uri.d.ts +11 -2
  28. package/build/types/common/index.d.ts +0 -1
  29. package/build/types/diagnostic/DiagnosticCode.d.ts +126 -115
  30. package/build/types/emitter/EmitterGeneratedDeclarationKind.d.ts +7 -0
  31. package/build/types/emitter/Entities.d.ts +1 -0
  32. package/build/types/emitter/EntityMap.d.ts +1 -2
  33. package/build/types/emitter/IrBuilder.d.ts +2 -0
  34. package/build/types/emitter/StatementTransformationResult.d.ts +3 -1
  35. package/build/types/emitter/ir/Nodes.d.ts +24 -22
  36. package/build/types/entities/OperatorEntity.d.ts +7 -9
  37. package/build/types/entities/OperatorKind.d.ts +19 -26
  38. package/build/types/entities/StructuredTypeEntity.d.ts +3 -3
  39. package/build/types/entities/TypeEntityMembers.d.ts +9 -14
  40. package/build/types/entities/TypeExtensionEntity.d.ts +0 -1
  41. package/build/types/entities/VariableEntity.d.ts +2 -2
  42. package/build/types/entities/index.d.ts +7 -12
  43. package/build/types/parser/Parser.d.ts +2 -2
  44. package/build/types/project/FileSystemTree.d.ts +1 -1
  45. package/build/types/services/CompletionService.d.ts +26 -20
  46. package/build/types/services/DisplayService.d.ts +42 -50
  47. package/build/types/services/NodeSemanticInfo.d.ts +6 -11
  48. package/build/types/services/SemanticTokensService.d.ts +4 -3
  49. package/build/types/tree/NodeKind.d.ts +105 -104
  50. package/build/types/tree/OperatorKind.d.ts +24 -7
  51. package/build/types/tree/green/Nodes.d.ts +28 -5
  52. package/build/types/tree/green/SyntaxToCode.d.ts +1 -0
  53. package/build/types/tree/green/Token.d.ts +4 -3
  54. package/build/types/tree/red/Nodes.d.ts +26 -8
  55. package/build/types/tree/red/Token.d.ts +3 -2
  56. package/build/types/types/TypeMembers.d.ts +20 -29
  57. package/package.json +3 -3
  58. package/build/types/analysis/BuiltInOperators.d.ts +0 -14
  59. package/build/types/common/UriTree.d.ts +0 -41
  60. package/build/types/entities/BinaryOperatorEntity.d.ts +0 -54
  61. package/build/types/entities/UnaryOperatorEntity.d.ts +0 -37
  62. 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 { 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,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<X, Y> = (<T>() => T extends X ? 1 : 2) extends (<T>() => T extends Y ? 1 : 2) ? true : false;
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: 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,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;
@@ -31,32 +31,26 @@ export declare class AssertionExpression {
31
31
  }
32
32
  export declare class AssignmentExpression {
33
33
  left: LValueExpression;
34
- operator: AssignmentOperator;
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, operator: AssignmentOperator, right: Expression, sourceLocation: SourceLocation | undefined, loweringOptions?: AssignmentLoweringOptions);
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
- operator: AssignmentOperator;
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, operator: AssignmentOperator, right: Expression, sourceLocation: SourceLocation | undefined, loweringOptions?: AssignmentLoweringOptions);
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
- operator: BinaryExpressionOperator;
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, operator: BinaryExpressionOperator, right: Expression, type: Type, sourceLocation: SourceLocation | undefined);
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
- operator: PrefixUnaryExpressionOperator;
588
+ operatorKind: PrefixUnaryExpressionOperatorKind;
596
589
  expression: Expression;
590
+ operator: AccessedMethod | undefined;
597
591
  sourceLocation: SourceLocation | undefined;
598
592
  readonly kind = NodeKind.PrefixUnaryExpression;
599
- constructor(operator: PrefixUnaryExpressionOperator, expression: Expression, sourceLocation: SourceLocation | undefined);
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 PrefixUnaryExpressionOperator {
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 BinaryExpressionOperator {
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 { Name } from '../common/index.js';
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
- getResultType(): types.Type;
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: TypeMethodDeclaration;
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: TypeMethodDeclaration, _operatorKind: OperatorKind);
30
+ constructor(_analyzer: Analyzer, _node: tree.OperatorDeclaration);
33
31
  getOperatorKind(): OperatorKind;
34
- getName(): Name;
35
32
  getValueParameters(): readonly ParameterVariableEntity[];
36
- getResultType(): types.Type;
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
  }