@artel/artc 0.6.26023 → 0.6.26025
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 +2 -2
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +19 -32
- package/build/{chunk-HAB6M5SG.js → chunk-7QPDALAB.js} +1 -1
- package/build/{chunk-IMUSLOYE.js → chunk-CIRH34IO.js} +2 -2
- package/build/{chunk-RQOGIK5O.js → chunk-OTHSFQXT.js} +431 -408
- package/build/types/analysis/Analyzer.d.ts +2 -2
- package/build/types/analysis/SpecialNameKey.d.ts +19 -19
- package/build/types/analysis/WellKnownDeclarations.d.ts +3 -0
- package/build/types/analysis/a/Analyzer.d.ts +10 -0
- package/build/types/analysis/a/TextIdentity.d.ts +3 -6
- package/build/types/analysis/a/semantic-context/SemanticContextBase.d.ts +2 -2
- package/build/types/analysis/a/semantic-context/SourceFileSemanticContext.d.ts +2 -2
- package/build/types/common/Name.d.ts +14 -30
- package/build/types/diagnostic/DiagnosticCode.d.ts +5 -9
- package/build/types/emitter/EmitterContext.d.ts +2 -0
- package/build/types/emitter/IrFactory.d.ts +3 -3
- package/build/types/emitter/ir/EmitOptions.d.ts +0 -1
- package/build/types/emitter/ir/Nodes.d.ts +10 -6
- package/build/types/entities/EntityNaming.d.ts +2 -2
- package/build/types/entities/PackageEntityMembers.d.ts +3 -3
- package/build/types/entities/interfaces/TextTranslationEntity.d.ts +1 -2
- package/build/types/entities/source/a/SourceTextTranslationEntity.d.ts +2 -2
- package/build/types/tree/a/Nodes.d.ts +12 -12
- package/build/types/tree/a/TokenFlags.d.ts +6 -8
- package/build/types/types/StandardTypes.d.ts +2 -0
- package/build/types/types/TypeFactory.d.ts +1 -1
- package/package.json +1 -1
|
@@ -77,10 +77,10 @@ var PackageDialect = /* @__PURE__ */ ((PackageDialect26) => {
|
|
|
77
77
|
})(PackageDialect || {});
|
|
78
78
|
|
|
79
79
|
// source/common/PackageLocale.ts
|
|
80
|
-
var PackageLocale = /* @__PURE__ */ ((
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return
|
|
80
|
+
var PackageLocale = /* @__PURE__ */ ((PackageLocale56) => {
|
|
81
|
+
PackageLocale56[PackageLocale56["En"] = 0] = "En";
|
|
82
|
+
PackageLocale56[PackageLocale56["Ru"] = 1] = "Ru";
|
|
83
|
+
return PackageLocale56;
|
|
84
84
|
})(PackageLocale || {});
|
|
85
85
|
var locales = [
|
|
86
86
|
{ locale: 0 /* En */, code: "en", names: ["english", "\u0430\u043D\u0433\u043B\u0438\u0439\u0441\u043A\u0438\u0439"] },
|
|
@@ -764,7 +764,7 @@ var UniqueWithComparatorQuery = class extends Query {
|
|
|
764
764
|
};
|
|
765
765
|
|
|
766
766
|
// source/common/Constants.ts
|
|
767
|
-
var ArtelVersion = true ? "0.6.
|
|
767
|
+
var ArtelVersion = true ? "0.6.26025" : "";
|
|
768
768
|
var ArtelSourceFileExtensions = [".\u0430\u0440\u0442", ".\u0430\u0440\u0442\u0435\u043B\u044C", ".art", ".artel", ".\u0430\u0440\u0442\u043C", ".\u0430\u0440\u0442\u0435\u043B\u044C\u043C", ".artm", ".artelm"];
|
|
769
769
|
var ArtelSourceFileExtensionSet = new Set(ArtelSourceFileExtensions);
|
|
770
770
|
var ArtelSourceAndConfigurationFileExtensionSet = new Set(ArtelSourceFileExtensionSet).add(".json");
|
|
@@ -2118,9 +2118,6 @@ var Scanner = class _Scanner {
|
|
|
2118
2118
|
}
|
|
2119
2119
|
this.currentPosition++;
|
|
2120
2120
|
}
|
|
2121
|
-
while (this.currentPosition < this.endPosition && this.text.charAt(this.currentPosition) === "`") {
|
|
2122
|
-
this.currentPosition++;
|
|
2123
|
-
}
|
|
2124
2121
|
return true;
|
|
2125
2122
|
}
|
|
2126
2123
|
static isWhitespaceOrTab(char) {
|
|
@@ -2163,16 +2160,16 @@ var Scanner = class _Scanner {
|
|
|
2163
2160
|
return false;
|
|
2164
2161
|
}
|
|
2165
2162
|
index++;
|
|
2166
|
-
while (index < length) {
|
|
2167
|
-
if (!_Scanner.isIdentifierPart(textWithoutQuotes.charCodeAt(index))) {
|
|
2168
|
-
return false;
|
|
2169
|
-
}
|
|
2163
|
+
while (index < length && _Scanner.isIdentifierPart(textWithoutQuotes.charCodeAt(index))) {
|
|
2170
2164
|
index++;
|
|
2171
2165
|
}
|
|
2172
|
-
if (
|
|
2166
|
+
if (textWithoutQuotes.charCodeAt(index - 1) === 45 /* Minus */) {
|
|
2173
2167
|
return false;
|
|
2174
2168
|
}
|
|
2175
|
-
|
|
2169
|
+
while (index < length && textWithoutQuotes.charAt(index) === "`") {
|
|
2170
|
+
index++;
|
|
2171
|
+
}
|
|
2172
|
+
return index === length;
|
|
2176
2173
|
}
|
|
2177
2174
|
static isIdentifier(text) {
|
|
2178
2175
|
const length = text.length;
|
|
@@ -2206,12 +2203,12 @@ var Scanner = class _Scanner {
|
|
|
2206
2203
|
while (index < length && _Scanner.isIdentifierPart(text.charCodeAt(index))) {
|
|
2207
2204
|
index++;
|
|
2208
2205
|
}
|
|
2209
|
-
if (
|
|
2206
|
+
if (text.charCodeAt(index - 1) === 45 /* Minus */) {
|
|
2210
2207
|
return false;
|
|
2211
2208
|
}
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2209
|
+
while (index < length && text.charAt(index) === "`") {
|
|
2210
|
+
index++;
|
|
2211
|
+
}
|
|
2215
2212
|
}
|
|
2216
2213
|
return index === length;
|
|
2217
2214
|
}
|
|
@@ -2593,37 +2590,15 @@ function isLowercaseChar(char) {
|
|
|
2593
2590
|
}
|
|
2594
2591
|
|
|
2595
2592
|
// source/common/Name.ts
|
|
2596
|
-
var NameFlags = /* @__PURE__ */ ((
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
return NameFlags2;
|
|
2593
|
+
var NameFlags = /* @__PURE__ */ ((NameFlags3) => {
|
|
2594
|
+
NameFlags3[NameFlags3["None"] = 0] = "None";
|
|
2595
|
+
NameFlags3[NameFlags3["QuotedName"] = 2] = "QuotedName";
|
|
2596
|
+
NameFlags3[NameFlags3["RequiresQuotes"] = 4] = "RequiresQuotes";
|
|
2597
|
+
NameFlags3[NameFlags3["SpecialName"] = 8] = "SpecialName";
|
|
2598
|
+
NameFlags3[NameFlags3["PreferKebabCase"] = 16] = "PreferKebabCase";
|
|
2599
|
+
return NameFlags3;
|
|
2604
2600
|
})(NameFlags || {});
|
|
2605
2601
|
var Name = class _Name {
|
|
2606
|
-
static {
|
|
2607
|
-
this.objectParameterNameKey = "-object";
|
|
2608
|
-
}
|
|
2609
|
-
/**
|
|
2610
|
-
* Ключ, используемый для сравнения имён на эквивалентность с учётом флагов. Получается из
|
|
2611
|
-
* `keyWithoutBackQuotes` путём добавления символов '\`' `meaningfulBackQuoteCount` число раз.
|
|
2612
|
-
*/
|
|
2613
|
-
get key() {
|
|
2614
|
-
return this.keyWithoutBackQuotes + "`".repeat(this.meaningfulBackQuoteCount);
|
|
2615
|
-
}
|
|
2616
|
-
/**
|
|
2617
|
-
* Количество значащих символов '`', соответствующих флагам.
|
|
2618
|
-
*/
|
|
2619
|
-
get meaningfulBackQuoteCount() {
|
|
2620
|
-
if ((this.flags & 8 /* ConflictResolvingParameterName */) !== 0) {
|
|
2621
|
-
return 1;
|
|
2622
|
-
} else if ((this.flags & 16 /* BackingVariableName */) !== 0) {
|
|
2623
|
-
return 2;
|
|
2624
|
-
}
|
|
2625
|
-
return 0;
|
|
2626
|
-
}
|
|
2627
2602
|
/**
|
|
2628
2603
|
* Исходное имя, при необходимости взятое в одиночные кавычки и содержащее обратные кавычки согласно флагам.
|
|
2629
2604
|
*/
|
|
@@ -2634,52 +2609,45 @@ var Name = class _Name {
|
|
|
2634
2609
|
* @param unescapedOriginalWithoutQuotes Исходное имя без апострофов, одиночных кавычек и экранирования.
|
|
2635
2610
|
* @param flags Флаги имени (`NameFlags`). `NameFlags.None` по умолчанию.
|
|
2636
2611
|
*/
|
|
2637
|
-
constructor(unescapedOriginalWithoutQuotes, flags = 0 /* None
|
|
2612
|
+
constructor(unescapedOriginalWithoutQuotes, flags = 0 /* None */) {
|
|
2638
2613
|
this.unescapedOriginalWithoutQuotes = unescapedOriginalWithoutQuotes;
|
|
2639
|
-
if (
|
|
2640
|
-
this.
|
|
2614
|
+
if ((flags & 8 /* SpecialName */) !== 0) {
|
|
2615
|
+
this.key = unescapedOriginalWithoutQuotes;
|
|
2641
2616
|
} else {
|
|
2642
2617
|
const isPlainIdentifier = Scanner.isPlainIdentifier(unescapedOriginalWithoutQuotes);
|
|
2643
2618
|
if (isPlainIdentifier && (flags & 2 /* QuotedName */) === 0) {
|
|
2644
|
-
this.
|
|
2619
|
+
this.key = kebabCaseToCamelCase(unescapedOriginalWithoutQuotes);
|
|
2645
2620
|
} else {
|
|
2646
2621
|
if ((flags & 4 /* RequiresQuotes */) === 0 && (!isPlainIdentifier || kebabCaseToCamelCase(unescapedOriginalWithoutQuotes) !== unescapedOriginalWithoutQuotes)) {
|
|
2647
2622
|
flags |= 4 /* RequiresQuotes */;
|
|
2648
2623
|
}
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
this.keyWithoutBackQuotes = `'${unescapedOriginalWithoutQuotes}'`;
|
|
2624
|
+
this.key = unescapedOriginalWithoutQuotes;
|
|
2625
|
+
if (this.key.startsWith("-")) {
|
|
2626
|
+
this.key = "'" + this.key;
|
|
2653
2627
|
}
|
|
2654
2628
|
}
|
|
2655
2629
|
}
|
|
2656
2630
|
this.flags = flags;
|
|
2657
2631
|
}
|
|
2658
|
-
toConflictResolvingParameterName() {
|
|
2659
|
-
return new _Name(this.unescapedOriginalWithoutQuotes, this.flags | 8 /* ConflictResolvingParameterName */);
|
|
2660
|
-
}
|
|
2661
2632
|
toBackingVariableName() {
|
|
2662
|
-
return new _Name(this.unescapedOriginalWithoutQuotes, this.flags
|
|
2633
|
+
return new _Name(this.unescapedOriginalWithoutQuotes + "`", this.flags);
|
|
2663
2634
|
}
|
|
2664
|
-
considerEqual(other
|
|
2665
|
-
|
|
2666
|
-
if (considerBackQuotes) {
|
|
2667
|
-
result = this.key === other.key;
|
|
2668
|
-
} else {
|
|
2669
|
-
result = this.keyWithoutBackQuotes === other.keyWithoutBackQuotes;
|
|
2670
|
-
}
|
|
2671
|
-
return result;
|
|
2635
|
+
considerEqual(other) {
|
|
2636
|
+
return this.key === other.key;
|
|
2672
2637
|
}
|
|
2673
2638
|
toString() {
|
|
2674
2639
|
return this.unescapedOriginal;
|
|
2675
2640
|
}
|
|
2676
|
-
getPreferredUnescapedOriginal(
|
|
2677
|
-
return _Name.toUnescapedOriginal(
|
|
2641
|
+
getPreferredUnescapedOriginal(requiresQuotes = false) {
|
|
2642
|
+
return _Name.toUnescapedOriginal(
|
|
2643
|
+
this.unescapedOriginalWithoutQuotes,
|
|
2644
|
+
requiresQuotes ? this.flags | 4 /* RequiresQuotes */ : this.flags
|
|
2645
|
+
);
|
|
2678
2646
|
}
|
|
2679
2647
|
getDisplayText() {
|
|
2680
2648
|
return this.unescapedOriginal;
|
|
2681
2649
|
}
|
|
2682
|
-
static parse(original, initialFlags = 0 /* None
|
|
2650
|
+
static parse(original, initialFlags = 0 /* None */) {
|
|
2683
2651
|
let flags = initialFlags;
|
|
2684
2652
|
let firstCharIndex = 0;
|
|
2685
2653
|
let lastCharIndex = original.length - 1;
|
|
@@ -2687,16 +2655,6 @@ var Name = class _Name {
|
|
|
2687
2655
|
flags |= 2 /* QuotedName */;
|
|
2688
2656
|
firstCharIndex++;
|
|
2689
2657
|
}
|
|
2690
|
-
let backQuoteCount = 0;
|
|
2691
|
-
while (firstCharIndex <= lastCharIndex && original.charAt(lastCharIndex) === "`") {
|
|
2692
|
-
backQuoteCount++;
|
|
2693
|
-
lastCharIndex--;
|
|
2694
|
-
}
|
|
2695
|
-
if (backQuoteCount === 1) {
|
|
2696
|
-
flags |= 8 /* ConflictResolvingParameterName */;
|
|
2697
|
-
} else if (backQuoteCount === 2) {
|
|
2698
|
-
flags |= 16 /* BackingVariableName */;
|
|
2699
|
-
}
|
|
2700
2658
|
if (firstCharIndex <= lastCharIndex && original.charAt(lastCharIndex) === "'") {
|
|
2701
2659
|
lastCharIndex--;
|
|
2702
2660
|
}
|
|
@@ -2704,20 +2662,15 @@ var Name = class _Name {
|
|
|
2704
2662
|
if ((flags & 2 /* QuotedName */) !== 0) {
|
|
2705
2663
|
unescapedOriginalWithoutQuotes = unescapeText(unescapedOriginalWithoutQuotes);
|
|
2706
2664
|
}
|
|
2707
|
-
return new _Name(unescapedOriginalWithoutQuotes, flags
|
|
2665
|
+
return new _Name(unescapedOriginalWithoutQuotes, flags);
|
|
2708
2666
|
}
|
|
2709
2667
|
static toUnescapedOriginal(unescapedOriginalWithoutQuotes, flags) {
|
|
2710
2668
|
let result = unescapedOriginalWithoutQuotes;
|
|
2711
2669
|
if ((flags & 4 /* RequiresQuotes */) !== 0) {
|
|
2712
2670
|
result = `'${result}'`;
|
|
2713
|
-
} else if ((flags &
|
|
2671
|
+
} else if ((flags & 16 /* PreferKebabCase */) !== 0) {
|
|
2714
2672
|
result = camelCaseToKebabCasePreservingKeyEquality(result);
|
|
2715
2673
|
}
|
|
2716
|
-
if ((flags & 8 /* ConflictResolvingParameterName */) !== 0) {
|
|
2717
|
-
result += "`";
|
|
2718
|
-
} else if ((flags & 16 /* BackingVariableName */) !== 0) {
|
|
2719
|
-
result += "``";
|
|
2720
|
-
}
|
|
2721
2674
|
return result;
|
|
2722
2675
|
}
|
|
2723
2676
|
};
|
|
@@ -4052,8 +4005,8 @@ var EntityNaming_named = class {
|
|
|
4052
4005
|
toString() {
|
|
4053
4006
|
return this.value.unescapedOriginal;
|
|
4054
4007
|
}
|
|
4055
|
-
considerEqual(other
|
|
4056
|
-
return other.kind === "named" && this.value.considerEqual(other.value
|
|
4008
|
+
considerEqual(other) {
|
|
4009
|
+
return other.kind === "named" && this.value.considerEqual(other.value);
|
|
4057
4010
|
}
|
|
4058
4011
|
};
|
|
4059
4012
|
var EntityNaming_anonymous = class {
|
|
@@ -4063,7 +4016,7 @@ var EntityNaming_anonymous = class {
|
|
|
4063
4016
|
toString() {
|
|
4064
4017
|
return "anonymous";
|
|
4065
4018
|
}
|
|
4066
|
-
considerEqual(other
|
|
4019
|
+
considerEqual(other) {
|
|
4067
4020
|
return other.kind === "anonymous";
|
|
4068
4021
|
}
|
|
4069
4022
|
};
|
|
@@ -4106,32 +4059,32 @@ var specialNameKeys = {
|
|
|
4106
4059
|
objectParameter: "-\u043E\u0431\u044A\u0435\u043A\u0442",
|
|
4107
4060
|
constructor: "-\u0441\u043E\u0437\u0434\u0430\u043D\u0438\u0435",
|
|
4108
4061
|
destructor: "-\u0443\u043D\u0438\u0447\u0442\u043E\u0436\u0435\u043D\u0438\u0435",
|
|
4109
|
-
plusOperator: "
|
|
4110
|
-
unaryPlusOperator: "
|
|
4111
|
-
binaryPlusOperator: "
|
|
4112
|
-
minusOperator: "
|
|
4113
|
-
unaryMinusOperator: "-\u0443",
|
|
4114
|
-
binaryMinusOperator: "-\
|
|
4062
|
+
plusOperator: "-\u043F\u043B\u044E\u0441",
|
|
4063
|
+
unaryPlusOperator: "-\u043F\u043B\u044E\u0441-\u043E\u0434\u043D\u043E\u043C\u0435\u0441\u0442\u043D\u044B\u0439",
|
|
4064
|
+
binaryPlusOperator: "-\u043F\u043B\u044E\u0441-\u0434\u0432\u0443\u0445\u043C\u0435\u0441\u0442\u043D\u044B\u0439",
|
|
4065
|
+
minusOperator: "-\u043C\u0438\u043D\u0443\u0441",
|
|
4066
|
+
unaryMinusOperator: "-\u043C\u0438\u043D\u0443\u0441-\u043E\u0434\u043D\u043E\u043C\u0435\u0441\u0442\u043D\u044B\u0439",
|
|
4067
|
+
binaryMinusOperator: "-\u043C\u0438\u043D\u0443\u0441-\u0434\u0432\u0443\u0445\u043C\u0435\u0441\u0442\u043D\u044B\u0439",
|
|
4115
4068
|
notOperator: "-\u043D\u0435",
|
|
4116
|
-
multiplyOperator: "
|
|
4117
|
-
divideOperator: "
|
|
4118
|
-
moduloOperator: "
|
|
4119
|
-
lessThanOperator: "
|
|
4120
|
-
greaterThanOperator: "
|
|
4121
|
-
lessThanOrEqualOperator: "
|
|
4122
|
-
greaterThanOrEqualOperator: "
|
|
4069
|
+
multiplyOperator: "-\u0443\u043C\u043D\u043E\u0436\u0435\u043D\u0438\u0435",
|
|
4070
|
+
divideOperator: "-\u0434\u0435\u043B\u0435\u043D\u0438\u0435",
|
|
4071
|
+
moduloOperator: "-\u043E\u0441\u0442\u0430\u0442\u043E\u043A",
|
|
4072
|
+
lessThanOperator: "-\u043C\u0435\u043D\u044C\u0448\u0435",
|
|
4073
|
+
greaterThanOperator: "-\u0431\u043E\u043B\u044C\u0448\u0435",
|
|
4074
|
+
lessThanOrEqualOperator: "-\u043C\u0435\u043D\u044C\u0448\u0435-\u0438\u043B\u0438-\u0440\u0430\u0432\u043D\u043E",
|
|
4075
|
+
greaterThanOrEqualOperator: "-\u0431\u043E\u043B\u044C\u0448\u0435-\u0438\u043B\u0438-\u0440\u0430\u0432\u043D\u043E",
|
|
4123
4076
|
orOperator: "-\u0438\u043B\u0438",
|
|
4124
4077
|
andOperator: "-\u0438",
|
|
4125
4078
|
xorOperator: "-\u0438\u0441\u043A\u043B",
|
|
4126
|
-
bitwiseAndOperator: "
|
|
4127
|
-
bitwiseOrOperator: "
|
|
4128
|
-
bitwiseXorOperator: "
|
|
4129
|
-
leftShiftOperator: "
|
|
4130
|
-
signedRightShiftOperator: "
|
|
4131
|
-
unsignedRightShiftOperator: "
|
|
4079
|
+
bitwiseAndOperator: "-\u043F\u043E\u0431\u0438\u0442\u043E\u0432\u043E\u0435-\u0438",
|
|
4080
|
+
bitwiseOrOperator: "-\u043F\u043E\u0431\u0438\u0442\u043E\u0432\u043E\u0435-\u0438\u043B\u0438",
|
|
4081
|
+
bitwiseXorOperator: "-\u043F\u043E\u0431\u0438\u0442\u043E\u0432\u043E\u0435-\u0438\u0441\u043A\u043B",
|
|
4082
|
+
leftShiftOperator: "-\u0441\u0434\u0432\u0438\u0433-\u0432\u043B\u0435\u0432\u043E",
|
|
4083
|
+
signedRightShiftOperator: "-\u0441\u0434\u0432\u0438\u0433-\u0432\u043F\u0440\u0430\u0432\u043E",
|
|
4084
|
+
unsignedRightShiftOperator: "-\u0441\u0434\u0432\u0438\u0433-\u0432\u043F\u0440\u0430\u0432\u043E-\u043D\u0443\u043B\u044F\u043C\u0438"
|
|
4132
4085
|
};
|
|
4133
4086
|
var specialNames = Object.fromEntries(
|
|
4134
|
-
Object.entries(specialNameKeys).map((e) => [e[0], new Name(e[1],
|
|
4087
|
+
Object.entries(specialNameKeys).map((e) => [e[0], new Name(e[1], 8 /* SpecialName */)])
|
|
4135
4088
|
);
|
|
4136
4089
|
var specialNameBySyntacticalOperatorKind = {
|
|
4137
4090
|
[0 /* Plus */]: specialNames.plusOperator,
|
|
@@ -8138,10 +8091,10 @@ var TextTemplateLiteral = class extends BaseExpressionNode {
|
|
|
8138
8091
|
}
|
|
8139
8092
|
};
|
|
8140
8093
|
var LocalizableTextTemplateLiteral = class extends BaseExpressionNode {
|
|
8141
|
-
constructor(head, spanList,
|
|
8094
|
+
constructor(head, spanList, key, rangeWithTrivia) {
|
|
8142
8095
|
super(rangeWithTrivia);
|
|
8143
8096
|
this.kind = 77 /* LocalizableTextTemplateLiteral */;
|
|
8144
|
-
this.children = [head, spanList,
|
|
8097
|
+
this.children = [head, spanList, key];
|
|
8145
8098
|
this.setParentForChildren();
|
|
8146
8099
|
}
|
|
8147
8100
|
get parent() {
|
|
@@ -8154,7 +8107,7 @@ var LocalizableTextTemplateLiteral = class extends BaseExpressionNode {
|
|
|
8154
8107
|
get spanList() {
|
|
8155
8108
|
return this.children[1];
|
|
8156
8109
|
}
|
|
8157
|
-
get
|
|
8110
|
+
get key() {
|
|
8158
8111
|
return this.children[2];
|
|
8159
8112
|
}
|
|
8160
8113
|
get thisAsNode() {
|
|
@@ -8237,10 +8190,10 @@ var TextLiteral = class extends BaseExpressionNode {
|
|
|
8237
8190
|
}
|
|
8238
8191
|
};
|
|
8239
8192
|
var LocalizableTextLiteral = class extends BaseExpressionNode {
|
|
8240
|
-
constructor(text,
|
|
8193
|
+
constructor(text, key, rangeWithTrivia) {
|
|
8241
8194
|
super(rangeWithTrivia);
|
|
8242
8195
|
this.kind = 82 /* LocalizableTextLiteral */;
|
|
8243
|
-
this.children = [text,
|
|
8196
|
+
this.children = [text, key];
|
|
8244
8197
|
this.setParentForChildren();
|
|
8245
8198
|
}
|
|
8246
8199
|
get parent() {
|
|
@@ -8250,7 +8203,7 @@ var LocalizableTextLiteral = class extends BaseExpressionNode {
|
|
|
8250
8203
|
get text() {
|
|
8251
8204
|
return this.children[0];
|
|
8252
8205
|
}
|
|
8253
|
-
get
|
|
8206
|
+
get key() {
|
|
8254
8207
|
return this.children[1];
|
|
8255
8208
|
}
|
|
8256
8209
|
get thisAsNode() {
|
|
@@ -9642,10 +9595,10 @@ var TextTranslationFunctionDeclaration = class extends BaseNode {
|
|
|
9642
9595
|
}
|
|
9643
9596
|
};
|
|
9644
9597
|
var TranslationTextLiteral = class extends BaseNode {
|
|
9645
|
-
constructor(text,
|
|
9598
|
+
constructor(text, key, rangeWithTrivia) {
|
|
9646
9599
|
super(rangeWithTrivia);
|
|
9647
9600
|
this.kind = 140 /* TranslationTextLiteral */;
|
|
9648
|
-
this.children = [text,
|
|
9601
|
+
this.children = [text, key];
|
|
9649
9602
|
this.setParentForChildren();
|
|
9650
9603
|
}
|
|
9651
9604
|
get parent() {
|
|
@@ -9655,7 +9608,7 @@ var TranslationTextLiteral = class extends BaseNode {
|
|
|
9655
9608
|
get text() {
|
|
9656
9609
|
return this.children[0];
|
|
9657
9610
|
}
|
|
9658
|
-
get
|
|
9611
|
+
get key() {
|
|
9659
9612
|
return this.children[1];
|
|
9660
9613
|
}
|
|
9661
9614
|
get thisAsNode() {
|
|
@@ -9663,10 +9616,10 @@ var TranslationTextLiteral = class extends BaseNode {
|
|
|
9663
9616
|
}
|
|
9664
9617
|
};
|
|
9665
9618
|
var TranslationTextTemplate = class extends BaseNode {
|
|
9666
|
-
constructor(head, spanList,
|
|
9619
|
+
constructor(head, spanList, key, rangeWithTrivia) {
|
|
9667
9620
|
super(rangeWithTrivia);
|
|
9668
9621
|
this.kind = 141 /* TranslationTextTemplate */;
|
|
9669
|
-
this.children = [head, spanList,
|
|
9622
|
+
this.children = [head, spanList, key];
|
|
9670
9623
|
this.setParentForChildren();
|
|
9671
9624
|
}
|
|
9672
9625
|
get parent() {
|
|
@@ -9679,7 +9632,7 @@ var TranslationTextTemplate = class extends BaseNode {
|
|
|
9679
9632
|
get spanList() {
|
|
9680
9633
|
return this.children[1];
|
|
9681
9634
|
}
|
|
9682
|
-
get
|
|
9635
|
+
get key() {
|
|
9683
9636
|
return this.children[2];
|
|
9684
9637
|
}
|
|
9685
9638
|
get thisAsNode() {
|
|
@@ -10122,13 +10075,11 @@ var TokenFlags = /* @__PURE__ */ ((TokenFlags2) => {
|
|
|
10122
10075
|
TokenFlags2[TokenFlags2["RequiresQuotes"] = 8] = "RequiresQuotes";
|
|
10123
10076
|
TokenFlags2[TokenFlags2["EscapedKeyword"] = 16] = "EscapedKeyword";
|
|
10124
10077
|
TokenFlags2[TokenFlags2["HasBackQuotes"] = 32] = "HasBackQuotes";
|
|
10125
|
-
TokenFlags2[TokenFlags2["
|
|
10126
|
-
TokenFlags2[TokenFlags2["
|
|
10127
|
-
TokenFlags2[TokenFlags2["
|
|
10128
|
-
TokenFlags2[TokenFlags2["
|
|
10129
|
-
TokenFlags2[TokenFlags2["
|
|
10130
|
-
TokenFlags2[TokenFlags2["ObjectParameterName"] = 2048] = "ObjectParameterName";
|
|
10131
|
-
TokenFlags2[TokenFlags2["LocalizableText"] = 1536] = "LocalizableText";
|
|
10078
|
+
TokenFlags2[TokenFlags2["SingleCharText"] = 64] = "SingleCharText";
|
|
10079
|
+
TokenFlags2[TokenFlags2["StartsWithTilde"] = 128] = "StartsWithTilde";
|
|
10080
|
+
TokenFlags2[TokenFlags2["EndsWithTilde"] = 256] = "EndsWithTilde";
|
|
10081
|
+
TokenFlags2[TokenFlags2["ObjectParameterName"] = 512] = "ObjectParameterName";
|
|
10082
|
+
TokenFlags2[TokenFlags2["LocalizableText"] = 384] = "LocalizableText";
|
|
10132
10083
|
return TokenFlags2;
|
|
10133
10084
|
})(TokenFlags || {});
|
|
10134
10085
|
|
|
@@ -12123,7 +12074,7 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
|
12123
12074
|
} else {
|
|
12124
12075
|
let value = token.value;
|
|
12125
12076
|
if (token.tokenKind === 9 /* Identifier */) {
|
|
12126
|
-
if ((token.flags &
|
|
12077
|
+
if ((token.flags & 512 /* ObjectParameterName */) !== 0) {
|
|
12127
12078
|
value = LocalizationHelperA.localizeKeywordAndTakeFirst(7 /* Object */, this.keywordsLocale);
|
|
12128
12079
|
} else if (value.startsWith("'") && value.endsWith("'")) {
|
|
12129
12080
|
value = `'${this.escapeLiteralIdentifier(value.substring(1, value.length - 1))}'`;
|
|
@@ -12528,15 +12479,11 @@ var DiagnosticCode = /* @__PURE__ */ ((DiagnosticCode2) => {
|
|
|
12528
12479
|
DiagnosticCode2[DiagnosticCode2["ModifierListExpected"] = 1120] = "ModifierListExpected";
|
|
12529
12480
|
DiagnosticCode2[DiagnosticCode2["RunKeywordCreationKeywordOrModifierListExpected"] = 1121] = "RunKeywordCreationKeywordOrModifierListExpected";
|
|
12530
12481
|
DiagnosticCode2[DiagnosticCode2["HidingLevelExpected"] = 1122] = "HidingLevelExpected";
|
|
12531
|
-
DiagnosticCode2[DiagnosticCode2["
|
|
12532
|
-
DiagnosticCode2[DiagnosticCode2["
|
|
12533
|
-
DiagnosticCode2[DiagnosticCode2["
|
|
12534
|
-
DiagnosticCode2[DiagnosticCode2["
|
|
12535
|
-
DiagnosticCode2[DiagnosticCode2["
|
|
12536
|
-
DiagnosticCode2[DiagnosticCode2["TypeMemberTranslationExpected"] = 1128] = "TypeMemberTranslationExpected";
|
|
12537
|
-
DiagnosticCode2[DiagnosticCode2["TranslationExpected"] = 1129] = "TranslationExpected";
|
|
12538
|
-
DiagnosticCode2[DiagnosticCode2["TranslatedTextTemplateOrTranslationFunctionBlockExpected"] = 1130] = "TranslatedTextTemplateOrTranslationFunctionBlockExpected";
|
|
12539
|
-
DiagnosticCode2[DiagnosticCode2["TranslatedTextCannotBeginOrEndWithTilde"] = 1131] = "TranslatedTextCannotBeginOrEndWithTilde";
|
|
12482
|
+
DiagnosticCode2[DiagnosticCode2["TagNameExpected"] = 1123] = "TagNameExpected";
|
|
12483
|
+
DiagnosticCode2[DiagnosticCode2["TypeMemberTranslationExpected"] = 1124] = "TypeMemberTranslationExpected";
|
|
12484
|
+
DiagnosticCode2[DiagnosticCode2["TranslationExpected"] = 1125] = "TranslationExpected";
|
|
12485
|
+
DiagnosticCode2[DiagnosticCode2["TranslatedTextTemplateOrTranslationFunctionBlockExpected"] = 1126] = "TranslatedTextTemplateOrTranslationFunctionBlockExpected";
|
|
12486
|
+
DiagnosticCode2[DiagnosticCode2["TranslatedTextCannotBeginOrEndWithTilde"] = 1127] = "TranslatedTextCannotBeginOrEndWithTilde";
|
|
12540
12487
|
DiagnosticCode2[DiagnosticCode2["TypeCannotBeUsedAsValue"] = 2e3] = "TypeCannotBeUsedAsValue";
|
|
12541
12488
|
DiagnosticCode2[DiagnosticCode2["PackageNameCannotBeUsedAsValue"] = 2001] = "PackageNameCannotBeUsedAsValue";
|
|
12542
12489
|
DiagnosticCode2[DiagnosticCode2["PackageAliasCannotBeUsedAsValue"] = 2002] = "PackageAliasCannotBeUsedAsValue";
|
|
@@ -12865,15 +12812,11 @@ var englishErrorMessages = {
|
|
|
12865
12812
|
[1120 /* ModifierListExpected */]: "Modifier list expected.",
|
|
12866
12813
|
[1121 /* RunKeywordCreationKeywordOrModifierListExpected */]: "The 'run' keyword, 'creation' keyword or modifier list expected.",
|
|
12867
12814
|
[1122 /* HidingLevelExpected */]: "Hiding level expected.",
|
|
12868
|
-
[1123 /*
|
|
12869
|
-
[1124 /*
|
|
12870
|
-
[1125 /*
|
|
12871
|
-
[1126 /*
|
|
12872
|
-
[1127 /*
|
|
12873
|
-
[1128 /* TypeMemberTranslationExpected */]: "Type member translation expected.",
|
|
12874
|
-
[1129 /* TranslationExpected */]: "Translation expected.",
|
|
12875
|
-
[1130 /* TranslatedTextTemplateOrTranslationFunctionBlockExpected */]: "Translated text template or translation function block expected.",
|
|
12876
|
-
[1131 /* TranslatedTextCannotBeginOrEndWithTilde */]: "Translated text cannot begin or end with '~' (tilde).",
|
|
12815
|
+
[1123 /* TagNameExpected */]: "Tag name expected.",
|
|
12816
|
+
[1124 /* TypeMemberTranslationExpected */]: "Type member translation expected.",
|
|
12817
|
+
[1125 /* TranslationExpected */]: "Translation expected.",
|
|
12818
|
+
[1126 /* TranslatedTextTemplateOrTranslationFunctionBlockExpected */]: "Translated text template or translation function block expected.",
|
|
12819
|
+
[1127 /* TranslatedTextCannotBeginOrEndWithTilde */]: "Translated text cannot begin or end with '~' (tilde).",
|
|
12877
12820
|
[2e3 /* TypeCannotBeUsedAsValue */]: "Type name cannot be used as value.",
|
|
12878
12821
|
[2001 /* PackageNameCannotBeUsedAsValue */]: "Package name cannot be used as value.",
|
|
12879
12822
|
[2002 /* PackageAliasCannotBeUsedAsValue */]: "Package alias cannot be used as value.",
|
|
@@ -13155,14 +13098,10 @@ var russianErrorMessages = {
|
|
|
13155
13098
|
[1119 /* InvalidTextTemplate */]: "\u041D\u0435\u043A\u043E\u0440\u0440\u0435\u043A\u0442\u043D\u044B\u0439 \u0442\u0435\u043A\u0441\u0442\u043E\u0432\u044B\u0439 \u0448\u0430\u0431\u043B\u043E\u043D.",
|
|
13156
13099
|
[1120 /* ModifierListExpected */]: "\u041E\u0436\u0438\u0434\u0430\u043B\u0441\u044F \u0441\u043F\u0438\u0441\u043E\u043A \u043C\u043E\u0434\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u043E\u0432.",
|
|
13157
13100
|
[1121 /* RunKeywordCreationKeywordOrModifierListExpected */]: "\u041E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043B\u0443\u0436\u0435\u0431\u043D\u043E\u0435 \u0441\u043B\u043E\u0432\u043E '\u0432\u044B\u043F\u043E\u043B\u043D\u0438\u0442\u044C' \u0438\u043B\u0438 \u0441\u043B\u0443\u0436\u0435\u0431\u043D\u043E\u0435 \u0441\u043B\u043E\u0432\u043E '\u0441\u043E\u0437\u0434\u0430\u043D\u0438\u0435', \u0438\u043B\u0438 \u0441\u043F\u0438\u0441\u043E\u043A \u043C\u043E\u0434\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u043E\u0432.",
|
|
13158
|
-
[
|
|
13159
|
-
[
|
|
13160
|
-
[
|
|
13161
|
-
[
|
|
13162
|
-
[1128 /* TypeMemberTranslationExpected */]: "\u041E\u0436\u0438\u0434\u0430\u043B\u0441\u044F \u043F\u0435\u0440\u0435\u0432\u043E\u0434 \u0447\u043B\u0435\u043D\u0430 \u0442\u0438\u043F\u0430.",
|
|
13163
|
-
[1129 /* TranslationExpected */]: "\u041E\u0436\u0438\u0434\u0430\u043B\u0441\u044F \u043F\u0435\u0440\u0435\u0432\u043E\u0434.",
|
|
13164
|
-
[1130 /* TranslatedTextTemplateOrTranslationFunctionBlockExpected */]: "\u041E\u0436\u0438\u0434\u0430\u043B\u0441\u044F \u043F\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043D\u043D\u044B\u0439 \u0448\u0430\u0431\u043B\u043E\u043D \u0442\u0435\u043A\u0441\u0442\u0430 \u0438\u043B\u0438 \u0431\u043B\u043E\u043A \u0444\u0443\u043D\u043A\u0446\u0438\u0438 \u043F\u0435\u0440\u0435\u0432\u043E\u0434\u0430.",
|
|
13165
|
-
[1131 /* TranslatedTextCannotBeginOrEndWithTilde */]: "\u041F\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043D\u043D\u044B\u0439 \u0442\u0435\u043A\u0441\u0442 \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0438\u043B\u0438 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u0437\u043D\u0430\u043A\u043E\u043C '~' (\u0442\u0438\u043B\u044C\u0434\u0430).",
|
|
13101
|
+
[1124 /* TypeMemberTranslationExpected */]: "\u041E\u0436\u0438\u0434\u0430\u043B\u0441\u044F \u043F\u0435\u0440\u0435\u0432\u043E\u0434 \u0447\u043B\u0435\u043D\u0430 \u0442\u0438\u043F\u0430.",
|
|
13102
|
+
[1125 /* TranslationExpected */]: "\u041E\u0436\u0438\u0434\u0430\u043B\u0441\u044F \u043F\u0435\u0440\u0435\u0432\u043E\u0434.",
|
|
13103
|
+
[1126 /* TranslatedTextTemplateOrTranslationFunctionBlockExpected */]: "\u041E\u0436\u0438\u0434\u0430\u043B\u0441\u044F \u043F\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043D\u043D\u044B\u0439 \u0448\u0430\u0431\u043B\u043E\u043D \u0442\u0435\u043A\u0441\u0442\u0430 \u0438\u043B\u0438 \u0431\u043B\u043E\u043A \u0444\u0443\u043D\u043A\u0446\u0438\u0438 \u043F\u0435\u0440\u0435\u0432\u043E\u0434\u0430.",
|
|
13104
|
+
[1127 /* TranslatedTextCannotBeginOrEndWithTilde */]: "\u041F\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043D\u043D\u044B\u0439 \u0442\u0435\u043A\u0441\u0442 \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0438\u043B\u0438 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u0437\u043D\u0430\u043A\u043E\u043C '~' (\u0442\u0438\u043B\u044C\u0434\u0430).",
|
|
13166
13105
|
[2e3 /* TypeCannotBeUsedAsValue */]: "\u0418\u043C\u044F \u0442\u0438\u043F\u0430 \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u043E \u043A\u0430\u043A \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435.",
|
|
13167
13106
|
[2001 /* PackageNameCannotBeUsedAsValue */]: "\u0418\u043C\u044F \u043F\u0430\u043A\u0435\u0442\u0430 \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u043E \u043A\u0430\u043A \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435.",
|
|
13168
13107
|
[2002 /* PackageAliasCannotBeUsedAsValue */]: "\u041F\u0441\u0435\u0432\u0434\u043E\u043D\u0438\u043C \u043F\u0430\u043A\u0435\u0442\u0430 \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D \u043A\u0430\u043A \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435.",
|
|
@@ -13266,7 +13205,7 @@ var russianErrorMessages = {
|
|
|
13266
13205
|
[2099 /* OperatorFunction0MustHaveNoMoreThanOneParameter */]: "\u0424\u0443\u043D\u043A\u0446\u0438\u044F \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438 '{0}' \u0434\u043E\u043B\u0436\u043D\u0430 \u0438\u043C\u0435\u0442\u044C \u043D\u0435 \u0431\u043E\u043B\u0435\u0435 \u043E\u0434\u043D\u043E\u0433\u043E \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430.",
|
|
13267
13206
|
[2100 /* CorrespondingBasicTypeMemberNotFound */]: "\u041D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0439 \u0431\u0430\u0437\u043E\u0432\u044B\u0439 \u0447\u043B\u0435\u043D \u0442\u0438\u043F\u0430.",
|
|
13268
13207
|
[2101 /* AsyncFunctionCanOnlyBeCalledFromFunctionMarkedWithAsyncModifier */]: "\u0410\u0441\u0438\u043D\u0445\u0440\u043E\u043D\u043D\u0430\u044F \u0444\u0443\u043D\u043A\u0446\u0438\u044F \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u0432\u044B\u0437\u0432\u0430\u043D\u0430 \u0442\u043E\u043B\u044C\u043A\u043E \u0438\u0437 \u0444\u0443\u043D\u043A\u0446\u0438\u0438, \u043F\u043E\u043C\u0435\u0447\u0435\u043D\u043D\u043E\u0439 \u043C\u043E\u0434\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u043E\u043C '\u0430\u0441\u0438\u043D\u0445\u0440\u043E\u043D\u043D\u043E'.",
|
|
13269
|
-
[
|
|
13208
|
+
[1123 /* TagNameExpected */]: "\u041E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u0438\u043C\u044F \u0442\u0435\u0433\u0430.",
|
|
13270
13209
|
[2102 /* TagNotFound */]: "\u0422\u0435\u0433 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D.",
|
|
13271
13210
|
[2103 /* TypeOrFunctionNameExpected */]: "\u041E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u0438\u043C\u044F \u0442\u0438\u043F\u0430 \u0438\u043B\u0438 \u0444\u0443\u043D\u043A\u0446\u0438\u0438.",
|
|
13272
13211
|
[2104 /* PackageNameOrAliasExpected */]: "\u041E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u0438\u043C\u044F \u0438\u043B\u0438 \u043F\u0441\u0435\u0432\u0434\u043E\u043D\u0438\u043C \u043F\u0430\u043A\u0435\u0442\u0430.",
|
|
@@ -13875,14 +13814,9 @@ var TextParser = class {
|
|
|
13875
13814
|
}
|
|
13876
13815
|
return void 0;
|
|
13877
13816
|
}
|
|
13878
|
-
parseIdentifier(
|
|
13817
|
+
parseIdentifier(diagnosticCode = 1100 /* IdentifierExpected */) {
|
|
13879
13818
|
if (this.isToken(9 /* Identifier */)) {
|
|
13880
|
-
const range = this.getCurrentTokenOrKeyword().rangeWithoutTrivia;
|
|
13881
13819
|
const identifier2 = this.parseDetectedToken();
|
|
13882
|
-
const validated = this.validateIdentifier(identifier2, range);
|
|
13883
|
-
if (validated && declarationKind !== 0 /* None */) {
|
|
13884
|
-
this.validateDeclarationOrTranslationName(identifier2, range, declarationKind);
|
|
13885
|
-
}
|
|
13886
13820
|
return identifier2;
|
|
13887
13821
|
}
|
|
13888
13822
|
return this.parseMissingIdentifier(diagnosticCode);
|
|
@@ -13896,12 +13830,9 @@ var TextParser = class {
|
|
|
13896
13830
|
this.hasPrecedingLineBreak = false;
|
|
13897
13831
|
return result;
|
|
13898
13832
|
}
|
|
13899
|
-
parseQualifiedName(
|
|
13833
|
+
parseQualifiedName(diagnosticCodeForFirstMissingIdentifier) {
|
|
13900
13834
|
const qualifiedNameStart = this.tokenOrKeywordStartPosition();
|
|
13901
|
-
const parts = [this.parseIdentifier(
|
|
13902
|
-
0 /* None */,
|
|
13903
|
-
diagnosticKindForFirstMissingIdentifier
|
|
13904
|
-
)];
|
|
13835
|
+
const parts = [this.parseIdentifier(diagnosticCodeForFirstMissingIdentifier)];
|
|
13905
13836
|
let dotToken = this.parseOptionalToken(34 /* Dot */);
|
|
13906
13837
|
while (dotToken !== void 0) {
|
|
13907
13838
|
parts.push(dotToken);
|
|
@@ -13913,12 +13844,12 @@ var TextParser = class {
|
|
|
13913
13844
|
isStartOfParameterName() {
|
|
13914
13845
|
return this.isToken(9 /* Identifier */) || this.isKeyword(7 /* Object */);
|
|
13915
13846
|
}
|
|
13916
|
-
parseParameterName(
|
|
13847
|
+
parseParameterName() {
|
|
13917
13848
|
let result = this.parseOptionalKeyword(7 /* Object */);
|
|
13918
13849
|
if (result !== void 0) {
|
|
13919
13850
|
Debug.assert(result.tokens.length === 1, "\u0421\u043B\u0443\u0436\u0435\u0431\u043D\u043E\u0435 \u0441\u043B\u043E\u0432\u043E '\u043E\u0431\u044A\u0435\u043A\u0442' \u0434\u043E\u043B\u0436\u043D\u043E \u0441\u043E\u0441\u0442\u043E\u044F\u0442\u044C \u0438\u0437 \u043E\u0434\u043D\u043E\u0433\u043E \u0438\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u0430.");
|
|
13920
13851
|
const identifier2 = result.tokens[0];
|
|
13921
|
-
const flags = identifier2.flags |
|
|
13852
|
+
const flags = identifier2.flags | 512 /* ObjectParameterName */;
|
|
13922
13853
|
result = new Token2(
|
|
13923
13854
|
9 /* Identifier */,
|
|
13924
13855
|
identifier2.value,
|
|
@@ -13929,7 +13860,7 @@ var TextParser = class {
|
|
|
13929
13860
|
identifier2.rangeWithTrivia
|
|
13930
13861
|
);
|
|
13931
13862
|
} else {
|
|
13932
|
-
result = this.parseIdentifier(
|
|
13863
|
+
result = this.parseIdentifier();
|
|
13933
13864
|
}
|
|
13934
13865
|
return result;
|
|
13935
13866
|
}
|
|
@@ -14263,17 +14194,16 @@ var TextParser = class {
|
|
|
14263
14194
|
flags |= 4 /* QuotedName */;
|
|
14264
14195
|
firstCharIndex++;
|
|
14265
14196
|
}
|
|
14266
|
-
|
|
14267
|
-
while (firstCharIndex <= lastCharIndex && value.charAt(lastCharIndex) === "`") {
|
|
14268
|
-
backQuoteCount++;
|
|
14197
|
+
if (firstCharIndex <= lastCharIndex && value.charAt(lastCharIndex) === "'") {
|
|
14269
14198
|
lastCharIndex--;
|
|
14270
14199
|
}
|
|
14271
|
-
|
|
14200
|
+
while (firstCharIndex <= lastCharIndex && value.charAt(lastCharIndex) === "`") {
|
|
14201
|
+
flags |= 32 /* HasBackQuotes */;
|
|
14272
14202
|
lastCharIndex--;
|
|
14273
14203
|
}
|
|
14274
14204
|
let operatorKind;
|
|
14275
14205
|
const valueWithoutQuotes = value.substring(firstCharIndex, lastCharIndex + 1);
|
|
14276
|
-
if ((flags & 4 /* QuotedName */) !== 0
|
|
14206
|
+
if ((flags & 4 /* QuotedName */) !== 0) {
|
|
14277
14207
|
const unescapedValue = unescapeText(valueWithoutQuotes);
|
|
14278
14208
|
const keywordPart = this.keywords.get(unescapedValue)?.find((x) => x.kind === 1 /* EndKeywordPart */);
|
|
14279
14209
|
if (keywordPart !== void 0) {
|
|
@@ -14283,14 +14213,6 @@ var TextParser = class {
|
|
|
14283
14213
|
operatorKind = operatorKindByTokenText[unescapedValue];
|
|
14284
14214
|
}
|
|
14285
14215
|
}
|
|
14286
|
-
if (backQuoteCount > 0) {
|
|
14287
|
-
flags |= 32 /* HasBackQuotes */;
|
|
14288
|
-
if (backQuoteCount === 1) {
|
|
14289
|
-
flags |= 64 /* ConflictResolvingParameterName */;
|
|
14290
|
-
} else if (backQuoteCount === 2) {
|
|
14291
|
-
flags |= 128 /* BackingVariableName */;
|
|
14292
|
-
}
|
|
14293
|
-
}
|
|
14294
14216
|
if (valueWithoutQuotes !== value && !Scanner.isPlainIdentifier(valueWithoutQuotes)) {
|
|
14295
14217
|
flags |= 8 /* RequiresQuotes */;
|
|
14296
14218
|
}
|
|
@@ -14308,21 +14230,21 @@ var TextParser = class {
|
|
|
14308
14230
|
let flags = 0 /* None */;
|
|
14309
14231
|
switch (scannerToken.kind) {
|
|
14310
14232
|
case 9 /* CharLiteral */:
|
|
14311
|
-
flags |=
|
|
14233
|
+
flags |= 64 /* SingleCharText */;
|
|
14312
14234
|
break;
|
|
14313
14235
|
case 14 /* LocalizableTextLiteral */:
|
|
14314
14236
|
if (scannerToken.value.startsWith("~")) {
|
|
14315
|
-
flags |=
|
|
14237
|
+
flags |= 128 /* StartsWithTilde */;
|
|
14316
14238
|
}
|
|
14317
14239
|
if (scannerToken.value.endsWith("~")) {
|
|
14318
|
-
flags |=
|
|
14240
|
+
flags |= 256 /* EndsWithTilde */;
|
|
14319
14241
|
}
|
|
14320
14242
|
break;
|
|
14321
14243
|
case 15 /* LocalizableTextTemplateHead */:
|
|
14322
|
-
flags =
|
|
14244
|
+
flags = 128 /* StartsWithTilde */;
|
|
14323
14245
|
break;
|
|
14324
14246
|
case 16 /* LocalizableTextTemplateTail */:
|
|
14325
|
-
flags =
|
|
14247
|
+
flags = 256 /* EndsWithTilde */;
|
|
14326
14248
|
break;
|
|
14327
14249
|
}
|
|
14328
14250
|
return new Token2(
|
|
@@ -14432,32 +14354,6 @@ var TextParser = class {
|
|
|
14432
14354
|
);
|
|
14433
14355
|
return newToken;
|
|
14434
14356
|
}
|
|
14435
|
-
validateIdentifier(identifier2, range) {
|
|
14436
|
-
if ((identifier2.flags & 16 /* EscapedKeyword */) !== 0 && (identifier2.flags & 4 /* QuotedName */) === 0) {
|
|
14437
|
-
this.tryReportDiagnosticAtRange(range, 1126 /* NameThatMatchesKeywordMustBeEnclosedInSingleQuotes */);
|
|
14438
|
-
return false;
|
|
14439
|
-
}
|
|
14440
|
-
return true;
|
|
14441
|
-
}
|
|
14442
|
-
validateDeclarationOrTranslationName(identifier2, range, kind) {
|
|
14443
|
-
if ((identifier2.flags & 32 /* HasBackQuotes */) !== 0) {
|
|
14444
|
-
if (kind === 1 /* ParameterDeclaration */) {
|
|
14445
|
-
if ((identifier2.flags & 64 /* ConflictResolvingParameterName */) === 0) {
|
|
14446
|
-
this.tryReportDiagnosticAtRange(range, 1123 /* ParameterNameCanContainOnlyOneBackQuote */);
|
|
14447
|
-
}
|
|
14448
|
-
} else if (kind === 2 /* FieldDeclaration */ || kind === 3 /* FieldTranslation */) {
|
|
14449
|
-
if ((identifier2.flags & 128 /* BackingVariableName */) === 0) {
|
|
14450
|
-
this.tryReportDiagnosticAtRange(
|
|
14451
|
-
range,
|
|
14452
|
-
1124 /* FieldNameCanContainOnlyTwoBackQuote */,
|
|
14453
|
-
1 /* Warning */
|
|
14454
|
-
);
|
|
14455
|
-
}
|
|
14456
|
-
} else {
|
|
14457
|
-
this.tryReportDiagnosticAtRange(range, 1125 /* BackQuotesCanOnlyBeUsedInParameterAndFieldNames */);
|
|
14458
|
-
}
|
|
14459
|
-
}
|
|
14460
|
-
}
|
|
14461
14357
|
getCurrentTokenOrKeywordName() {
|
|
14462
14358
|
const tokenOrKeyword = this.currentTokenOrKeyword_;
|
|
14463
14359
|
if (tokenOrKeyword.kind === 0 /* Token */) {
|
|
@@ -14702,10 +14598,7 @@ var PackageImportDirectiveParser = class extends BlockElementListParser {
|
|
|
14702
14598
|
}
|
|
14703
14599
|
parsePackageName() {
|
|
14704
14600
|
const packageNameStart = this.parser.tokenOrKeywordStartPosition();
|
|
14705
|
-
const parts = [this.parser.parseIdentifier(
|
|
14706
|
-
0 /* None */,
|
|
14707
|
-
1102 /* PackageNameExpected */
|
|
14708
|
-
)];
|
|
14601
|
+
const parts = [this.parser.parseIdentifier(1102 /* PackageNameExpected */)];
|
|
14709
14602
|
while (this.parser.isToken(34 /* Dot */)) {
|
|
14710
14603
|
parts.push(this.parser.parseExpectedToken(34 /* Dot */));
|
|
14711
14604
|
parts.push(this.parser.parseIdentifier());
|
|
@@ -14856,7 +14749,7 @@ var StatementParser = class _StatementParser {
|
|
|
14856
14749
|
}
|
|
14857
14750
|
parseErrorVariableDeclaration() {
|
|
14858
14751
|
const declarationStart = this.parser.tokenOrKeywordStartPosition();
|
|
14859
|
-
const name = this.parser.parseIdentifier(
|
|
14752
|
+
const name = this.parser.parseIdentifier();
|
|
14860
14753
|
let typeAnnotation;
|
|
14861
14754
|
if (this.parser.typeAnnotationParser.isStartOfTypeAnnotation()) {
|
|
14862
14755
|
typeAnnotation = this.parser.typeAnnotationParser.parseTypeAnnotation();
|
|
@@ -14888,10 +14781,7 @@ var StatementParser = class _StatementParser {
|
|
|
14888
14781
|
}
|
|
14889
14782
|
parseForStatementVariableDeclaration() {
|
|
14890
14783
|
const declarationStart = this.parser.tokenOrKeywordStartPosition();
|
|
14891
|
-
const name = this.parser.parseIdentifier(
|
|
14892
|
-
4 /* Other */,
|
|
14893
|
-
1105 /* ForStatementVariableDeclarationExpected */
|
|
14894
|
-
);
|
|
14784
|
+
const name = this.parser.parseIdentifier(1105 /* ForStatementVariableDeclarationExpected */);
|
|
14895
14785
|
return new ForStatementVariableDeclaration(name, this.parser.rangeFrom(declarationStart));
|
|
14896
14786
|
}
|
|
14897
14787
|
canParseOptionalExpression(isFollowedByStatementBlock) {
|
|
@@ -14989,7 +14879,7 @@ var StatementParser = class _StatementParser {
|
|
|
14989
14879
|
} else {
|
|
14990
14880
|
letOrVarKeyword = this.parser.parseExpectedKeyword(1 /* Let */);
|
|
14991
14881
|
}
|
|
14992
|
-
const name = this.parser.parseIdentifier(
|
|
14882
|
+
const name = this.parser.parseIdentifier();
|
|
14993
14883
|
let typeAnnotation;
|
|
14994
14884
|
if (this.parser.typeAnnotationParser.isStartOfTypeAnnotation()) {
|
|
14995
14885
|
typeAnnotation = this.parser.typeAnnotationParser.parseTypeAnnotation();
|
|
@@ -15076,7 +14966,7 @@ var StatementParser = class _StatementParser {
|
|
|
15076
14966
|
const declarationStart = this.parser.tokenOrKeywordStartPosition();
|
|
15077
14967
|
const asyncKeyword = this.parser.parseOptionalKeyword(44 /* Async */);
|
|
15078
14968
|
const functionKeyword = this.parser.parseExpectedKeyword(16 /* Function */);
|
|
15079
|
-
const name = this.parser.parseIdentifier(
|
|
14969
|
+
const name = this.parser.parseIdentifier();
|
|
15080
14970
|
let typeParameterClause;
|
|
15081
14971
|
if (this.parser.typeParameterClauseParser.isStartOfTypeParameterClause()) {
|
|
15082
14972
|
typeParameterClause = this.parser.typeParameterClauseParser.parseTypeParameterClause();
|
|
@@ -15762,13 +15652,13 @@ var ExpressionParser = class _ExpressionParser {
|
|
|
15762
15652
|
const literalStart = this.parser.tokenOrKeywordStartPosition();
|
|
15763
15653
|
const text = this.parser.parseExpectedToken(5 /* TextLiteral */);
|
|
15764
15654
|
let result;
|
|
15765
|
-
if ((text.flags &
|
|
15766
|
-
let
|
|
15655
|
+
if ((text.flags & 384 /* LocalizableText */) !== 0) {
|
|
15656
|
+
let key;
|
|
15767
15657
|
const currentToken = this.parser.getCurrentTokenOrKeyword();
|
|
15768
|
-
if ((text.flags &
|
|
15769
|
-
|
|
15658
|
+
if ((text.flags & 256 /* EndsWithTilde */) !== 0 && text.trailingTrivia.length === 0 && currentToken.kind === 0 /* Token */ && currentToken.tokenKind === 5 /* TextLiteral */ && currentToken.leadingTrivia.length === 0) {
|
|
15659
|
+
key = this.parser.parseExpectedToken(5 /* TextLiteral */);
|
|
15770
15660
|
}
|
|
15771
|
-
result = new LocalizableTextLiteral(text,
|
|
15661
|
+
result = new LocalizableTextLiteral(text, key, this.parser.rangeFrom(literalStart));
|
|
15772
15662
|
} else {
|
|
15773
15663
|
result = new TextLiteral(text, this.parser.rangeFrom(literalStart));
|
|
15774
15664
|
}
|
|
@@ -15781,13 +15671,13 @@ var ExpressionParser = class _ExpressionParser {
|
|
|
15781
15671
|
const spans = spanList.spans;
|
|
15782
15672
|
const tail = spans.length > 0 ? spans[spans.length - 1] : void 0;
|
|
15783
15673
|
let result;
|
|
15784
|
-
if ((head.flags &
|
|
15785
|
-
let
|
|
15674
|
+
if ((head.flags & 384 /* LocalizableText */) !== 0 || tail !== void 0 && (tail.text.flags & 384 /* LocalizableText */) !== 0) {
|
|
15675
|
+
let key;
|
|
15786
15676
|
const currentToken = this.parser.getCurrentTokenOrKeyword();
|
|
15787
|
-
if (tail !== void 0 && (tail.text.flags &
|
|
15788
|
-
|
|
15677
|
+
if (tail !== void 0 && (tail.text.flags & 256 /* EndsWithTilde */) !== 0 && tail.text.trailingTrivia.length === 0 && currentToken.kind === 0 /* Token */ && currentToken.tokenKind === 5 /* TextLiteral */ && currentToken.leadingTrivia.length === 0) {
|
|
15678
|
+
key = this.parser.parseExpectedToken(5 /* TextLiteral */);
|
|
15789
15679
|
}
|
|
15790
|
-
result = new LocalizableTextTemplateLiteral(head, spanList,
|
|
15680
|
+
result = new LocalizableTextTemplateLiteral(head, spanList, key, this.parser.rangeFrom(literalStart));
|
|
15791
15681
|
} else {
|
|
15792
15682
|
result = new TextTemplateLiteral(head, spanList, this.parser.rangeFrom(literalStart));
|
|
15793
15683
|
}
|
|
@@ -15879,7 +15769,7 @@ var PackageMemberDeclarationParser = class {
|
|
|
15879
15769
|
);
|
|
15880
15770
|
}
|
|
15881
15771
|
parsePackageVariableDeclaration(declarationStart, tagList, modifierList) {
|
|
15882
|
-
const name = this.parser.parseIdentifier(
|
|
15772
|
+
const name = this.parser.parseIdentifier();
|
|
15883
15773
|
let typeAnnotation;
|
|
15884
15774
|
if (this.parser.typeAnnotationParser.isStartOfTypeAnnotation()) {
|
|
15885
15775
|
typeAnnotation = this.parser.typeAnnotationParser.parseTypeAnnotation();
|
|
@@ -15901,7 +15791,7 @@ var PackageMemberDeclarationParser = class {
|
|
|
15901
15791
|
}
|
|
15902
15792
|
parsePackageVariableGetterDeclaration(declarationStart, tagList, modifierList) {
|
|
15903
15793
|
const getKeyword = this.parser.parseExpectedKeyword(62 /* Get */);
|
|
15904
|
-
const name = this.parser.parseIdentifier(
|
|
15794
|
+
const name = this.parser.parseIdentifier();
|
|
15905
15795
|
const typeAnnotation = this.parser.typeAnnotationParser.parseTypeAnnotation();
|
|
15906
15796
|
const block = this.parser.parseOptionalFunctionBlock();
|
|
15907
15797
|
return new PackageVariableGetterDeclaration(
|
|
@@ -15916,7 +15806,7 @@ var PackageMemberDeclarationParser = class {
|
|
|
15916
15806
|
}
|
|
15917
15807
|
parsePackageVariableSetterDeclaration(declarationStart, tagList, modifierList) {
|
|
15918
15808
|
const setKeyword = this.parser.parseExpectedKeyword(63 /* Set */);
|
|
15919
|
-
const name = this.parser.parseIdentifier(
|
|
15809
|
+
const name = this.parser.parseIdentifier();
|
|
15920
15810
|
const block = this.parser.parseOptionalFunctionBlock();
|
|
15921
15811
|
return new PackageVariableSetterDeclaration(
|
|
15922
15812
|
tagList,
|
|
@@ -15929,7 +15819,7 @@ var PackageMemberDeclarationParser = class {
|
|
|
15929
15819
|
}
|
|
15930
15820
|
parsePackageFunctionDeclaration(declarationStart, tagList, modifierList) {
|
|
15931
15821
|
const functionKeyword = this.parser.parseExpectedKeyword(16 /* Function */);
|
|
15932
|
-
const name = this.parser.parseIdentifier(
|
|
15822
|
+
const name = this.parser.parseIdentifier();
|
|
15933
15823
|
let typeParameterClause;
|
|
15934
15824
|
if (this.parser.typeParameterClauseParser.isStartOfTypeParameterClause()) {
|
|
15935
15825
|
typeParameterClause = this.parser.typeParameterClauseParser.parseTypeParameterClause();
|
|
@@ -16001,7 +15891,7 @@ var PackageMemberDeclarationParser = class {
|
|
|
16001
15891
|
}
|
|
16002
15892
|
parseAliasTypeDeclaration(declarationStart, tagList, modifierList) {
|
|
16003
15893
|
const typeKeyword = this.parser.parseExpectedKeyword(20 /* Type */);
|
|
16004
|
-
const name = this.parser.parseIdentifier(
|
|
15894
|
+
const name = this.parser.parseIdentifier();
|
|
16005
15895
|
let typeParameterClause;
|
|
16006
15896
|
if (this.parser.typeParameterClauseParser.isStartOfTypeParameterClause()) {
|
|
16007
15897
|
typeParameterClause = this.parser.typeParameterClauseParser.parseTypeParameterClause();
|
|
@@ -16026,7 +15916,7 @@ var PackageMemberDeclarationParser = class {
|
|
|
16026
15916
|
}
|
|
16027
15917
|
parseClassDeclaration(declarationStart, tagList, modifierList) {
|
|
16028
15918
|
const classKeyword = this.parser.parseExpectedKeyword(3 /* Class */);
|
|
16029
|
-
const name = this.parser.parseIdentifier(
|
|
15919
|
+
const name = this.parser.parseIdentifier();
|
|
16030
15920
|
let typeParameterClause;
|
|
16031
15921
|
if (this.parser.typeParameterClauseParser.isStartOfTypeParameterClause()) {
|
|
16032
15922
|
typeParameterClause = this.parser.typeParameterClauseParser.parseTypeParameterClause();
|
|
@@ -16049,7 +15939,7 @@ var PackageMemberDeclarationParser = class {
|
|
|
16049
15939
|
}
|
|
16050
15940
|
parseStructureDeclaration(declarationStart, tagList, modifierList) {
|
|
16051
15941
|
const structureKeyword = this.parser.parseExpectedKeyword(4 /* Structure */);
|
|
16052
|
-
const name = this.parser.parseIdentifier(
|
|
15942
|
+
const name = this.parser.parseIdentifier();
|
|
16053
15943
|
let typeParameterClause;
|
|
16054
15944
|
if (this.parser.typeParameterClauseParser.isStartOfTypeParameterClause()) {
|
|
16055
15945
|
typeParameterClause = this.parser.typeParameterClauseParser.parseTypeParameterClause();
|
|
@@ -16072,7 +15962,7 @@ var PackageMemberDeclarationParser = class {
|
|
|
16072
15962
|
}
|
|
16073
15963
|
parseAspectOrReducedTypeDeclaration(declarationStart, tagList, modifierList) {
|
|
16074
15964
|
const aspectKeyword = this.parser.parseExpectedKeyword(5 /* Aspect */);
|
|
16075
|
-
const name = this.parser.parseIdentifier(
|
|
15965
|
+
const name = this.parser.parseIdentifier();
|
|
16076
15966
|
let typeParameterClause;
|
|
16077
15967
|
if (this.parser.typeParameterClauseParser.isStartOfTypeParameterClause()) {
|
|
16078
15968
|
typeParameterClause = this.parser.typeParameterClauseParser.parseTypeParameterClause();
|
|
@@ -16112,7 +16002,7 @@ var PackageMemberDeclarationParser = class {
|
|
|
16112
16002
|
}
|
|
16113
16003
|
parseVariantDeclaration(declarationStart, tagList, modifierList) {
|
|
16114
16004
|
const variantKeyword = this.parser.parseExpectedKeyword(8 /* Variant */);
|
|
16115
|
-
const name = this.parser.parseIdentifier(
|
|
16005
|
+
const name = this.parser.parseIdentifier();
|
|
16116
16006
|
let typeParameterClause;
|
|
16117
16007
|
if (this.parser.typeParameterClauseParser.isStartOfTypeParameterClause()) {
|
|
16118
16008
|
typeParameterClause = this.parser.typeParameterClauseParser.parseTypeParameterClause();
|
|
@@ -16300,7 +16190,7 @@ var TypeMemberDeclarationParser = class extends BlockElementListParser {
|
|
|
16300
16190
|
return parsingFunction(declarationStart, tagList, modifierList);
|
|
16301
16191
|
}
|
|
16302
16192
|
parseVariantValueDeclaration(declarationStart, tagList, modifierList) {
|
|
16303
|
-
const identifier2 = this.parser.parseIdentifier(
|
|
16193
|
+
const identifier2 = this.parser.parseIdentifier();
|
|
16304
16194
|
let value;
|
|
16305
16195
|
const equalsToken = this.parser.parseOptionalToken(64 /* Equals */);
|
|
16306
16196
|
if (equalsToken !== void 0) {
|
|
@@ -16317,7 +16207,7 @@ var TypeMemberDeclarationParser = class extends BlockElementListParser {
|
|
|
16317
16207
|
}
|
|
16318
16208
|
parseMethodDeclaration(declarationStart, tagList, modifierList) {
|
|
16319
16209
|
const functionKeyword = this.parser.parseExpectedKeyword(16 /* Function */);
|
|
16320
|
-
const name = this.parser.parseIdentifier(
|
|
16210
|
+
const name = this.parser.parseIdentifier();
|
|
16321
16211
|
let typeParameterClause;
|
|
16322
16212
|
if (this.parser.typeParameterClauseParser.isStartOfTypeParameterClause()) {
|
|
16323
16213
|
typeParameterClause = this.parser.typeParameterClauseParser.parseTypeParameterClause();
|
|
@@ -16367,7 +16257,7 @@ var TypeMemberDeclarationParser = class extends BlockElementListParser {
|
|
|
16367
16257
|
);
|
|
16368
16258
|
}
|
|
16369
16259
|
parseFieldDeclaration(declarationStart, tagList, modifierList) {
|
|
16370
|
-
const name = this.parser.parseIdentifier(
|
|
16260
|
+
const name = this.parser.parseIdentifier();
|
|
16371
16261
|
let typeAnnotation;
|
|
16372
16262
|
if (this.parser.typeAnnotationParser.isStartOfTypeAnnotation()) {
|
|
16373
16263
|
typeAnnotation = this.parser.typeAnnotationParser.parseTypeAnnotation();
|
|
@@ -16426,7 +16316,7 @@ var TypeMemberDeclarationParser = class extends BlockElementListParser {
|
|
|
16426
16316
|
);
|
|
16427
16317
|
}
|
|
16428
16318
|
parseFieldGetterDeclaration(declarationStart, tagList, modifierList, getKeyword) {
|
|
16429
|
-
const name = this.parser.parseIdentifier(
|
|
16319
|
+
const name = this.parser.parseIdentifier();
|
|
16430
16320
|
const typeAnnotation = this.parser.typeAnnotationParser.parseTypeAnnotation();
|
|
16431
16321
|
const block = this.parser.parseOptionalFunctionBlock();
|
|
16432
16322
|
return new FieldGetterDeclaration(
|
|
@@ -16474,7 +16364,7 @@ var TypeMemberDeclarationParser = class extends BlockElementListParser {
|
|
|
16474
16364
|
);
|
|
16475
16365
|
}
|
|
16476
16366
|
parseFieldSetterDeclaration(declarationStart, tagList, modifierList, setKeyword) {
|
|
16477
|
-
const name = this.parser.parseIdentifier(
|
|
16367
|
+
const name = this.parser.parseIdentifier();
|
|
16478
16368
|
const block = this.parser.parseOptionalFunctionBlock();
|
|
16479
16369
|
return new FieldSetterDeclaration(
|
|
16480
16370
|
tagList,
|
|
@@ -16547,7 +16437,7 @@ var TagListParser = class {
|
|
|
16547
16437
|
parseTag() {
|
|
16548
16438
|
const tagStart = this.parser.tokenOrKeywordStartPosition();
|
|
16549
16439
|
const hashSignToken = this.parser.parseExpectedToken(42 /* HashSign */);
|
|
16550
|
-
const name = this.parser.parseQualifiedName(
|
|
16440
|
+
const name = this.parser.parseQualifiedName(1123 /* TagNameExpected */);
|
|
16551
16441
|
let typeArgumentClause;
|
|
16552
16442
|
if (this.parser.typeArgumentParser.isStartOfTypeArgumentClause()) {
|
|
16553
16443
|
typeArgumentClause = this.parser.typeArgumentParser.parseTypeArgumentClause();
|
|
@@ -16895,11 +16785,11 @@ var ArgumentListParser = class extends ListParser {
|
|
|
16895
16785
|
let name;
|
|
16896
16786
|
let equalsToken;
|
|
16897
16787
|
const isNamedArgumentDeclaration = this.parser.lookAhead(() => {
|
|
16898
|
-
const name2 = this.parser.parseParameterName(
|
|
16788
|
+
const name2 = this.parser.parseParameterName();
|
|
16899
16789
|
return !name2.isMissing && this.parser.isToken(64 /* Equals */);
|
|
16900
16790
|
});
|
|
16901
16791
|
if (isNamedArgumentDeclaration) {
|
|
16902
|
-
name = this.parser.parseParameterName(
|
|
16792
|
+
name = this.parser.parseParameterName();
|
|
16903
16793
|
equalsToken = this.parser.parseExpectedToken(64 /* Equals */);
|
|
16904
16794
|
}
|
|
16905
16795
|
const expression = this.parser.expressionParser.parseExpression(false);
|
|
@@ -17004,7 +16894,7 @@ var TypeParameterClauseParser = class extends ListParser {
|
|
|
17004
16894
|
}
|
|
17005
16895
|
parseTypeParameterDeclaration() {
|
|
17006
16896
|
const declarationStart = this.parser.tokenOrKeywordStartPosition();
|
|
17007
|
-
const name = this.parser.parseIdentifier(
|
|
16897
|
+
const name = this.parser.parseIdentifier();
|
|
17008
16898
|
let typeConstraint;
|
|
17009
16899
|
const colonToken = this.parser.parseOptionalToken(31 /* Colon */);
|
|
17010
16900
|
if (colonToken !== void 0) {
|
|
@@ -17123,7 +17013,7 @@ var ParameterDeclarationParser = class {
|
|
|
17123
17013
|
parseParameterDeclaration() {
|
|
17124
17014
|
const parameterStart = this.parser.tokenOrKeywordStartPosition();
|
|
17125
17015
|
const tagList = this.parser.tagListParser.parseTagList();
|
|
17126
|
-
const name = this.parser.parseParameterName(
|
|
17016
|
+
const name = this.parser.parseParameterName();
|
|
17127
17017
|
let typeAnnotation;
|
|
17128
17018
|
if (this.parser.typeAnnotationParser.isStartOfTypeAnnotation()) {
|
|
17129
17019
|
typeAnnotation = this.parser.typeAnnotationParser.parseTypeAnnotation();
|
|
@@ -17207,7 +17097,7 @@ var TranslationsDeclarationParser = class extends BlockElementListParser {
|
|
|
17207
17097
|
return this.parseTopLevelTranslation();
|
|
17208
17098
|
}
|
|
17209
17099
|
skipUnknownElement() {
|
|
17210
|
-
this.parser.tryReportDiagnosticAtCurrentRange(
|
|
17100
|
+
this.parser.tryReportDiagnosticAtCurrentRange(1125 /* TranslationExpected */);
|
|
17211
17101
|
this.parser.skipTokenOrKeyword();
|
|
17212
17102
|
}
|
|
17213
17103
|
isStartOfTopLevelTranslation() {
|
|
@@ -17261,9 +17151,9 @@ var TranslationsDeclarationParser = class extends BlockElementListParser {
|
|
|
17261
17151
|
}
|
|
17262
17152
|
parsePackageVariableTranslation() {
|
|
17263
17153
|
const translationStart = this.parser.tokenOrKeywordStartPosition();
|
|
17264
|
-
const sourceName = this.parser.parseIdentifier(
|
|
17154
|
+
const sourceName = this.parser.parseIdentifier();
|
|
17265
17155
|
const minusGreaterThanToken = this.parser.parseExpectedToken(49 /* MinusGreaterThan */);
|
|
17266
|
-
const translatedName = this.parser.parseIdentifier(
|
|
17156
|
+
const translatedName = this.parser.parseIdentifier();
|
|
17267
17157
|
return new PackageVariableTranslationDeclaration(
|
|
17268
17158
|
sourceName,
|
|
17269
17159
|
minusGreaterThanToken,
|
|
@@ -17274,11 +17164,11 @@ var TranslationsDeclarationParser = class extends BlockElementListParser {
|
|
|
17274
17164
|
parsePackageFunctionTranslation() {
|
|
17275
17165
|
const translationStart = this.parser.tokenOrKeywordStartPosition();
|
|
17276
17166
|
const functionKeyword = this.parser.parseExpectedKeyword(16 /* Function */);
|
|
17277
|
-
const sourceName = this.parser.parseIdentifier(
|
|
17167
|
+
const sourceName = this.parser.parseIdentifier();
|
|
17278
17168
|
const sourceTypeParameterClause = this.parseOptionalTypeParameterClause();
|
|
17279
17169
|
const sourceParameterClause = this.parseParameterClause();
|
|
17280
17170
|
const minusGreaterThanToken = this.parser.parseExpectedToken(49 /* MinusGreaterThan */);
|
|
17281
|
-
const translatedName = this.parser.parseIdentifier(
|
|
17171
|
+
const translatedName = this.parser.parseIdentifier();
|
|
17282
17172
|
const translatedTypeParameterClause = this.parseOptionalTypeParameterClause();
|
|
17283
17173
|
const translatedParameterClause = this.parseParameterClause();
|
|
17284
17174
|
return new PackageFunctionTranslationDeclaration(
|
|
@@ -17296,11 +17186,11 @@ var TranslationsDeclarationParser = class extends BlockElementListParser {
|
|
|
17296
17186
|
parseMethodTranslation() {
|
|
17297
17187
|
const translationStart = this.parser.tokenOrKeywordStartPosition();
|
|
17298
17188
|
const functionKeyword = this.parser.parseExpectedKeyword(16 /* Function */);
|
|
17299
|
-
const sourceName = this.parser.parseIdentifier(
|
|
17189
|
+
const sourceName = this.parser.parseIdentifier();
|
|
17300
17190
|
const sourceTypeParameterClause = this.parseOptionalTypeParameterClause();
|
|
17301
17191
|
const sourceParameterClause = this.parseParameterClause();
|
|
17302
17192
|
const minusGreaterThanToken = this.parser.parseExpectedToken(49 /* MinusGreaterThan */);
|
|
17303
|
-
const translatedName = this.parser.parseIdentifier(
|
|
17193
|
+
const translatedName = this.parser.parseIdentifier();
|
|
17304
17194
|
const translatedTypeParameterClause = this.parseOptionalTypeParameterClause();
|
|
17305
17195
|
const translatedParameterClause = this.parseParameterClause();
|
|
17306
17196
|
return new MethodTranslation(
|
|
@@ -17317,9 +17207,9 @@ var TranslationsDeclarationParser = class extends BlockElementListParser {
|
|
|
17317
17207
|
}
|
|
17318
17208
|
parseFieldOrVariantTranslation() {
|
|
17319
17209
|
const translationStart = this.parser.tokenOrKeywordStartPosition();
|
|
17320
|
-
const sourceName = this.parser.parseIdentifier(
|
|
17210
|
+
const sourceName = this.parser.parseIdentifier();
|
|
17321
17211
|
const minusGreaterThanToken = this.parser.parseExpectedToken(49 /* MinusGreaterThan */);
|
|
17322
|
-
const translatedName = this.parser.parseIdentifier(
|
|
17212
|
+
const translatedName = this.parser.parseIdentifier();
|
|
17323
17213
|
return new FieldOrVariantTranslation(
|
|
17324
17214
|
sourceName,
|
|
17325
17215
|
minusGreaterThanToken,
|
|
@@ -17402,7 +17292,7 @@ var TranslationsDeclarationParser = class extends BlockElementListParser {
|
|
|
17402
17292
|
parseTypeOrFunctionTypeTranslation() {
|
|
17403
17293
|
const translationStart = this.parser.tokenOrKeywordStartPosition();
|
|
17404
17294
|
const typeKeyword = this.parser.parseExpectedKeyword(20 /* Type */);
|
|
17405
|
-
const sourceName = this.parser.parseIdentifier(
|
|
17295
|
+
const sourceName = this.parser.parseIdentifier();
|
|
17406
17296
|
const sourceTypeParameterClause = this.parseOptionalTypeParameterClause();
|
|
17407
17297
|
if (this.parser.isToken(51 /* OpenParenthesis */)) {
|
|
17408
17298
|
return this.parseFunctionTypeTranslation(translationStart, typeKeyword, sourceName, sourceTypeParameterClause);
|
|
@@ -17412,7 +17302,7 @@ var TranslationsDeclarationParser = class extends BlockElementListParser {
|
|
|
17412
17302
|
}
|
|
17413
17303
|
parseTypeTranslation(translationStart, typeKeyword, sourceName, sourceTypeParameterClause) {
|
|
17414
17304
|
const minusGreaterThanToken = this.parser.parseExpectedToken(49 /* MinusGreaterThan */);
|
|
17415
|
-
const translatedName = this.parser.parseIdentifier(
|
|
17305
|
+
const translatedName = this.parser.parseIdentifier();
|
|
17416
17306
|
const translatedTypeParameterClause = this.parseOptionalTypeParameterClause();
|
|
17417
17307
|
let memberList;
|
|
17418
17308
|
let closeBraceToken;
|
|
@@ -17439,7 +17329,7 @@ var TranslationsDeclarationParser = class extends BlockElementListParser {
|
|
|
17439
17329
|
parseFunctionTypeTranslation(translationStart, typeKeyword, sourceName, sourceTypeParameterClause) {
|
|
17440
17330
|
const sourceParameterClause = this.parseParameterClause();
|
|
17441
17331
|
const minusGreaterThanToken = this.parser.parseExpectedToken(49 /* MinusGreaterThan */);
|
|
17442
|
-
const translatedName = this.parser.parseIdentifier(
|
|
17332
|
+
const translatedName = this.parser.parseIdentifier();
|
|
17443
17333
|
const translatedTypeParameterClause = this.parseOptionalTypeParameterClause();
|
|
17444
17334
|
const translatedParameterClause = this.parseParameterClause();
|
|
17445
17335
|
return new FunctionTypeTranslationDeclaration(
|
|
@@ -17469,10 +17359,10 @@ var TranslationsDeclarationParser = class extends BlockElementListParser {
|
|
|
17469
17359
|
switch (tokenOrKeyword.tokenKind) {
|
|
17470
17360
|
case 5 /* TextLiteral */: {
|
|
17471
17361
|
const targetText = this.parser.expressionParser.parseTextLiteral();
|
|
17472
|
-
if ((targetText.text.flags &
|
|
17362
|
+
if ((targetText.text.flags & 384 /* LocalizableText */) !== 0) {
|
|
17473
17363
|
this.parser.tryReportDiagnosticAtRange(
|
|
17474
17364
|
targetText.rangeWithoutTrivia,
|
|
17475
|
-
|
|
17365
|
+
1127 /* TranslatedTextCannotBeginOrEndWithTilde */
|
|
17476
17366
|
);
|
|
17477
17367
|
}
|
|
17478
17368
|
result = new TextTranslationDeclaration(
|
|
@@ -17487,10 +17377,10 @@ var TranslationsDeclarationParser = class extends BlockElementListParser {
|
|
|
17487
17377
|
const textTemplate = this.parser.expressionParser.parseTextTemplateLiteral();
|
|
17488
17378
|
const spans = textTemplate.spanList.spans;
|
|
17489
17379
|
const tail = spans.length > 0 ? spans[spans.length - 1] : void 0;
|
|
17490
|
-
if ((textTemplate.head.flags &
|
|
17380
|
+
if ((textTemplate.head.flags & 384 /* LocalizableText */) !== 0 || tail !== void 0 && (tail.text.flags & 384 /* LocalizableText */) !== 0) {
|
|
17491
17381
|
this.parser.tryReportDiagnosticAtRange(
|
|
17492
17382
|
textTemplate.rangeWithoutTrivia,
|
|
17493
|
-
|
|
17383
|
+
1127 /* TranslatedTextCannotBeginOrEndWithTilde */
|
|
17494
17384
|
);
|
|
17495
17385
|
}
|
|
17496
17386
|
result = new TextTranslationDeclaration(
|
|
@@ -17517,7 +17407,7 @@ var TranslationsDeclarationParser = class extends BlockElementListParser {
|
|
|
17517
17407
|
const missingTextLiteralToken = this.parser.createMissingToken(5 /* TextLiteral */);
|
|
17518
17408
|
const targetText = new TextLiteral(missingTextLiteralToken, missingTextLiteralToken.rangeWithTrivia);
|
|
17519
17409
|
this.parser.tryReportDiagnosticAtCurrentRange(
|
|
17520
|
-
|
|
17410
|
+
1126 /* TranslatedTextTemplateOrTranslationFunctionBlockExpected */
|
|
17521
17411
|
);
|
|
17522
17412
|
result = new TextTranslationDeclaration(
|
|
17523
17413
|
sourceText,
|
|
@@ -17531,12 +17421,12 @@ var TranslationsDeclarationParser = class extends BlockElementListParser {
|
|
|
17531
17421
|
parseTranslationTextLiteral() {
|
|
17532
17422
|
const literalStart = this.parser.tokenOrKeywordStartPosition();
|
|
17533
17423
|
const text = this.parser.parseExpectedToken(5 /* TextLiteral */);
|
|
17534
|
-
let
|
|
17424
|
+
let key;
|
|
17535
17425
|
const currentToken = this.parser.getCurrentTokenOrKeyword();
|
|
17536
|
-
if ((text.flags &
|
|
17537
|
-
|
|
17426
|
+
if ((text.flags & 256 /* EndsWithTilde */) !== 0 && text.trailingTrivia.length === 0 && currentToken.kind === 0 /* Token */ && currentToken.tokenKind === 5 /* TextLiteral */ && currentToken.leadingTrivia.length === 0) {
|
|
17427
|
+
key = this.parser.parseExpectedToken(5 /* TextLiteral */);
|
|
17538
17428
|
}
|
|
17539
|
-
return new TranslationTextLiteral(text,
|
|
17429
|
+
return new TranslationTextLiteral(text, key, this.parser.rangeFrom(literalStart));
|
|
17540
17430
|
}
|
|
17541
17431
|
parseTranslationTextTemplate() {
|
|
17542
17432
|
const literalStart = this.parser.tokenOrKeywordStartPosition();
|
|
@@ -17554,8 +17444,8 @@ var TranslationsDeclarationParser = class extends BlockElementListParser {
|
|
|
17554
17444
|
spans.push(span);
|
|
17555
17445
|
} while (span.text.tokenKind === 7 /* TextTemplatePart */);
|
|
17556
17446
|
const currentToken = this.parser.getCurrentTokenOrKeyword();
|
|
17557
|
-
if ((span.text.flags &
|
|
17558
|
-
code = this.parser.parseExpectedToken(
|
|
17447
|
+
if ((span.text.flags & 256 /* EndsWithTilde */) !== 0 && span.text.trailingTrivia.length === 0 && currentToken.kind === 0 /* Token */ && currentToken.tokenKind === 5 /* TextLiteral */ && currentToken.leadingTrivia.length === 0) {
|
|
17448
|
+
code = this.parser.parseExpectedToken(5 /* TextLiteral */);
|
|
17559
17449
|
}
|
|
17560
17450
|
}
|
|
17561
17451
|
const spanList = new TranslationTextTemplateSpanList(spans, this.parser.rangeFrom(spanListStart));
|
|
@@ -17563,7 +17453,7 @@ var TranslationsDeclarationParser = class extends BlockElementListParser {
|
|
|
17563
17453
|
}
|
|
17564
17454
|
parseTranslationTextTemplateParameter() {
|
|
17565
17455
|
const parameterStart = this.parser.tokenOrKeywordStartPosition();
|
|
17566
|
-
const name = this.parser.parseIdentifier(
|
|
17456
|
+
const name = this.parser.parseIdentifier();
|
|
17567
17457
|
let typeAnnotation;
|
|
17568
17458
|
if (this.parser.typeAnnotationParser.isStartOfTypeAnnotation()) {
|
|
17569
17459
|
typeAnnotation = this.parser.typeAnnotationParser.parseTypeAnnotation();
|
|
@@ -17583,7 +17473,7 @@ var TypeMemberTranslationListParser = class extends BlockElementListParser {
|
|
|
17583
17473
|
return this.parentParser.parseTypeMemberTranslation();
|
|
17584
17474
|
}
|
|
17585
17475
|
skipUnknownElement() {
|
|
17586
|
-
this.parser.tryReportDiagnosticAtCurrentRange(
|
|
17476
|
+
this.parser.tryReportDiagnosticAtCurrentRange(1124 /* TypeMemberTranslationExpected */);
|
|
17587
17477
|
this.parser.skipTokenOrKeyword();
|
|
17588
17478
|
}
|
|
17589
17479
|
};
|
|
@@ -17599,7 +17489,7 @@ var TranslationParameterListParser = class extends ListParser {
|
|
|
17599
17489
|
return this.parser.isStartOfParameterName();
|
|
17600
17490
|
}
|
|
17601
17491
|
parseExpectedElement() {
|
|
17602
|
-
return this.parser.parseParameterName(
|
|
17492
|
+
return this.parser.parseParameterName();
|
|
17603
17493
|
}
|
|
17604
17494
|
parseMissingElement() {
|
|
17605
17495
|
this.parser.tryReportDiagnosticAtCurrentRange(1100 /* IdentifierExpected */);
|
|
@@ -17621,7 +17511,7 @@ var TranslationTypeParameterListParser = class extends ListParser {
|
|
|
17621
17511
|
return this.parser.isToken(9 /* Identifier */);
|
|
17622
17512
|
}
|
|
17623
17513
|
parseExpectedElement() {
|
|
17624
|
-
return this.parser.parseIdentifier(
|
|
17514
|
+
return this.parser.parseIdentifier();
|
|
17625
17515
|
}
|
|
17626
17516
|
parseMissingElement() {
|
|
17627
17517
|
this.parser.tryReportDiagnosticAtCurrentRange(1100 /* IdentifierExpected */);
|
|
@@ -20980,7 +20870,7 @@ var TagBase = class {
|
|
|
20980
20870
|
get argumentByNameKey() {
|
|
20981
20871
|
return this.argumentByNameKey_.getOrInsertWith(() => Query.toMap(
|
|
20982
20872
|
this.argumentByParameter,
|
|
20983
|
-
(tuple) => tuple[0].getOriginalEntity().getName().
|
|
20873
|
+
(tuple) => tuple[0].getOriginalEntity().getName().key,
|
|
20984
20874
|
(tuple) => tuple[1]
|
|
20985
20875
|
));
|
|
20986
20876
|
}
|
|
@@ -22752,17 +22642,17 @@ var PackageName2 = class _PackageName {
|
|
|
22752
22642
|
this.segments = segments;
|
|
22753
22643
|
}
|
|
22754
22644
|
get key() {
|
|
22755
|
-
return this.segments.map((s) => s.
|
|
22645
|
+
return this.segments.map((s) => s.key).join(".");
|
|
22756
22646
|
}
|
|
22757
22647
|
static parse(name) {
|
|
22758
22648
|
const segments = name.split(".").map((s) => Name.parse(s));
|
|
22759
22649
|
return new _PackageName(createNonEmptyArray(segments));
|
|
22760
22650
|
}
|
|
22761
22651
|
considerEqual(name) {
|
|
22762
|
-
return this.segments.length === name.segments.length && this.segments.every((s, i) => s.considerEqual(name.segments[i]
|
|
22652
|
+
return this.segments.length === name.segments.length && this.segments.every((s, i) => s.considerEqual(name.segments[i]));
|
|
22763
22653
|
}
|
|
22764
22654
|
toString(original = true) {
|
|
22765
|
-
return this.segments.map((s) => original ? s.unescapedOriginal : s.
|
|
22655
|
+
return this.segments.map((s) => original ? s.unescapedOriginal : s.key).join(".");
|
|
22766
22656
|
}
|
|
22767
22657
|
};
|
|
22768
22658
|
var RequiredPackageConfig;
|
|
@@ -26192,9 +26082,6 @@ var TextTemplateEmitOptions = class _TextTemplateEmitOptions {
|
|
|
26192
26082
|
this.flags = flagsOrFirstFlag ?? 0 /* None */;
|
|
26193
26083
|
}
|
|
26194
26084
|
}
|
|
26195
|
-
static default() {
|
|
26196
|
-
return new _TextTemplateEmitOptions(1 /* CreateTextTemplateInstance */);
|
|
26197
|
-
}
|
|
26198
26085
|
get createTextTemplateInstance() {
|
|
26199
26086
|
return (this.flags & 1 /* CreateTextTemplateInstance */) !== 0;
|
|
26200
26087
|
}
|
|
@@ -27572,20 +27459,30 @@ var TextLiteral2 = class _TextLiteral {
|
|
|
27572
27459
|
this.value = value;
|
|
27573
27460
|
this.sourceLocation = sourceLocation;
|
|
27574
27461
|
this.kind = 46 /* TextLiteral */;
|
|
27462
|
+
this.options = new TextTemplateEmitOptions(false);
|
|
27463
|
+
}
|
|
27464
|
+
withOptions(options) {
|
|
27465
|
+
this.options = options;
|
|
27466
|
+
return this;
|
|
27575
27467
|
}
|
|
27576
27468
|
clone() {
|
|
27577
|
-
return new _TextLiteral(this.value, this.sourceLocation);
|
|
27469
|
+
return new _TextLiteral(this.value, this.sourceLocation).withOptions(this.options.clone());
|
|
27578
27470
|
}
|
|
27579
27471
|
};
|
|
27580
27472
|
var LocalizableTextLiteral2 = class _LocalizableTextLiteral {
|
|
27581
|
-
constructor(value,
|
|
27473
|
+
constructor(value, key, sourceLocation) {
|
|
27582
27474
|
this.value = value;
|
|
27583
|
-
this.
|
|
27475
|
+
this.key = key;
|
|
27584
27476
|
this.sourceLocation = sourceLocation;
|
|
27585
27477
|
this.kind = 47 /* LocalizableTextLiteral */;
|
|
27478
|
+
this.options = new TextTemplateEmitOptions(false);
|
|
27479
|
+
}
|
|
27480
|
+
withOptions(options) {
|
|
27481
|
+
this.options = options;
|
|
27482
|
+
return this;
|
|
27586
27483
|
}
|
|
27587
27484
|
clone() {
|
|
27588
|
-
return new _LocalizableTextLiteral(this.value, this.
|
|
27485
|
+
return new _LocalizableTextLiteral(this.value, this.key, this.sourceLocation);
|
|
27589
27486
|
}
|
|
27590
27487
|
};
|
|
27591
27488
|
var TextWithEntityName = class _TextWithEntityName {
|
|
@@ -27604,7 +27501,7 @@ var TextTemplateLiteral2 = class _TextTemplateLiteral {
|
|
|
27604
27501
|
this.expressions = expressions;
|
|
27605
27502
|
this.sourceLocation = sourceLocation;
|
|
27606
27503
|
this.kind = 48 /* TextTemplateLiteral */;
|
|
27607
|
-
this.options = TextTemplateEmitOptions
|
|
27504
|
+
this.options = new TextTemplateEmitOptions(true);
|
|
27608
27505
|
}
|
|
27609
27506
|
withOptions(options) {
|
|
27610
27507
|
this.options = options;
|
|
@@ -27619,13 +27516,13 @@ var TextTemplateLiteral2 = class _TextTemplateLiteral {
|
|
|
27619
27516
|
}
|
|
27620
27517
|
};
|
|
27621
27518
|
var LocalizableTextTemplateLiteral2 = class _LocalizableTextTemplateLiteral {
|
|
27622
|
-
constructor(textFragments, expressions,
|
|
27519
|
+
constructor(textFragments, expressions, key, sourceLocation) {
|
|
27623
27520
|
this.textFragments = textFragments;
|
|
27624
27521
|
this.expressions = expressions;
|
|
27625
|
-
this.
|
|
27522
|
+
this.key = key;
|
|
27626
27523
|
this.sourceLocation = sourceLocation;
|
|
27627
27524
|
this.kind = 49 /* LocalizableTextTemplateLiteral */;
|
|
27628
|
-
this.options = TextTemplateEmitOptions
|
|
27525
|
+
this.options = new TextTemplateEmitOptions(true);
|
|
27629
27526
|
}
|
|
27630
27527
|
withOptions(options) {
|
|
27631
27528
|
this.options = options;
|
|
@@ -27635,7 +27532,7 @@ var LocalizableTextTemplateLiteral2 = class _LocalizableTextTemplateLiteral {
|
|
|
27635
27532
|
return new _LocalizableTextTemplateLiteral(
|
|
27636
27533
|
this.textFragments,
|
|
27637
27534
|
this.expressions.map((e) => e.clone()),
|
|
27638
|
-
this.
|
|
27535
|
+
this.key,
|
|
27639
27536
|
this.sourceLocation
|
|
27640
27537
|
).withOptions(this.options.clone());
|
|
27641
27538
|
}
|
|
@@ -28396,6 +28293,11 @@ var StandardTypes = class {
|
|
|
28396
28293
|
get textTemplate() {
|
|
28397
28294
|
return this.textTemplate_ ??= this.entityMap.getType(this.analyzer.originalStandardTypes.textTemplate);
|
|
28398
28295
|
}
|
|
28296
|
+
get localizableTextTemplate() {
|
|
28297
|
+
return this.localizableTextTemplate_ ??= this.entityMap.getType(
|
|
28298
|
+
this.analyzer.originalStandardTypes.localizableTextTemplate
|
|
28299
|
+
);
|
|
28300
|
+
}
|
|
28399
28301
|
get reference() {
|
|
28400
28302
|
return this.reference_ ??= this.entityMap.getType(this.analyzer.originalStandardTypes.reference);
|
|
28401
28303
|
}
|
|
@@ -28486,7 +28388,7 @@ var EntityFinder = class _EntityFinder {
|
|
|
28486
28388
|
if (key.parameterNames !== void 0) {
|
|
28487
28389
|
methodEntities = methodEntities.filter((m) => {
|
|
28488
28390
|
const parameters = m.getParameters();
|
|
28489
|
-
return parameters.length === key.parameterNames?.length && Query.zip(parameters, key.parameterNames, (p, n) => p.getName().considerEqual(new Name(n)
|
|
28391
|
+
return parameters.length === key.parameterNames?.length && Query.zip(parameters, key.parameterNames, (p, n) => p.getName().considerEqual(new Name(n))).all((v) => v);
|
|
28490
28392
|
});
|
|
28491
28393
|
}
|
|
28492
28394
|
if (methodEntities.length === 0) {
|
|
@@ -28506,7 +28408,7 @@ var EntityFinder = class _EntityFinder {
|
|
|
28506
28408
|
if (key.parameterNames !== void 0) {
|
|
28507
28409
|
constructorEntities = constructorEntities.filter((m) => {
|
|
28508
28410
|
const parameters = m.getParameters();
|
|
28509
|
-
return parameters.length === key.parameterNames?.length && Query.zip(parameters, key.parameterNames, (p, n) => p.getName().considerEqual(new Name(n)
|
|
28411
|
+
return parameters.length === key.parameterNames?.length && Query.zip(parameters, key.parameterNames, (p, n) => p.getName().considerEqual(new Name(n))).all((v) => v);
|
|
28510
28412
|
});
|
|
28511
28413
|
}
|
|
28512
28414
|
if (constructorEntities.length === 0) {
|
|
@@ -29353,15 +29255,7 @@ var EntityMap = class _EntityMap {
|
|
|
29353
29255
|
}
|
|
29354
29256
|
}
|
|
29355
29257
|
if (result === void 0) {
|
|
29356
|
-
|
|
29357
|
-
if (key.length >= 2 && key.charAt(0) === "'" && key.charAt(key.length - 1) === "'") {
|
|
29358
|
-
result = key.substring(1, key.length - 1);
|
|
29359
|
-
} else {
|
|
29360
|
-
result = key;
|
|
29361
|
-
}
|
|
29362
|
-
if ((name.flags & 16 /* BackingVariableName */) !== 0) {
|
|
29363
|
-
result += "_";
|
|
29364
|
-
}
|
|
29258
|
+
result = name.key;
|
|
29365
29259
|
}
|
|
29366
29260
|
return result;
|
|
29367
29261
|
}
|
|
@@ -29964,8 +29858,8 @@ function ternaryExpression(condition, firstExpression, secondExpression, sourceL
|
|
|
29964
29858
|
function textLiteral(value, sourceLocation) {
|
|
29965
29859
|
return new TextLiteral2(value, sourceLocation);
|
|
29966
29860
|
}
|
|
29967
|
-
function localizableTextLiteral(value,
|
|
29968
|
-
return new LocalizableTextLiteral2(value,
|
|
29861
|
+
function localizableTextLiteral(value, key, sourceLocation) {
|
|
29862
|
+
return new LocalizableTextLiteral2(value, key, sourceLocation);
|
|
29969
29863
|
}
|
|
29970
29864
|
function textWithEntityName(entity, sourceLocation) {
|
|
29971
29865
|
return new TextWithEntityName(entity, sourceLocation);
|
|
@@ -29973,8 +29867,8 @@ function textWithEntityName(entity, sourceLocation) {
|
|
|
29973
29867
|
function textTemplateLiteral(textFragments, expressions, sourceLocation) {
|
|
29974
29868
|
return new TextTemplateLiteral2(textFragments, expressions, sourceLocation);
|
|
29975
29869
|
}
|
|
29976
|
-
function localizableTextTemplateLiteral(textFragments, expressions,
|
|
29977
|
-
return new LocalizableTextTemplateLiteral2(textFragments, expressions,
|
|
29870
|
+
function localizableTextTemplateLiteral(textFragments, expressions, key, sourceLocation) {
|
|
29871
|
+
return new LocalizableTextTemplateLiteral2(textFragments, expressions, key, sourceLocation);
|
|
29978
29872
|
}
|
|
29979
29873
|
function thisExpression(type, sourceLocation) {
|
|
29980
29874
|
return new ThisExpression(type, sourceLocation);
|
|
@@ -33085,23 +32979,31 @@ var AspectsLowering = class {
|
|
|
33085
32979
|
return fieldSetterDeclaration(setterEntity, body, parameterEntity2);
|
|
33086
32980
|
}
|
|
33087
32981
|
getNotAbstractAspectMembersToAddToDerivedType(entity) {
|
|
33088
|
-
const overriddenMembers = Query.from(entity.members).map((m) => this.getAllOverriddenAspectMembers(m)).filter((m) => m !== void 0).flatMap((m) => m).uniqueToSet();
|
|
33089
|
-
const result =
|
|
33090
|
-
for (const
|
|
33091
|
-
if (!
|
|
32982
|
+
const overriddenMembers = Query.from(entity.members).map((m) => this.getAllOverriddenAspectMembers(m)).chain(Query.from(this.uniqueBaseTypesRecursively(entity)).flatMap((e) => e.members.map((m) => this.getAllOverriddenAspectMembers(m)))).filter((m) => m !== void 0).flatMap((m) => m).uniqueToSet();
|
|
32983
|
+
const result = new Array();
|
|
32984
|
+
for (const baseType of this.uniqueBaseTypesRecursively(entity)) {
|
|
32985
|
+
if (!this.ctx.ectx.isAspectTypeEntity(baseType) || !baseType.containingPackage.details.isSource) {
|
|
33092
32986
|
continue;
|
|
33093
32987
|
}
|
|
33094
|
-
for (const member of
|
|
32988
|
+
for (const member of baseType.members) {
|
|
33095
32989
|
if (!overriddenMembers.has(member) && !member.details.isAbstract && !member.details.isStatic) {
|
|
33096
|
-
result.
|
|
32990
|
+
result.push(member);
|
|
33097
32991
|
}
|
|
33098
32992
|
}
|
|
33099
32993
|
}
|
|
33100
|
-
return
|
|
33101
|
-
|
|
33102
|
-
|
|
33103
|
-
|
|
33104
|
-
|
|
32994
|
+
return result;
|
|
32995
|
+
}
|
|
32996
|
+
*uniqueBaseTypesRecursively(entity, enumerated = /* @__PURE__ */ new Set()) {
|
|
32997
|
+
if (entity.baseObjectType !== void 0 && !enumerated.has(entity.baseObjectType)) {
|
|
32998
|
+
yield entity.baseObjectType;
|
|
32999
|
+
enumerated.add(entity.baseObjectType);
|
|
33000
|
+
yield* __yieldStar(this.uniqueBaseTypesRecursively(entity.baseObjectType));
|
|
33001
|
+
}
|
|
33002
|
+
for (const baseAspectType of entity.baseAspectTypes) {
|
|
33003
|
+
if (!enumerated.has(baseAspectType)) {
|
|
33004
|
+
yield baseAspectType;
|
|
33005
|
+
enumerated.add(baseAspectType);
|
|
33006
|
+
yield* __yieldStar(this.uniqueBaseTypesRecursively(baseAspectType));
|
|
33105
33007
|
}
|
|
33106
33008
|
}
|
|
33107
33009
|
}
|
|
@@ -34467,6 +34369,12 @@ var UsagesLowering = class _UsagesLowering extends ExecutableCodeLowering {
|
|
|
34467
34369
|
}
|
|
34468
34370
|
return preserveStatement();
|
|
34469
34371
|
},
|
|
34372
|
+
transformTextLiteral: (node) => {
|
|
34373
|
+
if (node.options.createTextTemplateInstance) {
|
|
34374
|
+
return replaceExpression(this.createTextTemplateConstructorCall([node.value], [], node.sourceLocation));
|
|
34375
|
+
}
|
|
34376
|
+
return preserveExpression();
|
|
34377
|
+
},
|
|
34470
34378
|
transformTextTemplateLiteral: (node) => {
|
|
34471
34379
|
if (node.options.createTextTemplateInstance) {
|
|
34472
34380
|
return replaceExpression(this.lowerTextTemplateLiteral(node));
|
|
@@ -34474,10 +34382,40 @@ var UsagesLowering = class _UsagesLowering extends ExecutableCodeLowering {
|
|
|
34474
34382
|
return preserveExpression();
|
|
34475
34383
|
},
|
|
34476
34384
|
transformLocalizableTextLiteral: (node) => {
|
|
34477
|
-
|
|
34385
|
+
let expression = this.createLocalizableTextTemplateConstructorCall(
|
|
34386
|
+
[node.value],
|
|
34387
|
+
[],
|
|
34388
|
+
node.key,
|
|
34389
|
+
node.sourceLocation
|
|
34390
|
+
);
|
|
34391
|
+
if (!node.options.createTextTemplateInstance) {
|
|
34392
|
+
expression = instanceMethodCallExpression(
|
|
34393
|
+
expression,
|
|
34394
|
+
this.ctx.localizableTextTemplateTranslateMethod,
|
|
34395
|
+
[],
|
|
34396
|
+
false,
|
|
34397
|
+
node.sourceLocation
|
|
34398
|
+
);
|
|
34399
|
+
}
|
|
34400
|
+
return replaceExpression(expression);
|
|
34478
34401
|
},
|
|
34479
34402
|
transformLocalizableTextTemplateLiteral: (node) => {
|
|
34480
|
-
|
|
34403
|
+
let expression = this.createLocalizableTextTemplateConstructorCall(
|
|
34404
|
+
node.textFragments,
|
|
34405
|
+
node.expressions,
|
|
34406
|
+
node.key,
|
|
34407
|
+
node.sourceLocation
|
|
34408
|
+
);
|
|
34409
|
+
if (!node.options.createTextTemplateInstance) {
|
|
34410
|
+
expression = instanceMethodCallExpression(
|
|
34411
|
+
expression,
|
|
34412
|
+
this.ctx.localizableTextTemplateTranslateMethod,
|
|
34413
|
+
[],
|
|
34414
|
+
false,
|
|
34415
|
+
node.sourceLocation
|
|
34416
|
+
);
|
|
34417
|
+
}
|
|
34418
|
+
return replaceExpression(expression);
|
|
34481
34419
|
},
|
|
34482
34420
|
transformMethodDeclaration: (node) => {
|
|
34483
34421
|
const nameKeySymbolDeclaration = this.ifTypeMemberHasComputedNameThenSymbolDeclaration(node.entity, true);
|
|
@@ -34730,16 +34668,16 @@ var UsagesLowering = class _UsagesLowering extends ExecutableCodeLowering {
|
|
|
34730
34668
|
const result = this.createLocalizableTextTemplateConstructorAndTranslateCall(
|
|
34731
34669
|
[node.value],
|
|
34732
34670
|
[],
|
|
34733
|
-
node.
|
|
34671
|
+
node.key,
|
|
34734
34672
|
node.sourceLocation
|
|
34735
34673
|
);
|
|
34736
34674
|
return result;
|
|
34737
34675
|
}
|
|
34738
34676
|
lowerLocalizableTextTemplateLiteral(node) {
|
|
34739
|
-
const result = this.
|
|
34677
|
+
const result = this.createLocalizableTextTemplateConstructorCall(
|
|
34740
34678
|
node.textFragments,
|
|
34741
34679
|
node.expressions,
|
|
34742
|
-
node.
|
|
34680
|
+
node.key,
|
|
34743
34681
|
node.sourceLocation
|
|
34744
34682
|
);
|
|
34745
34683
|
return result;
|
|
@@ -34755,20 +34693,25 @@ var UsagesLowering = class _UsagesLowering extends ExecutableCodeLowering {
|
|
|
34755
34693
|
);
|
|
34756
34694
|
return constructorCall;
|
|
34757
34695
|
}
|
|
34758
|
-
|
|
34696
|
+
createLocalizableTextTemplateConstructorCall(textFragments, expressions, key, sourceLocation) {
|
|
34759
34697
|
const textFragmentsArray = arrayLiteral(this.ctx.ectx, textFragments.map((s) => textLiteral(s)));
|
|
34760
34698
|
const expressionArray = arrayLiteral(this.ctx.ectx, expressions);
|
|
34761
|
-
|
|
34762
|
-
if (code !== void 0) {
|
|
34763
|
-
codeArg = numericLiteral(code);
|
|
34764
|
-
} else {
|
|
34765
|
-
codeArg = textLiteral(textFragments.join("_"));
|
|
34766
|
-
}
|
|
34699
|
+
const keyArg = key !== void 0 ? textLiteral(key) : nullLiteral();
|
|
34767
34700
|
const packageArg = staticFieldGetAccess(this.ctx.packageThisPackageField);
|
|
34768
34701
|
const constructorCall = constructorCallExpression(
|
|
34769
34702
|
this.ctx.ectx,
|
|
34770
34703
|
this.ctx.localizableTextTemplateConstructor,
|
|
34771
|
-
[textFragmentsArray, expressionArray,
|
|
34704
|
+
[textFragmentsArray, expressionArray, keyArg, packageArg],
|
|
34705
|
+
sourceLocation
|
|
34706
|
+
);
|
|
34707
|
+
return constructorCall;
|
|
34708
|
+
}
|
|
34709
|
+
createLocalizableTextTemplateConstructorAndTranslateCall(textFragments, expressions, key, sourceLocation) {
|
|
34710
|
+
const constructorCall = this.createLocalizableTextTemplateConstructorCall(
|
|
34711
|
+
textFragments,
|
|
34712
|
+
expressions,
|
|
34713
|
+
key,
|
|
34714
|
+
sourceLocation
|
|
34772
34715
|
);
|
|
34773
34716
|
const toTextMethodCall = instanceMethodCallExpression(
|
|
34774
34717
|
constructorCall,
|
|
@@ -35618,7 +35561,7 @@ var TextTranslationsLowering = class {
|
|
|
35618
35561
|
);
|
|
35619
35562
|
const statements = [dictionaryVariableDeclarationStatement];
|
|
35620
35563
|
for (const translation of pkg2.ir.translations) {
|
|
35621
|
-
const key =
|
|
35564
|
+
const key = textLiteral(translation.key);
|
|
35622
35565
|
let textOrTranslationFunction;
|
|
35623
35566
|
if (translation.translatedTextOrFunctionBlock.kind === 4 /* BlockStatement */) {
|
|
35624
35567
|
textOrTranslationFunction = this.createTranslationFunctionLiteral(
|
|
@@ -36827,7 +36770,7 @@ var IrBuilderA = class {
|
|
|
36827
36770
|
result = this.buildTokenExpression(expression);
|
|
36828
36771
|
break;
|
|
36829
36772
|
case 81 /* TextLiteral */:
|
|
36830
|
-
if ((expression.text.flags &
|
|
36773
|
+
if ((expression.text.flags & 64 /* SingleCharText */) !== 0) {
|
|
36831
36774
|
result = this.buildCharLiteral(expression);
|
|
36832
36775
|
} else {
|
|
36833
36776
|
result = this.buildTextLiteral(expression);
|
|
@@ -36865,7 +36808,25 @@ var IrBuilderA = class {
|
|
|
36865
36808
|
}
|
|
36866
36809
|
applyImplicitConversionIfRequired(expression, expressionIr) {
|
|
36867
36810
|
if (this.expressionCanBeImplicitlyConverted(expression)) {
|
|
36868
|
-
if (expression.kind ===
|
|
36811
|
+
if (expression.kind === 81 /* TextLiteral */ && expressionIr.kind === 46 /* TextLiteral */) {
|
|
36812
|
+
let targetType2 = this.analyzer.getTargetTypeOfExpression(expression);
|
|
36813
|
+
if (targetType2 !== void 0) {
|
|
36814
|
+
targetType2 = this.analyzer.excludeNullFromType(targetType2.unalias());
|
|
36815
|
+
}
|
|
36816
|
+
if (targetType2 !== void 0 && targetType2.equals(this.analyzer.originalStandardTypes.textTemplate)) {
|
|
36817
|
+
expressionIr.options = expressionIr.options.setCreateTextTemplateInstance(true);
|
|
36818
|
+
return expressionIr;
|
|
36819
|
+
}
|
|
36820
|
+
} else if (expression.kind === 82 /* LocalizableTextLiteral */ && expressionIr.kind === 47 /* LocalizableTextLiteral */) {
|
|
36821
|
+
let targetType2 = this.analyzer.getTargetTypeOfExpression(expression);
|
|
36822
|
+
if (targetType2 !== void 0) {
|
|
36823
|
+
targetType2 = this.analyzer.excludeNullFromType(targetType2.unalias());
|
|
36824
|
+
}
|
|
36825
|
+
if (targetType2 !== void 0 && targetType2.equals(this.analyzer.originalStandardTypes.localizableTextTemplate)) {
|
|
36826
|
+
expressionIr.options = expressionIr.options.setCreateTextTemplateInstance(true);
|
|
36827
|
+
return expressionIr;
|
|
36828
|
+
}
|
|
36829
|
+
} else if ((expression.kind === 76 /* TextTemplateLiteral */ || expression.kind === 77 /* LocalizableTextTemplateLiteral */) && this.analyzer.type.ofExpression(expression).equals(this.analyzer.originalStandardTypes.text)) {
|
|
36869
36830
|
return this.convertTextTemplateToText(expressionIr);
|
|
36870
36831
|
}
|
|
36871
36832
|
let targetType = this.analyzer.getTargetTypeOfExpression(expression);
|
|
@@ -36874,7 +36835,7 @@ var IrBuilderA = class {
|
|
|
36874
36835
|
}
|
|
36875
36836
|
if (targetType !== void 0) {
|
|
36876
36837
|
const expressionType = this.analyzer.type.ofExpression(expression);
|
|
36877
|
-
if (expressionType.equals(this.analyzer.originalStandardTypes.textTemplate)) {
|
|
36838
|
+
if (expressionType.equals(this.analyzer.originalStandardTypes.textTemplate) || expressionType.equals(this.analyzer.originalStandardTypes.localizableTextTemplate)) {
|
|
36878
36839
|
const isConvertedToText = targetType.equals(this.analyzer.originalStandardTypes.text) || targetType.kind === "union" && targetType.unaliasedFlattenedTypes.some((t) => t.equals(this.analyzer.originalStandardTypes.text));
|
|
36879
36840
|
if (isConvertedToText) {
|
|
36880
36841
|
return this.convertTextTemplateToText(expressionIr);
|
|
@@ -37474,12 +37435,9 @@ var IrBuilderA = class {
|
|
|
37474
37435
|
);
|
|
37475
37436
|
}
|
|
37476
37437
|
buildLocalizableTextLiteral(expression) {
|
|
37477
|
-
const
|
|
37478
|
-
|
|
37479
|
-
|
|
37480
|
-
code,
|
|
37481
|
-
this.getSourceLocation(expression)
|
|
37482
|
-
);
|
|
37438
|
+
const value = unescapeText(withoutQuotes(expression.text.value));
|
|
37439
|
+
const key = expression.key !== void 0 ? unescapeText(withoutQuotes(expression.key.value)) : void 0;
|
|
37440
|
+
return localizableTextLiteral(value, key, this.getSourceLocation(expression));
|
|
37483
37441
|
}
|
|
37484
37442
|
buildTextTemplateLiteral(expression) {
|
|
37485
37443
|
const textFragments = [unescapeText(withoutTemplateQuotes(expression.head.value))];
|
|
@@ -37497,8 +37455,8 @@ var IrBuilderA = class {
|
|
|
37497
37455
|
textFragments.push(unescapeText(withoutTemplateQuotes(span.text.value)));
|
|
37498
37456
|
expressions.push(this.buildExpression(span.expression));
|
|
37499
37457
|
}
|
|
37500
|
-
const
|
|
37501
|
-
return localizableTextTemplateLiteral(textFragments, expressions,
|
|
37458
|
+
const key = expression.key !== void 0 ? unescapeText(withoutQuotes(expression.key.value)) : void 0;
|
|
37459
|
+
return localizableTextTemplateLiteral(textFragments, expressions, key, this.getSourceLocation(expression));
|
|
37502
37460
|
}
|
|
37503
37461
|
buildTokenExpression(expression) {
|
|
37504
37462
|
switch (expression.token.tokenKind) {
|
|
@@ -41131,6 +41089,13 @@ var StandardTypes2 = class {
|
|
|
41131
41089
|
}
|
|
41132
41090
|
return this.textTemplate_;
|
|
41133
41091
|
}
|
|
41092
|
+
get localizableTextTemplate() {
|
|
41093
|
+
if (this.localizableTextTemplate_ === void 0) {
|
|
41094
|
+
const entity = this.wellKnownDeclarations.localizableTextTemplate;
|
|
41095
|
+
this.localizableTextTemplate_ = this.analyzer.typeFactory.getStructuredType(entity, Substitutions.empty());
|
|
41096
|
+
}
|
|
41097
|
+
return this.localizableTextTemplate_;
|
|
41098
|
+
}
|
|
41134
41099
|
get char() {
|
|
41135
41100
|
if (this.char_ === void 0) {
|
|
41136
41101
|
const entity = this.wellKnownDeclarations.char;
|
|
@@ -41481,8 +41446,8 @@ var TypeFactory = class {
|
|
|
41481
41446
|
getStructuredType(entity, substitutions) {
|
|
41482
41447
|
return new StructuredType(this.analyzer, entity, substitutions);
|
|
41483
41448
|
}
|
|
41484
|
-
getParameterType(entity,
|
|
41485
|
-
return new ParameterType(this.analyzer, entity,
|
|
41449
|
+
getParameterType(entity, excludeNull) {
|
|
41450
|
+
return new ParameterType(this.analyzer, entity, excludeNull);
|
|
41486
41451
|
}
|
|
41487
41452
|
getVariantType(entity, substitutions) {
|
|
41488
41453
|
return new VariantType(this.analyzer, entity, substitutions);
|
|
@@ -43708,7 +43673,7 @@ var TranslatedEntityNameConflictsValidator = class {
|
|
|
43708
43673
|
const translatedMembers = originalMembers.map((m) => translatedMemberByOriginal.get(m)).filter((m) => m !== void 0);
|
|
43709
43674
|
const firstSourceTranslatedMember = translatedMembers.find((m) => m.getTranslation()?.definition.kind === "source");
|
|
43710
43675
|
if (firstSourceTranslatedMember !== void 0) {
|
|
43711
|
-
const translatedMemberWithDifferentName = translatedMembers.find((m) => !m.getName().considerEqual(firstSourceTranslatedMember.getName()
|
|
43676
|
+
const translatedMemberWithDifferentName = translatedMembers.find((m) => !m.getName().considerEqual(firstSourceTranslatedMember.getName()));
|
|
43712
43677
|
if (translatedMemberWithDifferentName !== void 0) {
|
|
43713
43678
|
const nodeForDiagnostic = this.getTranslatedNameNode(
|
|
43714
43679
|
this.getTranslationDefinitionNode(firstSourceTranslatedMember.getTranslation())
|
|
@@ -43737,7 +43702,7 @@ var TranslatedEntityNameConflictsValidator = class {
|
|
|
43737
43702
|
if (firstSourceTranslatedMember !== void 0) {
|
|
43738
43703
|
const originalMembers = translatedMembers.map((m) => m.getOriginalEntity());
|
|
43739
43704
|
const originalName = firstSourceTranslatedMember.getOriginalEntity().getName();
|
|
43740
|
-
const originalMemberWithDifferentName = originalMembers.find((m) => !m.getName().considerEqual(originalName
|
|
43705
|
+
const originalMemberWithDifferentName = originalMembers.find((m) => !m.getName().considerEqual(originalName));
|
|
43741
43706
|
if (originalMemberWithDifferentName !== void 0) {
|
|
43742
43707
|
const nodeForDiagnostic = this.getTranslatedNameNode(
|
|
43743
43708
|
this.getTranslationDefinitionNode(firstSourceTranslatedMember.getTranslation())
|
|
@@ -43787,7 +43752,7 @@ var TranslatedEntityNameConflictsValidator = class {
|
|
|
43787
43752
|
if (typeParameters.length > 0) {
|
|
43788
43753
|
const nameKeys = /* @__PURE__ */ new Set();
|
|
43789
43754
|
for (const typeParameter of typeParameters) {
|
|
43790
|
-
const key = typeParameter.getName().
|
|
43755
|
+
const key = typeParameter.getName().key;
|
|
43791
43756
|
if (nameKeys.has(key)) {
|
|
43792
43757
|
const translationDefinition = typeParameter.getTranslation()?.definition;
|
|
43793
43758
|
if (translationDefinition?.kind === "source" && translationDefinition.translatedNameIdentifier !== void 0) {
|
|
@@ -43808,7 +43773,7 @@ var TranslatedEntityNameConflictsValidator = class {
|
|
|
43808
43773
|
if (parameters.length > 0) {
|
|
43809
43774
|
const nameKeys = /* @__PURE__ */ new Set();
|
|
43810
43775
|
for (const parameter of parameters) {
|
|
43811
|
-
const key = parameter.getName().
|
|
43776
|
+
const key = parameter.getName().key;
|
|
43812
43777
|
if (nameKeys.has(key)) {
|
|
43813
43778
|
const translationDefinition = parameter.getTranslation()?.definition;
|
|
43814
43779
|
if (translationDefinition?.kind === "source" && translationDefinition.translatedNameIdentifier !== void 0) {
|
|
@@ -44947,7 +44912,7 @@ var ResolvedTranslationPackage = class _ResolvedTranslationPackage {
|
|
|
44947
44912
|
return Query.zip(
|
|
44948
44913
|
typeParameterEntities,
|
|
44949
44914
|
translationTypeParameters,
|
|
44950
|
-
(e, n) => e.getName().considerEqual(this.analyzer.createNameFromIdentifier(n)
|
|
44915
|
+
(e, n) => e.getName().considerEqual(this.analyzer.createNameFromIdentifier(n))
|
|
44951
44916
|
).all((v) => v);
|
|
44952
44917
|
}
|
|
44953
44918
|
areParameterEntitiesEqualToTranslationParameters(parameterEntities, translationParameterList) {
|
|
@@ -44958,7 +44923,7 @@ var ResolvedTranslationPackage = class _ResolvedTranslationPackage {
|
|
|
44958
44923
|
return Query.zip(
|
|
44959
44924
|
parameterEntities,
|
|
44960
44925
|
translationParameters,
|
|
44961
|
-
(e, n) => e.getName().considerEqual(this.analyzer.createNameFromIdentifier(n)
|
|
44926
|
+
(e, n) => e.getName().considerEqual(this.analyzer.createNameFromIdentifier(n))
|
|
44962
44927
|
).all((v) => v);
|
|
44963
44928
|
}
|
|
44964
44929
|
createNotTranslatedEntitiesDiagnostic(entities, totalCount, node, argumentFactory) {
|
|
@@ -47261,11 +47226,7 @@ var TsParameterEntity = class {
|
|
|
47261
47226
|
this.subkind = "parameter";
|
|
47262
47227
|
this.type = new Cached();
|
|
47263
47228
|
if (isObjectParameter_) {
|
|
47264
|
-
|
|
47265
|
-
7 /* Object */,
|
|
47266
|
-
0 /* En */
|
|
47267
|
-
);
|
|
47268
|
-
this.name = new Name(objectKeywordText, 0 /* None */, specialNameKeys.objectParameter);
|
|
47229
|
+
this.name = new Name(specialNameKeys.objectParameter, 8 /* SpecialName */);
|
|
47269
47230
|
} else {
|
|
47270
47231
|
this.name = this.tsctx.createName(this.symbol.name, "variable");
|
|
47271
47232
|
}
|
|
@@ -52557,25 +52518,19 @@ var SourceAnonymousStructuredTypeDeclarationData = class extends SourceStructure
|
|
|
52557
52518
|
|
|
52558
52519
|
// source/analysis/a/TextIdentity.ts
|
|
52559
52520
|
var TextIdentity = class {
|
|
52560
|
-
static keyFromTextFragments(fragments) {
|
|
52561
|
-
return fragments.join("_");
|
|
52562
|
-
}
|
|
52563
|
-
static keyFromTextToken(token) {
|
|
52564
|
-
return unescapeText(withoutQuotes(token.value));
|
|
52565
|
-
}
|
|
52566
52521
|
static keyFromLocalizableTextLiteral(node) {
|
|
52567
52522
|
let result;
|
|
52568
|
-
if (node.
|
|
52569
|
-
result =
|
|
52523
|
+
if (node.key !== void 0) {
|
|
52524
|
+
result = unescapeText(withoutQuotes(node.key.value));
|
|
52570
52525
|
} else {
|
|
52571
|
-
result =
|
|
52526
|
+
result = unescapeText(withoutQuotes(node.text.value));
|
|
52572
52527
|
}
|
|
52573
52528
|
return result;
|
|
52574
52529
|
}
|
|
52575
52530
|
static keyFromLocalizableTextTemplateLiteral(node) {
|
|
52576
52531
|
let result;
|
|
52577
|
-
if (node.
|
|
52578
|
-
result =
|
|
52532
|
+
if (node.key !== void 0) {
|
|
52533
|
+
result = unescapeText(withoutQuotes(node.key.value));
|
|
52579
52534
|
} else {
|
|
52580
52535
|
const fragments = [unescapeText(withoutTemplateQuotes(node.head.value))];
|
|
52581
52536
|
node.spanList.spans.forEach((x) => fragments.push(unescapeText(withoutTemplateQuotes(x.text.value))));
|
|
@@ -52585,12 +52540,12 @@ var TextIdentity = class {
|
|
|
52585
52540
|
}
|
|
52586
52541
|
static keyFromTextTranslationSource(node) {
|
|
52587
52542
|
let result;
|
|
52588
|
-
if (node.
|
|
52589
|
-
result =
|
|
52543
|
+
if (node.key !== void 0) {
|
|
52544
|
+
result = unescapeText(withoutQuotes(node.key.value));
|
|
52590
52545
|
} else {
|
|
52591
52546
|
switch (node.kind) {
|
|
52592
52547
|
case 140 /* TranslationTextLiteral */: {
|
|
52593
|
-
result =
|
|
52548
|
+
result = unescapeText(withoutQuotes(node.text.value));
|
|
52594
52549
|
break;
|
|
52595
52550
|
}
|
|
52596
52551
|
case 141 /* TranslationTextTemplate */: {
|
|
@@ -52619,7 +52574,7 @@ var TextTranslationDeclarationEntity = class {
|
|
|
52619
52574
|
case 140 /* TranslationTextLiteral */: {
|
|
52620
52575
|
this.text = unescapeText(withoutQuotes(node.text.value));
|
|
52621
52576
|
this.textFragments = [this.text];
|
|
52622
|
-
lastToken = node.
|
|
52577
|
+
lastToken = node.key ?? node.text;
|
|
52623
52578
|
break;
|
|
52624
52579
|
}
|
|
52625
52580
|
case 141 /* TranslationTextTemplate */: {
|
|
@@ -52627,8 +52582,8 @@ var TextTranslationDeclarationEntity = class {
|
|
|
52627
52582
|
node.spanList.spans.forEach((x) => fragments.push(unescapeText(withoutTemplateQuotes(x.text.value))));
|
|
52628
52583
|
this.textFragments = fragments;
|
|
52629
52584
|
this.text = this.textFragments.join("_");
|
|
52630
|
-
if (node.
|
|
52631
|
-
lastToken = node.
|
|
52585
|
+
if (node.key !== void 0) {
|
|
52586
|
+
lastToken = node.key;
|
|
52632
52587
|
} else {
|
|
52633
52588
|
const spans = node.spanList.spans;
|
|
52634
52589
|
if (spans.length > 0) {
|
|
@@ -54110,7 +54065,7 @@ var ParameterDeclarationEntity = class {
|
|
|
54110
54065
|
return 0 /* ArtelA */;
|
|
54111
54066
|
}
|
|
54112
54067
|
isObjectParameter() {
|
|
54113
|
-
let result = (this.node.name.flags &
|
|
54068
|
+
let result = (this.node.name.flags & 512 /* ObjectParameterName */) !== 0;
|
|
54114
54069
|
if (result) {
|
|
54115
54070
|
const firstParameter = this.node.parent.parameters.first();
|
|
54116
54071
|
result = this.node === firstParameter;
|
|
@@ -54221,7 +54176,7 @@ var IndexParameterDeclarationEntity = class {
|
|
|
54221
54176
|
return 0 /* ArtelA */;
|
|
54222
54177
|
}
|
|
54223
54178
|
isObjectParameter() {
|
|
54224
|
-
let result = (this.getterOrSetterParameterDeclaration.name.flags &
|
|
54179
|
+
let result = (this.getterOrSetterParameterDeclaration.name.flags & 512 /* ObjectParameterName */) !== 0;
|
|
54225
54180
|
if (result) {
|
|
54226
54181
|
const firstParameter = this.getterOrSetterParameterDeclaration.parent.parameters.first();
|
|
54227
54182
|
result = this.getterOrSetterParameterDeclaration === firstParameter;
|
|
@@ -54326,7 +54281,7 @@ var FunctionLiteralParameterDeclarationEntity = class {
|
|
|
54326
54281
|
return this;
|
|
54327
54282
|
}
|
|
54328
54283
|
isObjectParameter() {
|
|
54329
|
-
return this.parameterIndex === 0 && (this.node.name.flags &
|
|
54284
|
+
return this.parameterIndex === 0 && (this.node.name.flags & 512 /* ObjectParameterName */) !== 0;
|
|
54330
54285
|
}
|
|
54331
54286
|
getContainingFunctionLiteralEntity() {
|
|
54332
54287
|
return this.analyzer.entity.ofFunctionLiteralInternal(this.functionLiteral);
|
|
@@ -55562,7 +55517,7 @@ var TsPackageMembersCreator = class {
|
|
|
55562
55517
|
if (sourcePackageToMergeWith !== void 0) {
|
|
55563
55518
|
switch (sourcePackageToMergeWith.dialect) {
|
|
55564
55519
|
case 0 /* ArtelA */:
|
|
55565
|
-
this.namedDeclarationsByName = Query.from(sourcePackageToMergeWith.sourceFiles).flatMap((d) => d.getSyntaxNode().declarationList.flatten()).filter(isNamedPackageMemberDeclaration).groupByToMap((d) => tsctx.analyzer.dialectA.createNameFromIdentifier(d.name).
|
|
55520
|
+
this.namedDeclarationsByName = Query.from(sourcePackageToMergeWith.sourceFiles).flatMap((d) => d.getSyntaxNode().declarationList.flatten()).filter(isNamedPackageMemberDeclaration).groupByToMap((d) => tsctx.analyzer.dialectA.createNameFromIdentifier(d.name).key);
|
|
55566
55521
|
break;
|
|
55567
55522
|
case 1 /* ArtelM */:
|
|
55568
55523
|
break;
|
|
@@ -56155,7 +56110,7 @@ var TsInteropContext = class {
|
|
|
56155
56110
|
createName(original, ownerKind) {
|
|
56156
56111
|
let flags = 2 /* QuotedName */;
|
|
56157
56112
|
if (ownerKind === "variable" || ownerKind === "method") {
|
|
56158
|
-
flags |=
|
|
56113
|
+
flags |= 16 /* PreferKebabCase */;
|
|
56159
56114
|
}
|
|
56160
56115
|
return new Name(original, flags);
|
|
56161
56116
|
}
|
|
@@ -57190,6 +57145,14 @@ var LocalizedWellKnownDeclarations = class {
|
|
|
57190
57145
|
}
|
|
57191
57146
|
return this.textTemplate_;
|
|
57192
57147
|
}
|
|
57148
|
+
get localizableTextTemplate() {
|
|
57149
|
+
if (this.localizableTextTemplate_ === void 0) {
|
|
57150
|
+
this.localizableTextTemplate_ = this.getLocalizedStructuredType(
|
|
57151
|
+
this.analyzer.originalWellKnownDeclarations.localizableTextTemplate
|
|
57152
|
+
);
|
|
57153
|
+
}
|
|
57154
|
+
return this.localizableTextTemplate_;
|
|
57155
|
+
}
|
|
57193
57156
|
get char() {
|
|
57194
57157
|
if (this.char_ === void 0) {
|
|
57195
57158
|
this.char_ = this.getLocalizedStructuredType(this.analyzer.originalWellKnownDeclarations.char);
|
|
@@ -60638,7 +60601,7 @@ var SourceFileAnalyzer = class {
|
|
|
60638
60601
|
checkObjectParameterIsTheFirstParameter(parameters) {
|
|
60639
60602
|
for (let i = 1; i < parameters.length; i++) {
|
|
60640
60603
|
const parameterDeclaration2 = parameters[i];
|
|
60641
|
-
if ((parameterDeclaration2.name.flags &
|
|
60604
|
+
if ((parameterDeclaration2.name.flags & 512 /* ObjectParameterName */) !== 0) {
|
|
60642
60605
|
this.createAndAddDiagnostic(2227 /* ObjectParameterMustBeTheFirstParameter */, parameterDeclaration2.name);
|
|
60643
60606
|
break;
|
|
60644
60607
|
}
|
|
@@ -63349,6 +63312,7 @@ var WellKnownDeclarationsLoader = class {
|
|
|
63349
63312
|
integer: this.findPackageType(systemPackage, new Name("\u0426\u0435\u043B\u043E\u0435"), 0, 1 /* Structured */),
|
|
63350
63313
|
text: this.findPackageType(systemPackage, new Name("\u0422\u0435\u043A\u0441\u0442"), 0, 1 /* Structured */),
|
|
63351
63314
|
textTemplate: this.findPackageType(systemPackage, new Name("\u0428\u0430\u0431\u043B\u043E\u043D\u0422\u0435\u043A\u0441\u0442\u0430"), 0, 1 /* Structured */),
|
|
63315
|
+
localizableTextTemplate: this.findPackageType(systemPackage, new Name("\u0428\u0430\u0431\u043B\u043E\u043D\u0422\u0435\u043A\u0441\u0442\u0430\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u0438\u043C\u044B\u0439"), 0, 1 /* Structured */),
|
|
63352
63316
|
char: this.findPackageType(systemPackage, new Name("\u0421\u0438\u043C\u0432\u043E\u043B"), 0, 1 /* Structured */),
|
|
63353
63317
|
yesNo: this.findPackageType(systemPackage, new Name("\u0414\u0430\u041D\u0435\u0442"), 0, 1 /* Structured */),
|
|
63354
63318
|
nullEntity: this.findPackageType(systemPackage, new Name("\u041F\u0443\u0441\u0442\u043E"), 0, 1 /* Structured */),
|
|
@@ -63427,7 +63391,7 @@ var SignatureComparer = class {
|
|
|
63427
63391
|
if (entity1.kind !== entity2.kind) {
|
|
63428
63392
|
return false;
|
|
63429
63393
|
}
|
|
63430
|
-
if ((options & 1 /* CompareNames */) !== 0 && entity1.kind === 1 /* Function */ && !entity1.getNaming().considerEqual(entity2.getNaming()
|
|
63394
|
+
if ((options & 1 /* CompareNames */) !== 0 && entity1.kind === 1 /* Function */ && !entity1.getNaming().considerEqual(entity2.getNaming())) {
|
|
63431
63395
|
return false;
|
|
63432
63396
|
}
|
|
63433
63397
|
const parameters1 = entity1.getParameters();
|
|
@@ -64161,6 +64125,9 @@ var TypeAssignabilityCheck = class {
|
|
|
64161
64125
|
if (source.equals(this.analyzer.originalStandardTypes.textTemplate) && target.equals(this.analyzer.originalStandardTypes.text)) {
|
|
64162
64126
|
return 16 /* ImplicitConversion */;
|
|
64163
64127
|
}
|
|
64128
|
+
if (source.equals(this.analyzer.originalStandardTypes.localizableTextTemplate) && target.equals(this.analyzer.originalStandardTypes.text)) {
|
|
64129
|
+
return 16 /* ImplicitConversion */;
|
|
64130
|
+
}
|
|
64164
64131
|
if (source.kind === "variant") {
|
|
64165
64132
|
let result = this.getAssignabilityFlags(source.getUnderlyingType(), target);
|
|
64166
64133
|
if (result !== 1 /* NotAssignable */) {
|
|
@@ -64287,8 +64254,8 @@ var TypeAssignabilityCheck = class {
|
|
|
64287
64254
|
/**
|
|
64288
64255
|
* @example
|
|
64289
64256
|
* ```artel
|
|
64290
|
-
* перем а =
|
|
64291
|
-
* перем б =
|
|
64257
|
+
* перем а = функция(п: Текст): Объект { }
|
|
64258
|
+
* перем б = функция(п: Объект): Текст { }
|
|
64292
64259
|
*
|
|
64293
64260
|
* а = б // Корректно
|
|
64294
64261
|
* б = а // Ошибка
|
|
@@ -65087,7 +65054,7 @@ var ArgumentToParameterMatcher = class {
|
|
|
65087
65054
|
hasErrors ||= true;
|
|
65088
65055
|
}
|
|
65089
65056
|
} else {
|
|
65090
|
-
const parameterIndex = parameters.findIndex((p) => p.getName()?.considerEqual(argumentName
|
|
65057
|
+
const parameterIndex = parameters.findIndex((p) => p.getName()?.considerEqual(argumentName) === true);
|
|
65091
65058
|
if (parameterIndex >= 0 && parameterIndex < parameters.length && parameterIndex === argumentIndex) {
|
|
65092
65059
|
const parameter = parameters[parameterIndex];
|
|
65093
65060
|
argumentToParameterMapping.set(argument2, parameter);
|
|
@@ -65104,7 +65071,7 @@ var ArgumentToParameterMatcher = class {
|
|
|
65104
65071
|
this.reportArgumentDiagnostic(argument2, 2020 /* PositionalArgumentsCannotFollowNamedArguments */);
|
|
65105
65072
|
hasErrors ||= true;
|
|
65106
65073
|
} else {
|
|
65107
|
-
const parameter = parameters.find((p) => p.getName()?.considerEqual(argumentName
|
|
65074
|
+
const parameter = parameters.find((p) => p.getName()?.considerEqual(argumentName) === true);
|
|
65108
65075
|
if (parameter !== void 0) {
|
|
65109
65076
|
if (matchedParameters.has(parameter)) {
|
|
65110
65077
|
this.reportArgumentDiagnostic(argument2, 2021 /* ArgumentForParameterAlreadyAssigned */);
|
|
@@ -72822,20 +72789,11 @@ var Analyzer3 = class extends Analyzer {
|
|
|
72822
72789
|
createNameFromIdentifier(node) {
|
|
72823
72790
|
let result = this.nameByIdentifierText.get(node.value);
|
|
72824
72791
|
if (result === void 0) {
|
|
72825
|
-
|
|
72826
|
-
|
|
72827
|
-
|
|
72828
|
-
|
|
72829
|
-
if ((node.flags & 64 /* ConflictResolvingParameterName */) !== 0) {
|
|
72830
|
-
nameFlags |= 8 /* ConflictResolvingParameterName */;
|
|
72831
|
-
} else if ((node.flags & 128 /* BackingVariableName */) !== 0) {
|
|
72832
|
-
nameFlags |= 16 /* BackingVariableName */;
|
|
72833
|
-
}
|
|
72834
|
-
let specialKey;
|
|
72835
|
-
if ((node.flags & 2048 /* ObjectParameterName */) !== 0) {
|
|
72836
|
-
specialKey = specialNameKeys.objectParameter;
|
|
72792
|
+
if ((node.flags & 512 /* ObjectParameterName */) !== 0) {
|
|
72793
|
+
result = Name.parse(specialNameKeys.objectParameter, 8 /* SpecialName */);
|
|
72794
|
+
} else {
|
|
72795
|
+
result = Name.parse(node.value, 0 /* None */);
|
|
72837
72796
|
}
|
|
72838
|
-
result = Name.parse(node.value, nameFlags, specialKey);
|
|
72839
72797
|
this.nameByIdentifierText.set(node.value, result);
|
|
72840
72798
|
}
|
|
72841
72799
|
return result;
|
|
@@ -73833,11 +73791,13 @@ var Type14 = class {
|
|
|
73833
73791
|
case 71 /* ConditionalExpression */:
|
|
73834
73792
|
return this.ofConditionalExpression(node, analysisOptions);
|
|
73835
73793
|
case 81 /* TextLiteral */:
|
|
73794
|
+
return this.ofTextLiteral(node, analysisOptions);
|
|
73836
73795
|
case 82 /* LocalizableTextLiteral */:
|
|
73837
|
-
return this.
|
|
73796
|
+
return this.ofLocalizableTextLiteral(node, analysisOptions);
|
|
73838
73797
|
case 76 /* TextTemplateLiteral */:
|
|
73839
|
-
case 77 /* LocalizableTextTemplateLiteral */:
|
|
73840
73798
|
return this.ofTextTemplateLiteral(node, analysisOptions);
|
|
73799
|
+
case 77 /* LocalizableTextTemplateLiteral */:
|
|
73800
|
+
return this.ofLocalizableTextTemplateLiteral(node, analysisOptions);
|
|
73841
73801
|
case 86 /* IdentifierExpression */:
|
|
73842
73802
|
return this.ofIdentifierExpression(node, analysisOptions);
|
|
73843
73803
|
case 80 /* TokenExpression */:
|
|
@@ -74176,13 +74136,50 @@ var Type14 = class {
|
|
|
74176
74136
|
}
|
|
74177
74137
|
return this.analyzer.typeFactory.getUnionType([firstExpressionType, secondExpressionType], true);
|
|
74178
74138
|
}
|
|
74179
|
-
ofTextLiteral(node) {
|
|
74139
|
+
ofTextLiteral(node, analysisOptions) {
|
|
74180
74140
|
const standardTypes = this.analyzer.getLocalizedStandardTypes(node.locale);
|
|
74181
|
-
|
|
74141
|
+
let targetType = this.analyzer.getTargetTypeOfExpression(node, analysisOptions);
|
|
74142
|
+
if (targetType !== void 0) {
|
|
74143
|
+
targetType = targetType.unalias();
|
|
74144
|
+
}
|
|
74145
|
+
let nodeIsTemplateNotText;
|
|
74146
|
+
if (targetType === void 0) {
|
|
74147
|
+
nodeIsTemplateNotText = false;
|
|
74148
|
+
} else if (targetType.equals(standardTypes.textTemplate)) {
|
|
74149
|
+
nodeIsTemplateNotText = true;
|
|
74150
|
+
} else if (targetType.kind === "union") {
|
|
74151
|
+
nodeIsTemplateNotText = targetType.unaliasedFlattenedTypes.some((t) => t.equals(standardTypes.textTemplate)) && !targetType.unaliasedFlattenedTypes.some((t) => t.equals(standardTypes.text));
|
|
74152
|
+
} else {
|
|
74153
|
+
nodeIsTemplateNotText = false;
|
|
74154
|
+
}
|
|
74155
|
+
if (nodeIsTemplateNotText) {
|
|
74156
|
+
return standardTypes.textTemplate;
|
|
74157
|
+
} else if (node.kind === 81 /* TextLiteral */ && (node.text.flags & 64 /* SingleCharText */) !== 0) {
|
|
74182
74158
|
return standardTypes.char;
|
|
74183
74159
|
}
|
|
74184
74160
|
return standardTypes.text;
|
|
74185
74161
|
}
|
|
74162
|
+
ofLocalizableTextLiteral(node, analysisOptions) {
|
|
74163
|
+
const standardTypes = this.analyzer.getLocalizedStandardTypes(node.locale);
|
|
74164
|
+
let targetType = this.analyzer.getTargetTypeOfExpression(node, analysisOptions);
|
|
74165
|
+
if (targetType !== void 0) {
|
|
74166
|
+
targetType = targetType.unalias();
|
|
74167
|
+
}
|
|
74168
|
+
let nodeIsTemplateNotText;
|
|
74169
|
+
if (targetType === void 0) {
|
|
74170
|
+
nodeIsTemplateNotText = false;
|
|
74171
|
+
} else if (targetType.equals(standardTypes.localizableTextTemplate)) {
|
|
74172
|
+
nodeIsTemplateNotText = true;
|
|
74173
|
+
} else if (targetType.kind === "union") {
|
|
74174
|
+
nodeIsTemplateNotText = targetType.unaliasedFlattenedTypes.some((t) => t.equals(standardTypes.localizableTextTemplate)) && !targetType.unaliasedFlattenedTypes.some((t) => t.equals(standardTypes.text));
|
|
74175
|
+
} else {
|
|
74176
|
+
nodeIsTemplateNotText = false;
|
|
74177
|
+
}
|
|
74178
|
+
if (nodeIsTemplateNotText) {
|
|
74179
|
+
return standardTypes.localizableTextTemplate;
|
|
74180
|
+
}
|
|
74181
|
+
return standardTypes.text;
|
|
74182
|
+
}
|
|
74186
74183
|
/**
|
|
74187
74184
|
* По умолчанию литерал шаблона текста имеет тип Текст.
|
|
74188
74185
|
*
|
|
@@ -74209,6 +74206,32 @@ var Type14 = class {
|
|
|
74209
74206
|
}
|
|
74210
74207
|
return nodeIsTemplateNotText ? standardTypes.textTemplate : standardTypes.text;
|
|
74211
74208
|
}
|
|
74209
|
+
/**
|
|
74210
|
+
* По умолчанию литерал шаблона текста имеет тип Текст.
|
|
74211
|
+
*
|
|
74212
|
+
* Литерал переводимого шаблона текста имеет тип ШаблонТекстаПереводимый в следующих случаях:
|
|
74213
|
+
* - если он присваивается в переменную, имеющую тип ШаблонТекстаПереводимый;
|
|
74214
|
+
* - если он присваивается в переменную, имеющую союзный тип, содержащий тип ШаблонТекстаПереводимый
|
|
74215
|
+
* и не содержащий тип Текст.
|
|
74216
|
+
*/
|
|
74217
|
+
ofLocalizableTextTemplateLiteral(node, analysisOptions) {
|
|
74218
|
+
const standardTypes = this.analyzer.getLocalizedStandardTypes(node.locale);
|
|
74219
|
+
let targetType = this.analyzer.getTargetTypeOfExpression(node, analysisOptions);
|
|
74220
|
+
if (targetType !== void 0) {
|
|
74221
|
+
targetType = targetType.unalias();
|
|
74222
|
+
}
|
|
74223
|
+
let nodeIsTemplateNotText;
|
|
74224
|
+
if (targetType === void 0) {
|
|
74225
|
+
nodeIsTemplateNotText = false;
|
|
74226
|
+
} else if (targetType.equals(standardTypes.localizableTextTemplate)) {
|
|
74227
|
+
nodeIsTemplateNotText = true;
|
|
74228
|
+
} else if (targetType.kind === "union") {
|
|
74229
|
+
nodeIsTemplateNotText = targetType.unaliasedFlattenedTypes.some((t) => t.equals(standardTypes.localizableTextTemplate)) && !targetType.unaliasedFlattenedTypes.some((t) => t.equals(standardTypes.text));
|
|
74230
|
+
} else {
|
|
74231
|
+
nodeIsTemplateNotText = false;
|
|
74232
|
+
}
|
|
74233
|
+
return nodeIsTemplateNotText ? standardTypes.localizableTextTemplate : standardTypes.text;
|
|
74234
|
+
}
|
|
74212
74235
|
ofIdentifierExpression(node, analysisOptions) {
|
|
74213
74236
|
const meaning = this.analyzer.resolveIdentifierExpression(node, analysisOptions);
|
|
74214
74237
|
switch (meaning.kind) {
|
|
@@ -75475,7 +75498,7 @@ var Entity9 = class {
|
|
|
75475
75498
|
areIndexedElementAccessorDeclarationsEqual(node1, node2) {
|
|
75476
75499
|
let areEqual = node1.parameterClause.parameterList.parameters.count() === node2.parameterClause.parameterList.parameters.count();
|
|
75477
75500
|
if (areEqual) {
|
|
75478
|
-
areEqual = node1.parameterClause.parameterList.parameters.zip(node2.parameterClause.parameterList.parameters, (p1, p2) => this.analyzer.createNameFromIdentifier(p1.name).considerEqual(this.analyzer.createNameFromIdentifier(p2.name)
|
|
75501
|
+
areEqual = node1.parameterClause.parameterList.parameters.zip(node2.parameterClause.parameterList.parameters, (p1, p2) => this.analyzer.createNameFromIdentifier(p1.name).considerEqual(this.analyzer.createNameFromIdentifier(p2.name)) && p1.typeAnnotation !== void 0 && p2.typeAnnotation !== void 0 && this.analyzer.type.ofTypeSpecifier(p1.typeAnnotation.typeSpecifier).equals(this.analyzer.type.ofTypeSpecifier(p2.typeAnnotation.typeSpecifier))).all((v) => v);
|
|
75479
75502
|
}
|
|
75480
75503
|
return areEqual;
|
|
75481
75504
|
}
|