@typescript-deploys/pr-build 5.3.0-pr-55820-7 → 5.3.0-pr-55600-27
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/lib/tsc.js +1027 -152
- package/lib/tsserver.js +1041 -162
- package/lib/typescript.d.ts +15 -0
- package/lib/typescript.js +1040 -164
- package/lib/typingsInstaller.js +997 -72
- package/package.json +2 -2
package/lib/typescript.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.3";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20230922`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -3497,7 +3497,7 @@ ${lanes.join("\n")}
|
|
|
3497
3497
|
const name = DiagnosticCategory[d.category];
|
|
3498
3498
|
return lowerCase ? name.toLowerCase() : name;
|
|
3499
3499
|
}
|
|
3500
|
-
var SyntaxKind, NodeFlags, ModifierFlags, JsxFlags, RelationComparisonResult, GeneratedIdentifierFlags, TokenFlags, FlowFlags, CommentDirectiveType, OperationCanceledException, FileIncludeKind, FilePreprocessingDiagnosticsKind, EmitOnly, StructureIsReused, ExitStatus, MemberOverrideStatus, UnionReduction, ContextFlags, NodeBuilderFlags, TypeFormatFlags, SymbolFormatFlags, SymbolAccessibility, SyntheticSymbolKind, TypePredicateKind, TypeReferenceSerializationKind, SymbolFlags, EnumKind, CheckFlags, InternalSymbolName, NodeCheckFlags, TypeFlags, ObjectFlags, VarianceFlags, ElementFlags, AccessFlags, IndexFlags, JsxReferenceKind, SignatureKind, SignatureFlags, IndexKind, TypeMapKind, InferencePriority, InferenceFlags, Ternary, AssignmentDeclarationKind, DiagnosticCategory, ModuleResolutionKind, ModuleDetectionKind, WatchFileKind, WatchDirectoryKind, PollingWatchKind, ModuleKind, JsxEmit, ImportsNotUsedAsValues, NewLineKind, ScriptKind, ScriptTarget, LanguageVariant, WatchDirectoryFlags, CharacterCodes, Extension, TransformFlags, SnippetKind, EmitFlags, InternalEmitFlags, ExternalEmitHelpers, EmitHint, OuterExpressionKinds, LexicalEnvironmentFlags, BundleFileSectionKind, ListFormat, PragmaKindFlags, commentPragmas;
|
|
3500
|
+
var SyntaxKind, NodeFlags, ModifierFlags, JsxFlags, RelationComparisonResult, GeneratedIdentifierFlags, RegularExpressionFlags, TokenFlags, FlowFlags, CommentDirectiveType, OperationCanceledException, FileIncludeKind, FilePreprocessingDiagnosticsKind, EmitOnly, StructureIsReused, ExitStatus, MemberOverrideStatus, UnionReduction, ContextFlags, NodeBuilderFlags, TypeFormatFlags, SymbolFormatFlags, SymbolAccessibility, SyntheticSymbolKind, TypePredicateKind, TypeReferenceSerializationKind, SymbolFlags, EnumKind, CheckFlags, InternalSymbolName, NodeCheckFlags, TypeFlags, ObjectFlags, VarianceFlags, ElementFlags, AccessFlags, IndexFlags, JsxReferenceKind, SignatureKind, SignatureFlags, IndexKind, TypeMapKind, InferencePriority, InferenceFlags, Ternary, AssignmentDeclarationKind, DiagnosticCategory, ModuleResolutionKind, ModuleDetectionKind, WatchFileKind, WatchDirectoryKind, PollingWatchKind, ModuleKind, JsxEmit, ImportsNotUsedAsValues, NewLineKind, ScriptKind, ScriptTarget, LanguageVariant, WatchDirectoryFlags, CharacterCodes, Extension, TransformFlags, SnippetKind, EmitFlags, InternalEmitFlags, ExternalEmitHelpers, EmitHint, OuterExpressionKinds, LexicalEnvironmentFlags, BundleFileSectionKind, ListFormat, PragmaKindFlags, commentPragmas;
|
|
3501
3501
|
var init_types = __esm({
|
|
3502
3502
|
"src/compiler/types.ts"() {
|
|
3503
3503
|
"use strict";
|
|
@@ -4005,6 +4005,20 @@ ${lanes.join("\n")}
|
|
|
4005
4005
|
GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["AllowNameSubstitution"] = 64] = "AllowNameSubstitution";
|
|
4006
4006
|
return GeneratedIdentifierFlags2;
|
|
4007
4007
|
})(GeneratedIdentifierFlags || {});
|
|
4008
|
+
RegularExpressionFlags = /* @__PURE__ */ ((RegularExpressionFlags2) => {
|
|
4009
|
+
RegularExpressionFlags2[RegularExpressionFlags2["None"] = 0] = "None";
|
|
4010
|
+
RegularExpressionFlags2[RegularExpressionFlags2["HasIndices"] = 1] = "HasIndices";
|
|
4011
|
+
RegularExpressionFlags2[RegularExpressionFlags2["Global"] = 2] = "Global";
|
|
4012
|
+
RegularExpressionFlags2[RegularExpressionFlags2["IgnoreCase"] = 4] = "IgnoreCase";
|
|
4013
|
+
RegularExpressionFlags2[RegularExpressionFlags2["Multiline"] = 8] = "Multiline";
|
|
4014
|
+
RegularExpressionFlags2[RegularExpressionFlags2["DotAll"] = 16] = "DotAll";
|
|
4015
|
+
RegularExpressionFlags2[RegularExpressionFlags2["Unicode"] = 32] = "Unicode";
|
|
4016
|
+
RegularExpressionFlags2[RegularExpressionFlags2["UnicodeSets"] = 64] = "UnicodeSets";
|
|
4017
|
+
RegularExpressionFlags2[RegularExpressionFlags2["Sticky"] = 128] = "Sticky";
|
|
4018
|
+
RegularExpressionFlags2[RegularExpressionFlags2["UnicodeMode"] = 96] = "UnicodeMode";
|
|
4019
|
+
RegularExpressionFlags2[RegularExpressionFlags2["Modifiers"] = 28] = "Modifiers";
|
|
4020
|
+
return RegularExpressionFlags2;
|
|
4021
|
+
})(RegularExpressionFlags || {});
|
|
4008
4022
|
TokenFlags = /* @__PURE__ */ ((TokenFlags2) => {
|
|
4009
4023
|
TokenFlags2[TokenFlags2["None"] = 0] = "None";
|
|
4010
4024
|
TokenFlags2[TokenFlags2["PrecedingLineBreak"] = 1] = "PrecedingLineBreak";
|
|
@@ -4709,6 +4723,8 @@ ${lanes.join("\n")}
|
|
|
4709
4723
|
ScriptTarget11[ScriptTarget11["ES2020"] = 7] = "ES2020";
|
|
4710
4724
|
ScriptTarget11[ScriptTarget11["ES2021"] = 8] = "ES2021";
|
|
4711
4725
|
ScriptTarget11[ScriptTarget11["ES2022"] = 9] = "ES2022";
|
|
4726
|
+
ScriptTarget11[ScriptTarget11["ES2023"] = 10] = "ES2023";
|
|
4727
|
+
ScriptTarget11[ScriptTarget11["ES2024"] = 11] = "ES2024";
|
|
4712
4728
|
ScriptTarget11[ScriptTarget11["ESNext"] = 99] = "ESNext";
|
|
4713
4729
|
ScriptTarget11[ScriptTarget11["JSON"] = 100] = "JSON";
|
|
4714
4730
|
ScriptTarget11[ScriptTarget11["Latest"] = 99 /* ESNext */] = "Latest";
|
|
@@ -7394,6 +7410,43 @@ ${lanes.join("\n")}
|
|
|
7394
7410
|
The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration: diag(1493, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration_1493", "The left-hand side of a 'for...in' statement cannot be a 'using' declaration."),
|
|
7395
7411
|
The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration: diag(1494, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration_1494", "The left-hand side of a 'for...in' statement cannot be an 'await using' declaration."),
|
|
7396
7412
|
_0_modifier_cannot_appear_on_an_await_using_declaration: diag(1495, 1 /* Error */, "_0_modifier_cannot_appear_on_an_await_using_declaration_1495", "'{0}' modifier cannot appear on an 'await using' declaration."),
|
|
7413
|
+
_0_is_not_a_valid_character_escape: diag(1496, 1 /* Error */, "_0_is_not_a_valid_character_escape_1496", "'\\{0}' is not a valid character escape."),
|
|
7414
|
+
Unknown_regular_expression_flag: diag(1497, 1 /* Error */, "Unknown_regular_expression_flag_1497", "Unknown regular expression flag."),
|
|
7415
|
+
Duplicate_regular_expression_flag: diag(1498, 1 /* Error */, "Duplicate_regular_expression_flag_1498", "Duplicate regular expression flag."),
|
|
7416
|
+
This_regular_expression_flag_is_only_available_when_targeting_0_or_later: diag(1499, 1 /* Error */, "This_regular_expression_flag_is_only_available_when_targeting_0_or_later_1499", "This regular expression flag is only available when targeting '{0}' or later."),
|
|
7417
|
+
The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously: diag(1500, 1 /* Error */, "The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously_1500", "The Unicode (u) flag and the Unicode Sets (v) flag cannot be set simultaneously."),
|
|
7418
|
+
Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later: diag(1501, 1 /* Error */, "Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later_1501", "Named capturing groups are only available when targeting 'ES2018' or later."),
|
|
7419
|
+
Subpattern_flags_must_be_present_when_there_is_a_minus_sign: diag(1502, 1 /* Error */, "Subpattern_flags_must_be_present_when_there_is_a_minus_sign_1502", "Subpattern flags must be present when there is a minus sign."),
|
|
7420
|
+
Incomplete_quantifier_Digit_expected: diag(1503, 1 /* Error */, "Incomplete_quantifier_Digit_expected_1503", "Incomplete quantifier. Digit expected."),
|
|
7421
|
+
Numbers_out_of_order_in_quantifier: diag(1504, 1 /* Error */, "Numbers_out_of_order_in_quantifier_1504", "Numbers out of order in quantifier."),
|
|
7422
|
+
There_is_nothing_available_for_repetition: diag(1505, 1 /* Error */, "There_is_nothing_available_for_repetition_1505", "There is nothing available for repetition."),
|
|
7423
|
+
Unexpected_0_Did_you_mean_to_escape_it_with_backslash: diag(1506, 1 /* Error */, "Unexpected_0_Did_you_mean_to_escape_it_with_backslash_1506", "Unexpected '{0}'. Did you mean to escape it with backslash?"),
|
|
7424
|
+
This_regular_expression_flag_cannot_be_toggled_within_a_subpattern: diag(1507, 1 /* Error */, "This_regular_expression_flag_cannot_be_toggled_within_a_subpattern_1507", "This regular expression flag cannot be toggled within a subpattern."),
|
|
7425
|
+
k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets: diag(1508, 1 /* Error */, "k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets_1508", "'\\k' must be followed by a capturing group name enclosed in angle brackets."),
|
|
7426
|
+
q_is_only_available_inside_character_class: diag(1509, 1 /* Error */, "q_is_only_available_inside_character_class_1509", "'\\q' is only available inside character class."),
|
|
7427
|
+
c_must_be_followed_by_an_ASCII_letter: diag(1510, 1 /* Error */, "c_must_be_followed_by_an_ASCII_letter_1510", "'\\c' must be followed by an ASCII letter."),
|
|
7428
|
+
Undetermined_character_escape: diag(1511, 1 /* Error */, "Undetermined_character_escape_1511", "Undetermined character escape."),
|
|
7429
|
+
Expected_a_capturing_group_name: diag(1512, 1 /* Error */, "Expected_a_capturing_group_name_1512", "Expected a capturing group name."),
|
|
7430
|
+
Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other: diag(1513, 1 /* Error */, "Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other_1513", "Named capturing groups with the same name must be mutually exclusive to each other."),
|
|
7431
|
+
A_character_class_range_must_not_be_bounded_by_another_character_class: diag(1514, 1 /* Error */, "A_character_class_range_must_not_be_bounded_by_another_character_class_1514", "A character class range must not be bounded by another character class."),
|
|
7432
|
+
Range_out_of_order_in_character_class: diag(1515, 1 /* Error */, "Range_out_of_order_in_character_class_1515", "Range out of order in character class."),
|
|
7433
|
+
Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class: diag(1516, 1 /* Error */, "Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_characte_1516", "Anything that would possibly match more than a single character is invalid inside a negated character class."),
|
|
7434
|
+
Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead: diag(1517, 1 /* Error */, "Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead_1517", "Operators must not be mixed within a character class. Wrap it in a nested class instead."),
|
|
7435
|
+
Expected_a_class_set_oprand: diag(1518, 1 /* Error */, "Expected_a_class_set_oprand_1518", "Expected a class set oprand."),
|
|
7436
|
+
q_must_be_followed_by_string_alternatives_enclosed_in_braces: diag(1519, 1 /* Error */, "q_must_be_followed_by_string_alternatives_enclosed_in_braces_1519", "'\\q' must be followed by string alternatives enclosed in braces."),
|
|
7437
|
+
A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backslash: diag(1520, 1 /* Error */, "A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backs_1520", "A character class must not contain a reserved double punctuator. Did you mean to escape it with backslash?"),
|
|
7438
|
+
Expected_a_Unicode_property_name: diag(1521, 1 /* Error */, "Expected_a_Unicode_property_name_1521", "Expected a Unicode property name."),
|
|
7439
|
+
Unknown_Unicode_property_name: diag(1522, 1 /* Error */, "Unknown_Unicode_property_name_1522", "Unknown Unicode property name."),
|
|
7440
|
+
Expected_a_Unicode_property_value: diag(1523, 1 /* Error */, "Expected_a_Unicode_property_value_1523", "Expected a Unicode property value."),
|
|
7441
|
+
Unknown_Unicode_property_value: diag(1524, 1 /* Error */, "Unknown_Unicode_property_value_1524", "Unknown Unicode property value."),
|
|
7442
|
+
Expected_a_Unicode_property_name_or_value: diag(1525, 1 /* Error */, "Expected_a_Unicode_property_name_or_value_1525", "Expected a Unicode property name or value."),
|
|
7443
|
+
Any_Unicode_property_that_would_possibly_match_more_than_a_single_character_is_only_available_when_the_Unicode_Sets_v_flag_is_set: diag(1526, 1 /* Error */, "Any_Unicode_property_that_would_possibly_match_more_than_a_single_character_is_only_available_when_t_1526", "Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set."),
|
|
7444
|
+
Unknown_Unicode_property_name_or_value: diag(1527, 1 /* Error */, "Unknown_Unicode_property_name_or_value_1527", "Unknown Unicode property name or value."),
|
|
7445
|
+
Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set: diag(1528, 1 /* Error */, "Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v__1528", "Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set."),
|
|
7446
|
+
_0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces: diag(1529, 1 /* Error */, "_0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces_1529", "'\\{0}' must be followed by a Unicode property value expression enclosed in braces."),
|
|
7447
|
+
There_is_no_capturing_group_named_0_in_this_regular_expression: diag(1530, 1 /* Error */, "There_is_no_capturing_group_named_0_in_this_regular_expression_1530", "There is no capturing group named '{0}' in this regular expression."),
|
|
7448
|
+
A_decimal_escape_must_refer_to_an_existent_capturing_group_There_are_only_0_capturing_groups_in_this_regular_expression: diag(1531, 1 /* Error */, "A_decimal_escape_must_refer_to_an_existent_capturing_group_There_are_only_0_capturing_groups_in_this_1531", "A decimal escape must refer to an existent capturing group. There are only {0} capturing groups in this regular expression."),
|
|
7449
|
+
Decimal_escapes_are_invalid_when_there_are_no_capturing_groups_in_a_regular_expression: diag(1532, 1 /* Error */, "Decimal_escapes_are_invalid_when_there_are_no_capturing_groups_in_a_regular_expression_1532", "Decimal escapes are invalid when there are no capturing groups in a regular expression."),
|
|
7397
7450
|
The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
|
|
7398
7451
|
The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
|
|
7399
7452
|
Call_signature_return_types_0_and_1_are_incompatible: diag(
|
|
@@ -8991,7 +9044,7 @@ ${lanes.join("\n")}
|
|
|
8991
9044
|
Could_not_convert_to_arrow_function: diag(95151, 3 /* Message */, "Could_not_convert_to_arrow_function_95151", "Could not convert to arrow function"),
|
|
8992
9045
|
Could_not_convert_to_named_function: diag(95152, 3 /* Message */, "Could_not_convert_to_named_function_95152", "Could not convert to named function"),
|
|
8993
9046
|
Could_not_convert_to_anonymous_function: diag(95153, 3 /* Message */, "Could_not_convert_to_anonymous_function_95153", "Could not convert to anonymous function"),
|
|
8994
|
-
|
|
9047
|
+
Can_only_convert_string_concatenation: diag(95154, 3 /* Message */, "Can_only_convert_string_concatenation_95154", "Can only convert string concatenation"),
|
|
8995
9048
|
Selection_is_not_a_valid_statement_or_statements: diag(95155, 3 /* Message */, "Selection_is_not_a_valid_statement_or_statements_95155", "Selection is not a valid statement or statements"),
|
|
8996
9049
|
Add_missing_function_declaration_0: diag(95156, 3 /* Message */, "Add_missing_function_declaration_0_95156", "Add missing function declaration '{0}'"),
|
|
8997
9050
|
Add_all_missing_function_declarations: diag(95157, 3 /* Message */, "Add_all_missing_function_declarations_95157", "Add all missing function declarations"),
|
|
@@ -9119,6 +9172,15 @@ ${lanes.join("\n")}
|
|
|
9119
9172
|
function stringToToken(s) {
|
|
9120
9173
|
return textToToken.get(s);
|
|
9121
9174
|
}
|
|
9175
|
+
function regularExpressionFlagToCharacter(f) {
|
|
9176
|
+
return regExpFlagChars[f];
|
|
9177
|
+
}
|
|
9178
|
+
function characterToRegularExpressionFlag(c) {
|
|
9179
|
+
return charToRegExpFlag.get(c);
|
|
9180
|
+
}
|
|
9181
|
+
function regularExpressionFlagToFirstAvailableLanguageVersion(f) {
|
|
9182
|
+
return regExpFlagToFirstAvailableLanguageVersion.get(f);
|
|
9183
|
+
}
|
|
9122
9184
|
function computeLineStarts(text) {
|
|
9123
9185
|
const result = [];
|
|
9124
9186
|
let pos = 0;
|
|
@@ -9215,8 +9277,11 @@ ${lanes.join("\n")}
|
|
|
9215
9277
|
function isHexDigit(ch) {
|
|
9216
9278
|
return isDigit(ch) || ch >= 65 /* A */ && ch <= 70 /* F */ || ch >= 97 /* a */ && ch <= 102 /* f */;
|
|
9217
9279
|
}
|
|
9218
|
-
function
|
|
9219
|
-
return
|
|
9280
|
+
function isASCIILetter(ch) {
|
|
9281
|
+
return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */;
|
|
9282
|
+
}
|
|
9283
|
+
function isWordCharacter(ch) {
|
|
9284
|
+
return isASCIILetter(ch) || isDigit(ch) || ch === 95 /* _ */;
|
|
9220
9285
|
}
|
|
9221
9286
|
function isOctalDigit(ch) {
|
|
9222
9287
|
return ch >= 48 /* _0 */ && ch <= 55 /* _7 */;
|
|
@@ -9553,10 +9618,10 @@ ${lanes.join("\n")}
|
|
|
9553
9618
|
}
|
|
9554
9619
|
}
|
|
9555
9620
|
function isIdentifierStart(ch, languageVersion) {
|
|
9556
|
-
return ch
|
|
9621
|
+
return isASCIILetter(ch) || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion);
|
|
9557
9622
|
}
|
|
9558
9623
|
function isIdentifierPart(ch, languageVersion, identifierVariant) {
|
|
9559
|
-
return ch
|
|
9624
|
+
return isWordCharacter(ch) || ch === 36 /* $ */ || // "-" and ":" are valid in JSX Identifiers
|
|
9560
9625
|
(identifierVariant === 1 /* JSX */ ? ch === 45 /* minus */ || ch === 58 /* colon */ : false) || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion);
|
|
9561
9626
|
}
|
|
9562
9627
|
function isIdentifierText(name, languageVersion, identifierVariant) {
|
|
@@ -9875,7 +9940,9 @@ ${lanes.join("\n")}
|
|
|
9875
9940
|
result += text.substring(start2, pos);
|
|
9876
9941
|
result += scanEscapeSequence(
|
|
9877
9942
|
/*shouldEmitInvalidEscapeError*/
|
|
9878
|
-
true
|
|
9943
|
+
true,
|
|
9944
|
+
/*isRegularExpression*/
|
|
9945
|
+
false
|
|
9879
9946
|
);
|
|
9880
9947
|
start2 = pos;
|
|
9881
9948
|
continue;
|
|
@@ -9919,7 +9986,11 @@ ${lanes.join("\n")}
|
|
|
9919
9986
|
}
|
|
9920
9987
|
if (currChar === 92 /* backslash */) {
|
|
9921
9988
|
contents += text.substring(start2, pos);
|
|
9922
|
-
contents += scanEscapeSequence(
|
|
9989
|
+
contents += scanEscapeSequence(
|
|
9990
|
+
shouldEmitInvalidEscapeError,
|
|
9991
|
+
/*isRegularExpression*/
|
|
9992
|
+
false
|
|
9993
|
+
);
|
|
9923
9994
|
start2 = pos;
|
|
9924
9995
|
continue;
|
|
9925
9996
|
}
|
|
@@ -9939,7 +10010,7 @@ ${lanes.join("\n")}
|
|
|
9939
10010
|
tokenValue = contents;
|
|
9940
10011
|
return resultingToken;
|
|
9941
10012
|
}
|
|
9942
|
-
function scanEscapeSequence(shouldEmitInvalidEscapeError) {
|
|
10013
|
+
function scanEscapeSequence(shouldEmitInvalidEscapeError, isRegularExpression) {
|
|
9943
10014
|
const start2 = pos;
|
|
9944
10015
|
pos++;
|
|
9945
10016
|
if (pos >= end) {
|
|
@@ -9967,7 +10038,7 @@ ${lanes.join("\n")}
|
|
|
9967
10038
|
pos++;
|
|
9968
10039
|
}
|
|
9969
10040
|
tokenFlags |= 2048 /* ContainsInvalidEscape */;
|
|
9970
|
-
if (shouldEmitInvalidEscapeError) {
|
|
10041
|
+
if (isRegularExpression || shouldEmitInvalidEscapeError) {
|
|
9971
10042
|
const code = parseInt(text.substring(start2 + 1, pos), 8);
|
|
9972
10043
|
error2(Diagnostics.Octal_escape_sequences_are_not_allowed_Use_the_syntax_0, start2, pos - start2, "\\x" + code.toString(16).padStart(2, "0"));
|
|
9973
10044
|
return String.fromCharCode(code);
|
|
@@ -9976,7 +10047,7 @@ ${lanes.join("\n")}
|
|
|
9976
10047
|
case 56 /* _8 */:
|
|
9977
10048
|
case 57 /* _9 */:
|
|
9978
10049
|
tokenFlags |= 2048 /* ContainsInvalidEscape */;
|
|
9979
|
-
if (shouldEmitInvalidEscapeError) {
|
|
10050
|
+
if (isRegularExpression || shouldEmitInvalidEscapeError) {
|
|
9980
10051
|
error2(Diagnostics.Escape_sequence_0_is_not_allowed, start2, pos - start2, text.substring(start2, pos));
|
|
9981
10052
|
return String.fromCharCode(ch);
|
|
9982
10053
|
}
|
|
@@ -9998,62 +10069,42 @@ ${lanes.join("\n")}
|
|
|
9998
10069
|
case 34 /* doubleQuote */:
|
|
9999
10070
|
return '"';
|
|
10000
10071
|
case 117 /* u */:
|
|
10001
|
-
if (pos < end && text.charCodeAt(pos) === 123 /* openBrace */) {
|
|
10002
|
-
pos
|
|
10003
|
-
|
|
10004
|
-
1,
|
|
10005
|
-
/*canHaveSeparators*/
|
|
10006
|
-
false
|
|
10007
|
-
);
|
|
10008
|
-
const escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1;
|
|
10009
|
-
if (escapedValue < 0) {
|
|
10010
|
-
tokenFlags |= 2048 /* ContainsInvalidEscape */;
|
|
10011
|
-
if (shouldEmitInvalidEscapeError) {
|
|
10012
|
-
error2(Diagnostics.Hexadecimal_digit_expected);
|
|
10013
|
-
}
|
|
10014
|
-
return text.substring(start2, pos);
|
|
10015
|
-
}
|
|
10016
|
-
if (!isCodePoint(escapedValue)) {
|
|
10017
|
-
tokenFlags |= 2048 /* ContainsInvalidEscape */;
|
|
10018
|
-
if (shouldEmitInvalidEscapeError) {
|
|
10019
|
-
error2(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive);
|
|
10020
|
-
}
|
|
10021
|
-
return text.substring(start2, pos);
|
|
10022
|
-
}
|
|
10023
|
-
if (pos >= end) {
|
|
10024
|
-
tokenFlags |= 2048 /* ContainsInvalidEscape */;
|
|
10025
|
-
if (shouldEmitInvalidEscapeError) {
|
|
10026
|
-
error2(Diagnostics.Unexpected_end_of_text);
|
|
10027
|
-
}
|
|
10028
|
-
return text.substring(start2, pos);
|
|
10029
|
-
}
|
|
10030
|
-
if (text.charCodeAt(pos) !== 125 /* closeBrace */) {
|
|
10031
|
-
tokenFlags |= 2048 /* ContainsInvalidEscape */;
|
|
10032
|
-
if (shouldEmitInvalidEscapeError) {
|
|
10033
|
-
error2(Diagnostics.Unterminated_Unicode_escape_sequence);
|
|
10034
|
-
}
|
|
10035
|
-
return text.substring(start2, pos);
|
|
10036
|
-
}
|
|
10037
|
-
pos++;
|
|
10038
|
-
tokenFlags |= 8 /* ExtendedUnicodeEscape */;
|
|
10039
|
-
return utf16EncodeAsString(escapedValue);
|
|
10072
|
+
if ((!isRegularExpression || shouldEmitInvalidEscapeError) && pos < end && text.charCodeAt(pos) === 123 /* openBrace */) {
|
|
10073
|
+
pos -= 2;
|
|
10074
|
+
return scanExtendedUnicodeEscape(isRegularExpression || shouldEmitInvalidEscapeError);
|
|
10040
10075
|
}
|
|
10041
10076
|
for (; pos < start2 + 6; pos++) {
|
|
10042
10077
|
if (!(pos < end && isHexDigit(text.charCodeAt(pos)))) {
|
|
10043
10078
|
tokenFlags |= 2048 /* ContainsInvalidEscape */;
|
|
10044
|
-
if (shouldEmitInvalidEscapeError) {
|
|
10079
|
+
if (isRegularExpression || shouldEmitInvalidEscapeError) {
|
|
10045
10080
|
error2(Diagnostics.Hexadecimal_digit_expected);
|
|
10046
10081
|
}
|
|
10047
10082
|
return text.substring(start2, pos);
|
|
10048
10083
|
}
|
|
10049
10084
|
}
|
|
10050
10085
|
tokenFlags |= 1024 /* UnicodeEscape */;
|
|
10051
|
-
|
|
10086
|
+
const escapedValue = parseInt(text.substring(start2 + 2, pos), 16);
|
|
10087
|
+
const escapedValueString = String.fromCharCode(escapedValue);
|
|
10088
|
+
if (isRegularExpression && shouldEmitInvalidEscapeError && escapedValue >= 55296 && escapedValue <= 56319 && pos + 6 < end && text.substring(pos, pos + 2) === "\\u" && text.charCodeAt(pos + 2) !== 123 /* openBrace */) {
|
|
10089
|
+
const nextStart = pos;
|
|
10090
|
+
let nextPos = pos + 2;
|
|
10091
|
+
for (; nextPos < nextStart + 6; nextPos++) {
|
|
10092
|
+
if (!isHexDigit(text.charCodeAt(pos))) {
|
|
10093
|
+
return escapedValueString;
|
|
10094
|
+
}
|
|
10095
|
+
}
|
|
10096
|
+
const nextEscapedValue = parseInt(text.substring(nextStart + 2, nextPos), 16);
|
|
10097
|
+
if (nextEscapedValue >= 56320 && nextEscapedValue <= 57343) {
|
|
10098
|
+
pos = nextPos;
|
|
10099
|
+
return escapedValueString + String.fromCharCode(nextEscapedValue);
|
|
10100
|
+
}
|
|
10101
|
+
}
|
|
10102
|
+
return escapedValueString;
|
|
10052
10103
|
case 120 /* x */:
|
|
10053
10104
|
for (; pos < start2 + 4; pos++) {
|
|
10054
10105
|
if (!(pos < end && isHexDigit(text.charCodeAt(pos)))) {
|
|
10055
10106
|
tokenFlags |= 2048 /* ContainsInvalidEscape */;
|
|
10056
|
-
if (shouldEmitInvalidEscapeError) {
|
|
10107
|
+
if (isRegularExpression || shouldEmitInvalidEscapeError) {
|
|
10057
10108
|
error2(Diagnostics.Hexadecimal_digit_expected);
|
|
10058
10109
|
}
|
|
10059
10110
|
return text.substring(start2, pos);
|
|
@@ -10070,10 +10121,16 @@ ${lanes.join("\n")}
|
|
|
10070
10121
|
case 8233 /* paragraphSeparator */:
|
|
10071
10122
|
return "";
|
|
10072
10123
|
default:
|
|
10124
|
+
if (isRegularExpression && (shouldEmitInvalidEscapeError || isIdentifierPart(ch, languageVersion))) {
|
|
10125
|
+
error2(Diagnostics._0_is_not_a_valid_character_escape, pos - 2, 2, String.fromCharCode(ch));
|
|
10126
|
+
}
|
|
10073
10127
|
return String.fromCharCode(ch);
|
|
10074
10128
|
}
|
|
10075
10129
|
}
|
|
10076
|
-
function scanExtendedUnicodeEscape() {
|
|
10130
|
+
function scanExtendedUnicodeEscape(shouldEmitInvalidEscapeError = true) {
|
|
10131
|
+
const start2 = pos;
|
|
10132
|
+
pos += 3;
|
|
10133
|
+
const escapedStart = pos;
|
|
10077
10134
|
const escapedValueString = scanMinimumNumberOfHexDigits(
|
|
10078
10135
|
1,
|
|
10079
10136
|
/*canHaveSeparators*/
|
|
@@ -10082,24 +10139,34 @@ ${lanes.join("\n")}
|
|
|
10082
10139
|
const escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1;
|
|
10083
10140
|
let isInvalidExtendedEscape = false;
|
|
10084
10141
|
if (escapedValue < 0) {
|
|
10085
|
-
|
|
10142
|
+
if (shouldEmitInvalidEscapeError) {
|
|
10143
|
+
error2(Diagnostics.Hexadecimal_digit_expected);
|
|
10144
|
+
}
|
|
10086
10145
|
isInvalidExtendedEscape = true;
|
|
10087
10146
|
} else if (escapedValue > 1114111) {
|
|
10088
|
-
|
|
10147
|
+
if (shouldEmitInvalidEscapeError) {
|
|
10148
|
+
error2(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive, escapedStart, pos - escapedStart);
|
|
10149
|
+
}
|
|
10089
10150
|
isInvalidExtendedEscape = true;
|
|
10090
10151
|
}
|
|
10091
10152
|
if (pos >= end) {
|
|
10092
|
-
|
|
10153
|
+
if (shouldEmitInvalidEscapeError) {
|
|
10154
|
+
error2(Diagnostics.Unexpected_end_of_text);
|
|
10155
|
+
}
|
|
10093
10156
|
isInvalidExtendedEscape = true;
|
|
10094
10157
|
} else if (text.charCodeAt(pos) === 125 /* closeBrace */) {
|
|
10095
10158
|
pos++;
|
|
10096
10159
|
} else {
|
|
10097
|
-
|
|
10160
|
+
if (shouldEmitInvalidEscapeError) {
|
|
10161
|
+
error2(Diagnostics.Unterminated_Unicode_escape_sequence);
|
|
10162
|
+
}
|
|
10098
10163
|
isInvalidExtendedEscape = true;
|
|
10099
10164
|
}
|
|
10100
10165
|
if (isInvalidExtendedEscape) {
|
|
10101
|
-
|
|
10166
|
+
tokenFlags |= 2048 /* ContainsInvalidEscape */;
|
|
10167
|
+
return text.substring(start2, pos);
|
|
10102
10168
|
}
|
|
10169
|
+
tokenFlags |= 8 /* ExtendedUnicodeEscape */;
|
|
10103
10170
|
return utf16EncodeAsString(escapedValue);
|
|
10104
10171
|
}
|
|
10105
10172
|
function peekUnicodeEscape() {
|
|
@@ -10141,8 +10208,6 @@ ${lanes.join("\n")}
|
|
|
10141
10208
|
} else if (ch === 92 /* backslash */) {
|
|
10142
10209
|
ch = peekExtendedUnicodeEscape();
|
|
10143
10210
|
if (ch >= 0 && isIdentifierPart(ch, languageVersion)) {
|
|
10144
|
-
pos += 3;
|
|
10145
|
-
tokenFlags |= 8 /* ExtendedUnicodeEscape */;
|
|
10146
10211
|
result += scanExtendedUnicodeEscape();
|
|
10147
10212
|
start2 = pos;
|
|
10148
10213
|
continue;
|
|
@@ -10613,8 +10678,6 @@ ${lanes.join("\n")}
|
|
|
10613
10678
|
case 92 /* backslash */:
|
|
10614
10679
|
const extendedCookedChar = peekExtendedUnicodeEscape();
|
|
10615
10680
|
if (extendedCookedChar >= 0 && isIdentifierStart(extendedCookedChar, languageVersion)) {
|
|
10616
|
-
pos += 3;
|
|
10617
|
-
tokenFlags |= 8 /* ExtendedUnicodeEscape */;
|
|
10618
10681
|
tokenValue = scanExtendedUnicodeEscape() + scanIdentifierParts();
|
|
10619
10682
|
return token = getIdentifierToken();
|
|
10620
10683
|
}
|
|
@@ -10630,7 +10693,7 @@ ${lanes.join("\n")}
|
|
|
10630
10693
|
return token = 0 /* Unknown */;
|
|
10631
10694
|
case 35 /* hash */:
|
|
10632
10695
|
if (pos !== 0 && text[pos + 1] === "!") {
|
|
10633
|
-
error2(Diagnostics.can_only_be_used_at_the_start_of_a_file);
|
|
10696
|
+
error2(Diagnostics.can_only_be_used_at_the_start_of_a_file, pos, 2);
|
|
10634
10697
|
pos++;
|
|
10635
10698
|
return token = 0 /* Unknown */;
|
|
10636
10699
|
}
|
|
@@ -10639,8 +10702,6 @@ ${lanes.join("\n")}
|
|
|
10639
10702
|
pos++;
|
|
10640
10703
|
const extendedCookedChar2 = peekExtendedUnicodeEscape();
|
|
10641
10704
|
if (extendedCookedChar2 >= 0 && isIdentifierStart(extendedCookedChar2, languageVersion)) {
|
|
10642
|
-
pos += 3;
|
|
10643
|
-
tokenFlags |= 8 /* ExtendedUnicodeEscape */;
|
|
10644
10705
|
tokenValue = "#" + scanExtendedUnicodeEscape() + scanIdentifierParts();
|
|
10645
10706
|
return token = 81 /* PrivateIdentifier */;
|
|
10646
10707
|
}
|
|
@@ -10763,14 +10824,841 @@ ${lanes.join("\n")}
|
|
|
10763
10824
|
}
|
|
10764
10825
|
p++;
|
|
10765
10826
|
}
|
|
10766
|
-
|
|
10827
|
+
const isUnterminated = !!(tokenFlags & 4 /* Unterminated */);
|
|
10828
|
+
const endOfBody = p - (isUnterminated ? 0 : 1);
|
|
10829
|
+
let regExpFlags = 0 /* None */;
|
|
10830
|
+
while (p < end) {
|
|
10831
|
+
const ch = text.charCodeAt(p);
|
|
10832
|
+
if (!isIdentifierPart(ch, languageVersion)) {
|
|
10833
|
+
break;
|
|
10834
|
+
}
|
|
10835
|
+
const flag = characterToRegularExpressionFlag(String.fromCharCode(ch));
|
|
10836
|
+
if (flag === void 0) {
|
|
10837
|
+
error2(Diagnostics.Unknown_regular_expression_flag, p, 1);
|
|
10838
|
+
} else if (regExpFlags & flag) {
|
|
10839
|
+
error2(Diagnostics.Duplicate_regular_expression_flag, p, 1);
|
|
10840
|
+
} else if (((regExpFlags | flag) & 96 /* UnicodeMode */) === 96 /* UnicodeMode */) {
|
|
10841
|
+
error2(Diagnostics.The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously, p, 1);
|
|
10842
|
+
} else {
|
|
10843
|
+
regExpFlags |= flag;
|
|
10844
|
+
const availableFrom = regularExpressionFlagToFirstAvailableLanguageVersion(flag);
|
|
10845
|
+
if (languageVersion < availableFrom) {
|
|
10846
|
+
error2(Diagnostics.This_regular_expression_flag_is_only_available_when_targeting_0_or_later, p, 1, ScriptTarget[availableFrom]);
|
|
10847
|
+
}
|
|
10848
|
+
}
|
|
10767
10849
|
p++;
|
|
10768
10850
|
}
|
|
10769
|
-
pos =
|
|
10851
|
+
pos = tokenStart + 1;
|
|
10852
|
+
const saveTokenPos = tokenStart;
|
|
10853
|
+
const saveTokenFlags = tokenFlags;
|
|
10854
|
+
scanRegularExpressionWorker(text.slice(0, endOfBody), endOfBody, regExpFlags, isUnterminated);
|
|
10855
|
+
if (!isUnterminated) {
|
|
10856
|
+
pos = p;
|
|
10857
|
+
}
|
|
10858
|
+
tokenStart = saveTokenPos;
|
|
10859
|
+
tokenFlags = saveTokenFlags;
|
|
10770
10860
|
tokenValue = text.substring(tokenStart, pos);
|
|
10771
10861
|
token = 14 /* RegularExpressionLiteral */;
|
|
10772
10862
|
}
|
|
10773
10863
|
return token;
|
|
10864
|
+
function scanRegularExpressionWorker(text2, end2, regExpFlags, isUnterminated) {
|
|
10865
|
+
const unicodeMode = !!(regExpFlags & 96 /* UnicodeMode */);
|
|
10866
|
+
const unicodeSetsMode = !!(regExpFlags & 64 /* UnicodeSets */);
|
|
10867
|
+
let mayContainStrings = false;
|
|
10868
|
+
let numberOfCapturingGroups = 0;
|
|
10869
|
+
const groupSpecifiers = /* @__PURE__ */ new Set();
|
|
10870
|
+
const groupNameReferences = [];
|
|
10871
|
+
const decimalEscapes = [];
|
|
10872
|
+
const namedCapturingGroups = [];
|
|
10873
|
+
function scanDisjunction(isInGroup) {
|
|
10874
|
+
while (true) {
|
|
10875
|
+
namedCapturingGroups.push(/* @__PURE__ */ new Set());
|
|
10876
|
+
scanAlternative(isInGroup);
|
|
10877
|
+
namedCapturingGroups.pop();
|
|
10878
|
+
if (text2.charCodeAt(pos) !== 124 /* bar */) {
|
|
10879
|
+
return;
|
|
10880
|
+
}
|
|
10881
|
+
pos++;
|
|
10882
|
+
}
|
|
10883
|
+
}
|
|
10884
|
+
function scanAlternative(isInGroup) {
|
|
10885
|
+
let isPreviousTermQuantifiable = false;
|
|
10886
|
+
while (pos < end2) {
|
|
10887
|
+
const start2 = pos;
|
|
10888
|
+
const ch = text2.charCodeAt(pos);
|
|
10889
|
+
switch (ch) {
|
|
10890
|
+
case 94 /* caret */:
|
|
10891
|
+
case 36 /* $ */:
|
|
10892
|
+
pos++;
|
|
10893
|
+
isPreviousTermQuantifiable = false;
|
|
10894
|
+
break;
|
|
10895
|
+
case 92 /* backslash */:
|
|
10896
|
+
pos++;
|
|
10897
|
+
switch (text2.charCodeAt(pos)) {
|
|
10898
|
+
case 98 /* b */:
|
|
10899
|
+
case 66 /* B */:
|
|
10900
|
+
pos++;
|
|
10901
|
+
isPreviousTermQuantifiable = false;
|
|
10902
|
+
break;
|
|
10903
|
+
default:
|
|
10904
|
+
scanAtomEscape();
|
|
10905
|
+
isPreviousTermQuantifiable = true;
|
|
10906
|
+
break;
|
|
10907
|
+
}
|
|
10908
|
+
break;
|
|
10909
|
+
case 40 /* openParen */:
|
|
10910
|
+
pos++;
|
|
10911
|
+
if (text2.charCodeAt(pos) === 63 /* question */) {
|
|
10912
|
+
pos++;
|
|
10913
|
+
switch (text2.charCodeAt(pos)) {
|
|
10914
|
+
case 61 /* equals */:
|
|
10915
|
+
case 33 /* exclamation */:
|
|
10916
|
+
pos++;
|
|
10917
|
+
isPreviousTermQuantifiable = false;
|
|
10918
|
+
break;
|
|
10919
|
+
case 60 /* lessThan */:
|
|
10920
|
+
const groupNameStart = pos;
|
|
10921
|
+
pos++;
|
|
10922
|
+
switch (text2.charCodeAt(pos)) {
|
|
10923
|
+
case 61 /* equals */:
|
|
10924
|
+
case 33 /* exclamation */:
|
|
10925
|
+
pos++;
|
|
10926
|
+
isPreviousTermQuantifiable = false;
|
|
10927
|
+
break;
|
|
10928
|
+
default:
|
|
10929
|
+
scanGroupName(
|
|
10930
|
+
/*isReference*/
|
|
10931
|
+
false
|
|
10932
|
+
);
|
|
10933
|
+
scanExpectedChar(62 /* greaterThan */);
|
|
10934
|
+
if (languageVersion < 5 /* ES2018 */) {
|
|
10935
|
+
error2(Diagnostics.Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later, groupNameStart, pos - groupNameStart);
|
|
10936
|
+
}
|
|
10937
|
+
numberOfCapturingGroups++;
|
|
10938
|
+
isPreviousTermQuantifiable = true;
|
|
10939
|
+
break;
|
|
10940
|
+
}
|
|
10941
|
+
break;
|
|
10942
|
+
default:
|
|
10943
|
+
const start3 = pos;
|
|
10944
|
+
const setFlags = scanPatternModifiers();
|
|
10945
|
+
if (text2.charCodeAt(pos) === 45 /* minus */) {
|
|
10946
|
+
pos++;
|
|
10947
|
+
scanPatternModifiers(setFlags);
|
|
10948
|
+
if (pos === start3 + 1) {
|
|
10949
|
+
error2(Diagnostics.Subpattern_flags_must_be_present_when_there_is_a_minus_sign, start3, pos - start3);
|
|
10950
|
+
}
|
|
10951
|
+
}
|
|
10952
|
+
scanExpectedChar(58 /* colon */);
|
|
10953
|
+
isPreviousTermQuantifiable = true;
|
|
10954
|
+
break;
|
|
10955
|
+
}
|
|
10956
|
+
} else {
|
|
10957
|
+
numberOfCapturingGroups++;
|
|
10958
|
+
isPreviousTermQuantifiable = true;
|
|
10959
|
+
}
|
|
10960
|
+
scanDisjunction(
|
|
10961
|
+
/*isInGroup*/
|
|
10962
|
+
true
|
|
10963
|
+
);
|
|
10964
|
+
scanExpectedChar(41 /* closeParen */);
|
|
10965
|
+
break;
|
|
10966
|
+
case 123 /* openBrace */:
|
|
10967
|
+
pos++;
|
|
10968
|
+
const digitsStart = pos;
|
|
10969
|
+
scanDigits();
|
|
10970
|
+
const min2 = tokenValue;
|
|
10971
|
+
if (text2.charCodeAt(pos) === 44 /* comma */) {
|
|
10972
|
+
pos++;
|
|
10973
|
+
scanDigits();
|
|
10974
|
+
const max = tokenValue;
|
|
10975
|
+
if (!min2) {
|
|
10976
|
+
if (max || text2.charCodeAt(pos) === 125 /* closeBrace */) {
|
|
10977
|
+
error2(Diagnostics.Incomplete_quantifier_Digit_expected, digitsStart, 0);
|
|
10978
|
+
} else {
|
|
10979
|
+
if (unicodeMode) {
|
|
10980
|
+
error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, start2, 1, String.fromCharCode(ch));
|
|
10981
|
+
}
|
|
10982
|
+
isPreviousTermQuantifiable = true;
|
|
10983
|
+
break;
|
|
10984
|
+
}
|
|
10985
|
+
}
|
|
10986
|
+
if (max && Number.parseInt(min2) > Number.parseInt(max)) {
|
|
10987
|
+
error2(Diagnostics.Numbers_out_of_order_in_quantifier, digitsStart, pos - digitsStart);
|
|
10988
|
+
}
|
|
10989
|
+
} else if (!min2) {
|
|
10990
|
+
if (unicodeMode) {
|
|
10991
|
+
error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, start2, 1, String.fromCharCode(ch));
|
|
10992
|
+
}
|
|
10993
|
+
isPreviousTermQuantifiable = true;
|
|
10994
|
+
break;
|
|
10995
|
+
}
|
|
10996
|
+
scanExpectedChar(125 /* closeBrace */);
|
|
10997
|
+
pos--;
|
|
10998
|
+
case 42 /* asterisk */:
|
|
10999
|
+
case 43 /* plus */:
|
|
11000
|
+
case 63 /* question */:
|
|
11001
|
+
pos++;
|
|
11002
|
+
if (text2.charCodeAt(pos) === 63 /* question */) {
|
|
11003
|
+
pos++;
|
|
11004
|
+
}
|
|
11005
|
+
if (!isPreviousTermQuantifiable) {
|
|
11006
|
+
error2(Diagnostics.There_is_nothing_available_for_repetition, start2, pos - start2);
|
|
11007
|
+
}
|
|
11008
|
+
isPreviousTermQuantifiable = false;
|
|
11009
|
+
break;
|
|
11010
|
+
case 46 /* dot */:
|
|
11011
|
+
pos++;
|
|
11012
|
+
isPreviousTermQuantifiable = true;
|
|
11013
|
+
break;
|
|
11014
|
+
case 91 /* openBracket */:
|
|
11015
|
+
pos++;
|
|
11016
|
+
if (unicodeSetsMode) {
|
|
11017
|
+
scanClassSetExpression();
|
|
11018
|
+
} else {
|
|
11019
|
+
scanClassRanges();
|
|
11020
|
+
}
|
|
11021
|
+
scanExpectedChar(93 /* closeBracket */);
|
|
11022
|
+
isPreviousTermQuantifiable = true;
|
|
11023
|
+
break;
|
|
11024
|
+
case 41 /* closeParen */:
|
|
11025
|
+
if (isInGroup) {
|
|
11026
|
+
return;
|
|
11027
|
+
}
|
|
11028
|
+
case 93 /* closeBracket */:
|
|
11029
|
+
case 125 /* closeBrace */:
|
|
11030
|
+
if (isUnterminated && !isInGroup) {
|
|
11031
|
+
return;
|
|
11032
|
+
}
|
|
11033
|
+
if (unicodeMode) {
|
|
11034
|
+
error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
|
|
11035
|
+
}
|
|
11036
|
+
pos++;
|
|
11037
|
+
isPreviousTermQuantifiable = true;
|
|
11038
|
+
break;
|
|
11039
|
+
case 47 /* slash */:
|
|
11040
|
+
case 124 /* bar */:
|
|
11041
|
+
return;
|
|
11042
|
+
default:
|
|
11043
|
+
scanSourceCharacter();
|
|
11044
|
+
isPreviousTermQuantifiable = true;
|
|
11045
|
+
break;
|
|
11046
|
+
}
|
|
11047
|
+
}
|
|
11048
|
+
}
|
|
11049
|
+
function scanPatternModifiers(currFlags = 0 /* None */) {
|
|
11050
|
+
while (pos < end2) {
|
|
11051
|
+
const ch = text2.charCodeAt(pos);
|
|
11052
|
+
if (!isIdentifierPart(ch, languageVersion)) {
|
|
11053
|
+
break;
|
|
11054
|
+
}
|
|
11055
|
+
const flag = characterToRegularExpressionFlag(String.fromCharCode(ch));
|
|
11056
|
+
if (flag === void 0) {
|
|
11057
|
+
error2(Diagnostics.Unknown_regular_expression_flag, pos, 1);
|
|
11058
|
+
} else if (currFlags & flag) {
|
|
11059
|
+
error2(Diagnostics.Duplicate_regular_expression_flag, pos, 1);
|
|
11060
|
+
} else if (!(flag & 28 /* Modifiers */)) {
|
|
11061
|
+
error2(Diagnostics.This_regular_expression_flag_cannot_be_toggled_within_a_subpattern, pos, 1);
|
|
11062
|
+
} else {
|
|
11063
|
+
currFlags |= flag;
|
|
11064
|
+
const availableFrom = regularExpressionFlagToFirstAvailableLanguageVersion(flag);
|
|
11065
|
+
if (languageVersion < availableFrom) {
|
|
11066
|
+
error2(Diagnostics.This_regular_expression_flag_is_only_available_when_targeting_0_or_later, pos, 1, ScriptTarget[availableFrom]);
|
|
11067
|
+
}
|
|
11068
|
+
}
|
|
11069
|
+
pos++;
|
|
11070
|
+
}
|
|
11071
|
+
return currFlags;
|
|
11072
|
+
}
|
|
11073
|
+
function scanAtomEscape() {
|
|
11074
|
+
Debug.assertEqual(text2.charCodeAt(pos - 1), 92 /* backslash */);
|
|
11075
|
+
switch (text2.charCodeAt(pos)) {
|
|
11076
|
+
case 107 /* k */:
|
|
11077
|
+
pos++;
|
|
11078
|
+
if (text2.charCodeAt(pos) === 60 /* lessThan */) {
|
|
11079
|
+
pos++;
|
|
11080
|
+
scanGroupName(
|
|
11081
|
+
/*isReference*/
|
|
11082
|
+
true
|
|
11083
|
+
);
|
|
11084
|
+
scanExpectedChar(62 /* greaterThan */);
|
|
11085
|
+
} else if (unicodeMode) {
|
|
11086
|
+
error2(Diagnostics.k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets, pos - 2, 2);
|
|
11087
|
+
}
|
|
11088
|
+
break;
|
|
11089
|
+
case 113 /* q */:
|
|
11090
|
+
if (unicodeSetsMode) {
|
|
11091
|
+
pos++;
|
|
11092
|
+
error2(Diagnostics.q_is_only_available_inside_character_class, pos - 2, 2);
|
|
11093
|
+
break;
|
|
11094
|
+
}
|
|
11095
|
+
default:
|
|
11096
|
+
scanCharacterClassEscape() || scanDecimalEscape() || scanCharacterEscape();
|
|
11097
|
+
break;
|
|
11098
|
+
}
|
|
11099
|
+
}
|
|
11100
|
+
function scanDecimalEscape() {
|
|
11101
|
+
Debug.assertEqual(text2.charCodeAt(pos - 1), 92 /* backslash */);
|
|
11102
|
+
const ch = text2.charCodeAt(pos);
|
|
11103
|
+
if (ch >= 49 /* _1 */ && ch <= 57 /* _9 */) {
|
|
11104
|
+
const start2 = pos;
|
|
11105
|
+
scanDigits();
|
|
11106
|
+
decimalEscapes.push({ pos: start2, end: pos, value: +tokenValue });
|
|
11107
|
+
return true;
|
|
11108
|
+
}
|
|
11109
|
+
return false;
|
|
11110
|
+
}
|
|
11111
|
+
function scanCharacterEscape() {
|
|
11112
|
+
Debug.assertEqual(text2.charCodeAt(pos - 1), 92 /* backslash */);
|
|
11113
|
+
let ch = text2.charCodeAt(pos);
|
|
11114
|
+
switch (ch) {
|
|
11115
|
+
case 99 /* c */:
|
|
11116
|
+
pos++;
|
|
11117
|
+
ch = text2.charCodeAt(pos);
|
|
11118
|
+
if (isASCIILetter(ch)) {
|
|
11119
|
+
pos++;
|
|
11120
|
+
return String.fromCharCode(ch & 31);
|
|
11121
|
+
}
|
|
11122
|
+
if (unicodeMode) {
|
|
11123
|
+
error2(Diagnostics.c_must_be_followed_by_an_ASCII_letter, pos - 2, 2);
|
|
11124
|
+
}
|
|
11125
|
+
return String.fromCharCode(ch);
|
|
11126
|
+
case 94 /* caret */:
|
|
11127
|
+
case 36 /* $ */:
|
|
11128
|
+
case 47 /* slash */:
|
|
11129
|
+
case 92 /* backslash */:
|
|
11130
|
+
case 46 /* dot */:
|
|
11131
|
+
case 42 /* asterisk */:
|
|
11132
|
+
case 43 /* plus */:
|
|
11133
|
+
case 63 /* question */:
|
|
11134
|
+
case 40 /* openParen */:
|
|
11135
|
+
case 41 /* closeParen */:
|
|
11136
|
+
case 91 /* openBracket */:
|
|
11137
|
+
case 93 /* closeBracket */:
|
|
11138
|
+
case 123 /* openBrace */:
|
|
11139
|
+
case 125 /* closeBrace */:
|
|
11140
|
+
case 124 /* bar */:
|
|
11141
|
+
pos++;
|
|
11142
|
+
return String.fromCharCode(ch);
|
|
11143
|
+
default:
|
|
11144
|
+
if (pos >= end2) {
|
|
11145
|
+
error2(Diagnostics.Undetermined_character_escape, pos - 1, 1, ch);
|
|
11146
|
+
return "\\";
|
|
11147
|
+
}
|
|
11148
|
+
pos--;
|
|
11149
|
+
return scanEscapeSequence(
|
|
11150
|
+
/*shouldEmitInvalidEscapeError*/
|
|
11151
|
+
unicodeMode,
|
|
11152
|
+
/*isRegularExpression*/
|
|
11153
|
+
true
|
|
11154
|
+
);
|
|
11155
|
+
}
|
|
11156
|
+
}
|
|
11157
|
+
function scanGroupName(isReference) {
|
|
11158
|
+
Debug.assertEqual(text2.charCodeAt(pos - 1), 60 /* lessThan */);
|
|
11159
|
+
tokenStart = pos;
|
|
11160
|
+
scanIdentifier(codePointAt(text2, pos), languageVersion);
|
|
11161
|
+
if (pos === tokenStart) {
|
|
11162
|
+
error2(Diagnostics.Expected_a_capturing_group_name);
|
|
11163
|
+
} else if (isReference) {
|
|
11164
|
+
groupNameReferences.push({ pos: tokenStart, end: pos, name: tokenValue });
|
|
11165
|
+
} else if (namedCapturingGroups.some((group2) => group2.has(tokenValue))) {
|
|
11166
|
+
error2(Diagnostics.Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other, tokenStart, pos - tokenStart);
|
|
11167
|
+
} else {
|
|
11168
|
+
last(namedCapturingGroups).add(tokenValue);
|
|
11169
|
+
groupSpecifiers.add(tokenValue);
|
|
11170
|
+
}
|
|
11171
|
+
}
|
|
11172
|
+
function isClassContentExit(ch) {
|
|
11173
|
+
return ch === 93 /* closeBracket */ || pos >= end2;
|
|
11174
|
+
}
|
|
11175
|
+
function scanClassRanges() {
|
|
11176
|
+
Debug.assertEqual(text2.charCodeAt(pos - 1), 91 /* openBracket */);
|
|
11177
|
+
if (text2.charCodeAt(pos) === 94 /* caret */) {
|
|
11178
|
+
pos++;
|
|
11179
|
+
}
|
|
11180
|
+
while (pos < end2) {
|
|
11181
|
+
const ch = text2.charCodeAt(pos);
|
|
11182
|
+
if (isClassContentExit(ch)) {
|
|
11183
|
+
return;
|
|
11184
|
+
}
|
|
11185
|
+
const minStart = pos;
|
|
11186
|
+
const minCharacter = scanClassAtom();
|
|
11187
|
+
if (text2.charCodeAt(pos) === 45 /* minus */) {
|
|
11188
|
+
pos++;
|
|
11189
|
+
const ch2 = text2.charCodeAt(pos);
|
|
11190
|
+
if (isClassContentExit(ch2)) {
|
|
11191
|
+
return;
|
|
11192
|
+
}
|
|
11193
|
+
if (!minCharacter) {
|
|
11194
|
+
error2(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, minStart, pos - 1 - minStart);
|
|
11195
|
+
}
|
|
11196
|
+
const maxStart = pos;
|
|
11197
|
+
const maxCharacter = scanClassAtom();
|
|
11198
|
+
if (!maxCharacter) {
|
|
11199
|
+
error2(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, maxStart, pos - maxStart);
|
|
11200
|
+
continue;
|
|
11201
|
+
}
|
|
11202
|
+
if (!minCharacter) {
|
|
11203
|
+
continue;
|
|
11204
|
+
}
|
|
11205
|
+
const minCharacterValue = codePointAt(minCharacter, 0);
|
|
11206
|
+
const maxCharacterValue = codePointAt(maxCharacter, 0);
|
|
11207
|
+
if (minCharacter.length === charSize(minCharacterValue) && maxCharacter.length === charSize(maxCharacterValue) && minCharacterValue > maxCharacterValue) {
|
|
11208
|
+
error2(Diagnostics.Range_out_of_order_in_character_class, minStart, pos - minStart);
|
|
11209
|
+
}
|
|
11210
|
+
}
|
|
11211
|
+
}
|
|
11212
|
+
}
|
|
11213
|
+
function scanClassSetExpression() {
|
|
11214
|
+
Debug.assertEqual(text2.charCodeAt(pos - 1), 91 /* openBracket */);
|
|
11215
|
+
let isCharacterComplement = false;
|
|
11216
|
+
if (text2.charCodeAt(pos) === 94 /* caret */) {
|
|
11217
|
+
pos++;
|
|
11218
|
+
isCharacterComplement = true;
|
|
11219
|
+
}
|
|
11220
|
+
let expressionMayContainStrings = false;
|
|
11221
|
+
let ch = text2.charCodeAt(pos);
|
|
11222
|
+
if (isClassContentExit(ch)) {
|
|
11223
|
+
return;
|
|
11224
|
+
}
|
|
11225
|
+
let start2 = pos;
|
|
11226
|
+
let oprand;
|
|
11227
|
+
switch (text2.slice(pos, pos + 2)) {
|
|
11228
|
+
case "--":
|
|
11229
|
+
case "&&":
|
|
11230
|
+
error2(Diagnostics.Expected_a_class_set_oprand);
|
|
11231
|
+
mayContainStrings = false;
|
|
11232
|
+
break;
|
|
11233
|
+
default:
|
|
11234
|
+
oprand = scanClassSetOprand();
|
|
11235
|
+
break;
|
|
11236
|
+
}
|
|
11237
|
+
switch (text2.charCodeAt(pos)) {
|
|
11238
|
+
case 45 /* minus */:
|
|
11239
|
+
if (text2.charCodeAt(pos + 1) === 45 /* minus */) {
|
|
11240
|
+
if (isCharacterComplement && mayContainStrings) {
|
|
11241
|
+
error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start2, pos - start2);
|
|
11242
|
+
}
|
|
11243
|
+
expressionMayContainStrings = mayContainStrings;
|
|
11244
|
+
scanClassSetSubExpression(3 /* ClassSubtraction */);
|
|
11245
|
+
mayContainStrings = !isCharacterComplement && expressionMayContainStrings;
|
|
11246
|
+
return;
|
|
11247
|
+
}
|
|
11248
|
+
break;
|
|
11249
|
+
case 38 /* ampersand */:
|
|
11250
|
+
if (text2.charCodeAt(pos + 1) === 38 /* ampersand */) {
|
|
11251
|
+
scanClassSetSubExpression(2 /* ClassIntersection */);
|
|
11252
|
+
if (isCharacterComplement && mayContainStrings) {
|
|
11253
|
+
error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start2, pos - start2);
|
|
11254
|
+
}
|
|
11255
|
+
expressionMayContainStrings = mayContainStrings;
|
|
11256
|
+
mayContainStrings = !isCharacterComplement && expressionMayContainStrings;
|
|
11257
|
+
return;
|
|
11258
|
+
} else {
|
|
11259
|
+
error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
|
|
11260
|
+
}
|
|
11261
|
+
break;
|
|
11262
|
+
default:
|
|
11263
|
+
if (isCharacterComplement && mayContainStrings) {
|
|
11264
|
+
error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start2, pos - start2);
|
|
11265
|
+
}
|
|
11266
|
+
expressionMayContainStrings = mayContainStrings;
|
|
11267
|
+
break;
|
|
11268
|
+
}
|
|
11269
|
+
while (pos < end2) {
|
|
11270
|
+
ch = text2.charCodeAt(pos);
|
|
11271
|
+
switch (ch) {
|
|
11272
|
+
case 45 /* minus */:
|
|
11273
|
+
pos++;
|
|
11274
|
+
ch = text2.charCodeAt(pos);
|
|
11275
|
+
if (isClassContentExit(ch)) {
|
|
11276
|
+
mayContainStrings = !isCharacterComplement && expressionMayContainStrings;
|
|
11277
|
+
return;
|
|
11278
|
+
}
|
|
11279
|
+
if (ch === 45 /* minus */) {
|
|
11280
|
+
pos++;
|
|
11281
|
+
error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2);
|
|
11282
|
+
start2 = pos - 2;
|
|
11283
|
+
oprand = text2.slice(start2, pos);
|
|
11284
|
+
continue;
|
|
11285
|
+
} else {
|
|
11286
|
+
if (!oprand) {
|
|
11287
|
+
error2(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, start2, pos - 1 - start2);
|
|
11288
|
+
}
|
|
11289
|
+
const secondStart = pos;
|
|
11290
|
+
const secondOprand = scanClassSetOprand();
|
|
11291
|
+
if (isCharacterComplement && mayContainStrings) {
|
|
11292
|
+
error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, secondStart, pos - secondStart);
|
|
11293
|
+
}
|
|
11294
|
+
expressionMayContainStrings || (expressionMayContainStrings = mayContainStrings);
|
|
11295
|
+
if (!secondOprand) {
|
|
11296
|
+
error2(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, secondStart, pos - secondStart);
|
|
11297
|
+
break;
|
|
11298
|
+
}
|
|
11299
|
+
if (!oprand) {
|
|
11300
|
+
break;
|
|
11301
|
+
}
|
|
11302
|
+
const minCharacterValue = codePointAt(oprand, 0);
|
|
11303
|
+
const maxCharacterValue = codePointAt(secondOprand, 0);
|
|
11304
|
+
if (oprand.length === charSize(minCharacterValue) && secondOprand.length === charSize(maxCharacterValue) && minCharacterValue > maxCharacterValue) {
|
|
11305
|
+
error2(Diagnostics.Range_out_of_order_in_character_class, start2, pos - start2);
|
|
11306
|
+
}
|
|
11307
|
+
}
|
|
11308
|
+
break;
|
|
11309
|
+
case 38 /* ampersand */:
|
|
11310
|
+
start2 = pos;
|
|
11311
|
+
pos++;
|
|
11312
|
+
if (text2.charCodeAt(pos) === 38 /* ampersand */) {
|
|
11313
|
+
pos++;
|
|
11314
|
+
error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2);
|
|
11315
|
+
if (text2.charCodeAt(pos) === 38 /* ampersand */) {
|
|
11316
|
+
error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
|
|
11317
|
+
pos++;
|
|
11318
|
+
}
|
|
11319
|
+
} else {
|
|
11320
|
+
error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos - 1, 1, String.fromCharCode(ch));
|
|
11321
|
+
}
|
|
11322
|
+
oprand = text2.slice(start2, pos);
|
|
11323
|
+
continue;
|
|
11324
|
+
}
|
|
11325
|
+
if (isClassContentExit(text2.charCodeAt(pos))) {
|
|
11326
|
+
break;
|
|
11327
|
+
}
|
|
11328
|
+
start2 = pos;
|
|
11329
|
+
switch (text2.slice(pos, pos + 2)) {
|
|
11330
|
+
case "--":
|
|
11331
|
+
case "&&":
|
|
11332
|
+
error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos, 2);
|
|
11333
|
+
pos += 2;
|
|
11334
|
+
oprand = text2.slice(start2, pos);
|
|
11335
|
+
break;
|
|
11336
|
+
default:
|
|
11337
|
+
oprand = scanClassSetOprand();
|
|
11338
|
+
break;
|
|
11339
|
+
}
|
|
11340
|
+
}
|
|
11341
|
+
mayContainStrings = !isCharacterComplement && expressionMayContainStrings;
|
|
11342
|
+
}
|
|
11343
|
+
function scanClassSetSubExpression(expressionType) {
|
|
11344
|
+
let expressionMayContainStrings = mayContainStrings;
|
|
11345
|
+
while (pos < end2) {
|
|
11346
|
+
let ch = text2.charCodeAt(pos);
|
|
11347
|
+
if (isClassContentExit(ch)) {
|
|
11348
|
+
break;
|
|
11349
|
+
}
|
|
11350
|
+
switch (ch) {
|
|
11351
|
+
case 45 /* minus */:
|
|
11352
|
+
pos++;
|
|
11353
|
+
if (text2.charCodeAt(pos) === 45 /* minus */) {
|
|
11354
|
+
pos++;
|
|
11355
|
+
if (expressionType !== 3 /* ClassSubtraction */) {
|
|
11356
|
+
error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2);
|
|
11357
|
+
}
|
|
11358
|
+
} else {
|
|
11359
|
+
error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 1, 1);
|
|
11360
|
+
}
|
|
11361
|
+
break;
|
|
11362
|
+
case 38 /* ampersand */:
|
|
11363
|
+
pos++;
|
|
11364
|
+
if (text2.charCodeAt(pos) === 38 /* ampersand */) {
|
|
11365
|
+
pos++;
|
|
11366
|
+
if (expressionType !== 2 /* ClassIntersection */) {
|
|
11367
|
+
error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2);
|
|
11368
|
+
}
|
|
11369
|
+
if (text2.charCodeAt(pos) === 38 /* ampersand */) {
|
|
11370
|
+
error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
|
|
11371
|
+
pos++;
|
|
11372
|
+
}
|
|
11373
|
+
} else {
|
|
11374
|
+
error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos - 1, 1, String.fromCharCode(ch));
|
|
11375
|
+
}
|
|
11376
|
+
break;
|
|
11377
|
+
default:
|
|
11378
|
+
switch (expressionType) {
|
|
11379
|
+
case 3 /* ClassSubtraction */:
|
|
11380
|
+
error2(Diagnostics._0_expected, pos, 0, "--");
|
|
11381
|
+
break;
|
|
11382
|
+
case 2 /* ClassIntersection */:
|
|
11383
|
+
error2(Diagnostics._0_expected, pos, 0, "&&");
|
|
11384
|
+
break;
|
|
11385
|
+
default:
|
|
11386
|
+
break;
|
|
11387
|
+
}
|
|
11388
|
+
break;
|
|
11389
|
+
}
|
|
11390
|
+
ch = text2.charCodeAt(pos);
|
|
11391
|
+
if (isClassContentExit(ch)) {
|
|
11392
|
+
error2(Diagnostics.Expected_a_class_set_oprand);
|
|
11393
|
+
break;
|
|
11394
|
+
}
|
|
11395
|
+
scanClassSetOprand();
|
|
11396
|
+
expressionMayContainStrings && (expressionMayContainStrings = mayContainStrings);
|
|
11397
|
+
}
|
|
11398
|
+
mayContainStrings = expressionMayContainStrings;
|
|
11399
|
+
}
|
|
11400
|
+
function scanClassSetOprand() {
|
|
11401
|
+
mayContainStrings = false;
|
|
11402
|
+
switch (text2.charCodeAt(pos)) {
|
|
11403
|
+
case 91 /* openBracket */:
|
|
11404
|
+
pos++;
|
|
11405
|
+
scanClassSetExpression();
|
|
11406
|
+
scanExpectedChar(93 /* closeBracket */);
|
|
11407
|
+
return "";
|
|
11408
|
+
case 92 /* backslash */:
|
|
11409
|
+
pos++;
|
|
11410
|
+
if (scanCharacterClassEscape()) {
|
|
11411
|
+
return "";
|
|
11412
|
+
} else if (text2.charCodeAt(pos) === 113 /* q */) {
|
|
11413
|
+
pos++;
|
|
11414
|
+
if (text2.charCodeAt(pos) === 123 /* openBrace */) {
|
|
11415
|
+
pos++;
|
|
11416
|
+
scanClassStringDisjunctionContents();
|
|
11417
|
+
scanExpectedChar(125 /* closeBrace */);
|
|
11418
|
+
return "";
|
|
11419
|
+
} else {
|
|
11420
|
+
error2(Diagnostics.q_must_be_followed_by_string_alternatives_enclosed_in_braces, pos - 2, 2);
|
|
11421
|
+
return "q";
|
|
11422
|
+
}
|
|
11423
|
+
}
|
|
11424
|
+
pos--;
|
|
11425
|
+
default:
|
|
11426
|
+
return scanClassSetCharacter();
|
|
11427
|
+
}
|
|
11428
|
+
}
|
|
11429
|
+
function scanClassStringDisjunctionContents() {
|
|
11430
|
+
Debug.assertEqual(text2.charCodeAt(pos - 1), 123 /* openBrace */);
|
|
11431
|
+
let characterCount = 0;
|
|
11432
|
+
while (pos < end2) {
|
|
11433
|
+
const ch = text2.charCodeAt(pos);
|
|
11434
|
+
switch (ch) {
|
|
11435
|
+
case 125 /* closeBrace */:
|
|
11436
|
+
if (characterCount !== 1) {
|
|
11437
|
+
mayContainStrings = true;
|
|
11438
|
+
}
|
|
11439
|
+
return;
|
|
11440
|
+
case 124 /* bar */:
|
|
11441
|
+
if (characterCount !== 1) {
|
|
11442
|
+
mayContainStrings = true;
|
|
11443
|
+
}
|
|
11444
|
+
pos++;
|
|
11445
|
+
start = pos;
|
|
11446
|
+
characterCount = 0;
|
|
11447
|
+
break;
|
|
11448
|
+
default:
|
|
11449
|
+
scanClassSetCharacter();
|
|
11450
|
+
characterCount++;
|
|
11451
|
+
break;
|
|
11452
|
+
}
|
|
11453
|
+
}
|
|
11454
|
+
}
|
|
11455
|
+
function scanClassSetCharacter() {
|
|
11456
|
+
const ch = text2.charCodeAt(pos);
|
|
11457
|
+
if (ch === 92 /* backslash */) {
|
|
11458
|
+
pos++;
|
|
11459
|
+
const ch2 = text2.charCodeAt(pos);
|
|
11460
|
+
switch (ch2) {
|
|
11461
|
+
case 98 /* b */:
|
|
11462
|
+
pos++;
|
|
11463
|
+
return "\b";
|
|
11464
|
+
case 38 /* ampersand */:
|
|
11465
|
+
case 45 /* minus */:
|
|
11466
|
+
case 33 /* exclamation */:
|
|
11467
|
+
case 35 /* hash */:
|
|
11468
|
+
case 37 /* percent */:
|
|
11469
|
+
case 44 /* comma */:
|
|
11470
|
+
case 58 /* colon */:
|
|
11471
|
+
case 59 /* semicolon */:
|
|
11472
|
+
case 60 /* lessThan */:
|
|
11473
|
+
case 61 /* equals */:
|
|
11474
|
+
case 62 /* greaterThan */:
|
|
11475
|
+
case 64 /* at */:
|
|
11476
|
+
case 96 /* backtick */:
|
|
11477
|
+
case 126 /* tilde */:
|
|
11478
|
+
pos++;
|
|
11479
|
+
return String.fromCharCode(ch2);
|
|
11480
|
+
default:
|
|
11481
|
+
return scanCharacterEscape();
|
|
11482
|
+
}
|
|
11483
|
+
} else if (ch === text2.charCodeAt(pos + 1)) {
|
|
11484
|
+
switch (ch) {
|
|
11485
|
+
case 38 /* ampersand */:
|
|
11486
|
+
case 33 /* exclamation */:
|
|
11487
|
+
case 35 /* hash */:
|
|
11488
|
+
case 37 /* percent */:
|
|
11489
|
+
case 42 /* asterisk */:
|
|
11490
|
+
case 43 /* plus */:
|
|
11491
|
+
case 44 /* comma */:
|
|
11492
|
+
case 46 /* dot */:
|
|
11493
|
+
case 58 /* colon */:
|
|
11494
|
+
case 59 /* semicolon */:
|
|
11495
|
+
case 60 /* lessThan */:
|
|
11496
|
+
case 61 /* equals */:
|
|
11497
|
+
case 62 /* greaterThan */:
|
|
11498
|
+
case 63 /* question */:
|
|
11499
|
+
case 64 /* at */:
|
|
11500
|
+
case 96 /* backtick */:
|
|
11501
|
+
case 126 /* tilde */:
|
|
11502
|
+
error2(Diagnostics.A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backslash, pos, 2);
|
|
11503
|
+
pos += 2;
|
|
11504
|
+
return text2.substring(pos - 2, pos);
|
|
11505
|
+
}
|
|
11506
|
+
}
|
|
11507
|
+
switch (ch) {
|
|
11508
|
+
case 47 /* slash */:
|
|
11509
|
+
case 40 /* openParen */:
|
|
11510
|
+
case 41 /* closeParen */:
|
|
11511
|
+
case 91 /* openBracket */:
|
|
11512
|
+
case 93 /* closeBracket */:
|
|
11513
|
+
case 123 /* openBrace */:
|
|
11514
|
+
case 125 /* closeBrace */:
|
|
11515
|
+
case 45 /* minus */:
|
|
11516
|
+
case 124 /* bar */:
|
|
11517
|
+
error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
|
|
11518
|
+
pos++;
|
|
11519
|
+
return String.fromCharCode(ch);
|
|
11520
|
+
}
|
|
11521
|
+
return scanSourceCharacter();
|
|
11522
|
+
}
|
|
11523
|
+
function scanClassAtom() {
|
|
11524
|
+
if (text2.charCodeAt(pos) === 92 /* backslash */) {
|
|
11525
|
+
pos++;
|
|
11526
|
+
const ch = text2.charCodeAt(pos);
|
|
11527
|
+
switch (ch) {
|
|
11528
|
+
case 98 /* b */:
|
|
11529
|
+
pos++;
|
|
11530
|
+
return "\b";
|
|
11531
|
+
case 45 /* minus */:
|
|
11532
|
+
pos++;
|
|
11533
|
+
return String.fromCharCode(ch);
|
|
11534
|
+
default:
|
|
11535
|
+
if (scanCharacterClassEscape()) {
|
|
11536
|
+
return "";
|
|
11537
|
+
}
|
|
11538
|
+
return scanCharacterEscape();
|
|
11539
|
+
}
|
|
11540
|
+
} else {
|
|
11541
|
+
return scanSourceCharacter();
|
|
11542
|
+
}
|
|
11543
|
+
}
|
|
11544
|
+
function scanCharacterClassEscape() {
|
|
11545
|
+
Debug.assertEqual(text2.charCodeAt(pos - 1), 92 /* backslash */);
|
|
11546
|
+
let isCharacterComplement = false;
|
|
11547
|
+
const start2 = pos - 1;
|
|
11548
|
+
const ch = text2.charCodeAt(pos);
|
|
11549
|
+
switch (ch) {
|
|
11550
|
+
case 100 /* d */:
|
|
11551
|
+
case 68 /* D */:
|
|
11552
|
+
case 115 /* s */:
|
|
11553
|
+
case 83 /* S */:
|
|
11554
|
+
case 119 /* w */:
|
|
11555
|
+
case 87 /* W */:
|
|
11556
|
+
pos++;
|
|
11557
|
+
return true;
|
|
11558
|
+
case 80 /* P */:
|
|
11559
|
+
isCharacterComplement = true;
|
|
11560
|
+
case 112 /* p */:
|
|
11561
|
+
pos++;
|
|
11562
|
+
if (text2.charCodeAt(pos) === 123 /* openBrace */) {
|
|
11563
|
+
pos++;
|
|
11564
|
+
const propertyNameOrValueStart = pos;
|
|
11565
|
+
const propertyNameOrValue = scanWordCharacters();
|
|
11566
|
+
if (text2.charCodeAt(pos) === 61 /* equals */) {
|
|
11567
|
+
const propertyName = nonBinaryUnicodeProperties.get(propertyNameOrValue);
|
|
11568
|
+
if (pos === propertyNameOrValueStart) {
|
|
11569
|
+
error2(Diagnostics.Expected_a_Unicode_property_name);
|
|
11570
|
+
} else if (propertyName === void 0) {
|
|
11571
|
+
error2(Diagnostics.Unknown_Unicode_property_name, propertyNameOrValueStart, pos - propertyNameOrValueStart);
|
|
11572
|
+
const suggestion = getSpellingSuggestion(propertyNameOrValue, nonBinaryUnicodeProperties.keys(), identity);
|
|
11573
|
+
if (suggestion) {
|
|
11574
|
+
error2(Diagnostics.Did_you_mean_0, propertyNameOrValueStart, pos - propertyNameOrValueStart, suggestion);
|
|
11575
|
+
}
|
|
11576
|
+
}
|
|
11577
|
+
pos++;
|
|
11578
|
+
const propertyValueStart = pos;
|
|
11579
|
+
const propertyValue = scanWordCharacters();
|
|
11580
|
+
if (pos === propertyValueStart) {
|
|
11581
|
+
error2(Diagnostics.Expected_a_Unicode_property_value);
|
|
11582
|
+
} else if (propertyName !== void 0 && !valuesOfNonBinaryUnicodeProperties[propertyName].has(propertyValue)) {
|
|
11583
|
+
error2(Diagnostics.Unknown_Unicode_property_value, propertyValueStart, pos - propertyValueStart);
|
|
11584
|
+
const suggestion = getSpellingSuggestion(propertyValue, valuesOfNonBinaryUnicodeProperties[propertyName], identity);
|
|
11585
|
+
if (suggestion) {
|
|
11586
|
+
error2(Diagnostics.Did_you_mean_0, propertyValueStart, pos - propertyValueStart, suggestion);
|
|
11587
|
+
}
|
|
11588
|
+
}
|
|
11589
|
+
} else {
|
|
11590
|
+
if (pos === propertyNameOrValueStart) {
|
|
11591
|
+
error2(Diagnostics.Expected_a_Unicode_property_name_or_value);
|
|
11592
|
+
} else if (binaryUnicodePropertiesOfStrings.has(propertyNameOrValue)) {
|
|
11593
|
+
if (!unicodeSetsMode) {
|
|
11594
|
+
error2(Diagnostics.Any_Unicode_property_that_would_possibly_match_more_than_a_single_character_is_only_available_when_the_Unicode_Sets_v_flag_is_set, propertyNameOrValueStart, pos - propertyNameOrValueStart);
|
|
11595
|
+
} else if (isCharacterComplement) {
|
|
11596
|
+
error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, propertyNameOrValueStart, pos - propertyNameOrValueStart);
|
|
11597
|
+
} else {
|
|
11598
|
+
mayContainStrings = true;
|
|
11599
|
+
}
|
|
11600
|
+
} else if (!valuesOfNonBinaryUnicodeProperties.General_Category.has(propertyNameOrValue) && !binaryUnicodeProperties.has(propertyNameOrValue)) {
|
|
11601
|
+
error2(Diagnostics.Unknown_Unicode_property_name_or_value, propertyNameOrValueStart, pos - propertyNameOrValueStart);
|
|
11602
|
+
const suggestion = getSpellingSuggestion(propertyNameOrValue, [...valuesOfNonBinaryUnicodeProperties.General_Category, ...binaryUnicodeProperties, ...binaryUnicodePropertiesOfStrings], identity);
|
|
11603
|
+
if (suggestion) {
|
|
11604
|
+
error2(Diagnostics.Did_you_mean_0, propertyNameOrValueStart, pos - propertyNameOrValueStart, suggestion);
|
|
11605
|
+
}
|
|
11606
|
+
}
|
|
11607
|
+
}
|
|
11608
|
+
scanExpectedChar(125 /* closeBrace */);
|
|
11609
|
+
if (!unicodeMode) {
|
|
11610
|
+
error2(Diagnostics.Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set, start2, pos - start2);
|
|
11611
|
+
}
|
|
11612
|
+
} else if (unicodeMode) {
|
|
11613
|
+
error2(Diagnostics._0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces, pos - 2, 2, String.fromCharCode(ch));
|
|
11614
|
+
}
|
|
11615
|
+
return true;
|
|
11616
|
+
}
|
|
11617
|
+
return false;
|
|
11618
|
+
}
|
|
11619
|
+
function scanWordCharacters() {
|
|
11620
|
+
let value = "";
|
|
11621
|
+
while (pos < end2) {
|
|
11622
|
+
const ch = text2.charCodeAt(pos);
|
|
11623
|
+
if (!isWordCharacter(ch)) {
|
|
11624
|
+
break;
|
|
11625
|
+
}
|
|
11626
|
+
value += String.fromCharCode(ch);
|
|
11627
|
+
pos++;
|
|
11628
|
+
}
|
|
11629
|
+
return value;
|
|
11630
|
+
}
|
|
11631
|
+
function scanSourceCharacter() {
|
|
11632
|
+
const size = unicodeMode ? charSize(codePointAt(text2, pos)) : 1;
|
|
11633
|
+
pos += size;
|
|
11634
|
+
return text2.substring(pos - size, pos);
|
|
11635
|
+
}
|
|
11636
|
+
function scanExpectedChar(ch) {
|
|
11637
|
+
if (text2.charCodeAt(pos) === ch) {
|
|
11638
|
+
pos++;
|
|
11639
|
+
} else {
|
|
11640
|
+
error2(Diagnostics._0_expected, pos, 0, String.fromCharCode(ch));
|
|
11641
|
+
}
|
|
11642
|
+
}
|
|
11643
|
+
scanDisjunction(
|
|
11644
|
+
/*isInGroup*/
|
|
11645
|
+
false
|
|
11646
|
+
);
|
|
11647
|
+
forEach(groupNameReferences, (reference) => {
|
|
11648
|
+
if (!groupSpecifiers.has(reference.name)) {
|
|
11649
|
+
error2(Diagnostics.There_is_no_capturing_group_named_0_in_this_regular_expression, reference.pos, reference.end - reference.pos, reference.name);
|
|
11650
|
+
}
|
|
11651
|
+
});
|
|
11652
|
+
forEach(decimalEscapes, (escape) => {
|
|
11653
|
+
if (escape.value > numberOfCapturingGroups) {
|
|
11654
|
+
if (numberOfCapturingGroups) {
|
|
11655
|
+
error2(Diagnostics.A_decimal_escape_must_refer_to_an_existent_capturing_group_There_are_only_0_capturing_groups_in_this_regular_expression, escape.pos, escape.end - escape.pos, numberOfCapturingGroups);
|
|
11656
|
+
} else {
|
|
11657
|
+
error2(Diagnostics.Decimal_escapes_are_invalid_when_there_are_no_capturing_groups_in_a_regular_expression, escape.pos, escape.end - escape.pos);
|
|
11658
|
+
}
|
|
11659
|
+
}
|
|
11660
|
+
});
|
|
11661
|
+
}
|
|
10774
11662
|
}
|
|
10775
11663
|
function appendIfCommentDirective(commentDirectives2, text2, commentDirectiveRegEx, lineStart) {
|
|
10776
11664
|
const type = getDirectiveFromComment(text2.trimStart(), commentDirectiveRegEx);
|
|
@@ -10993,8 +11881,6 @@ ${lanes.join("\n")}
|
|
|
10993
11881
|
pos--;
|
|
10994
11882
|
const extendedCookedChar = peekExtendedUnicodeEscape();
|
|
10995
11883
|
if (extendedCookedChar >= 0 && isIdentifierStart(extendedCookedChar, languageVersion)) {
|
|
10996
|
-
pos += 3;
|
|
10997
|
-
tokenFlags |= 8 /* ExtendedUnicodeEscape */;
|
|
10998
11884
|
tokenValue = scanExtendedUnicodeEscape() + scanIdentifierParts();
|
|
10999
11885
|
return token = getIdentifierToken();
|
|
11000
11886
|
}
|
|
@@ -11131,7 +12017,7 @@ ${lanes.join("\n")}
|
|
|
11131
12017
|
function utf16EncodeAsString(codePoint) {
|
|
11132
12018
|
return utf16EncodeAsStringWorker(codePoint);
|
|
11133
12019
|
}
|
|
11134
|
-
var textToKeywordObj, textToKeyword, textToToken, unicodeES3IdentifierStart, unicodeES3IdentifierPart, unicodeES5IdentifierStart, unicodeES5IdentifierPart, unicodeESNextIdentifierStart, unicodeESNextIdentifierPart, commentDirectiveRegExSingleLine, commentDirectiveRegExMultiLine, semanticJSDocTagRegEx, tokenStrings, mergeConflictMarkerLength, shebangTriviaRegex, utf16EncodeAsStringWorker;
|
|
12020
|
+
var textToKeywordObj, textToKeyword, textToToken, charToRegExpFlag, regExpFlagToFirstAvailableLanguageVersion, unicodeES3IdentifierStart, unicodeES3IdentifierPart, unicodeES5IdentifierStart, unicodeES5IdentifierPart, unicodeESNextIdentifierStart, unicodeESNextIdentifierPart, commentDirectiveRegExSingleLine, commentDirectiveRegExMultiLine, semanticJSDocTagRegEx, tokenStrings, regExpFlagChars, mergeConflictMarkerLength, shebangTriviaRegex, utf16EncodeAsStringWorker, nonBinaryUnicodeProperties, binaryUnicodeProperties, binaryUnicodePropertiesOfStrings, valuesOfNonBinaryUnicodeProperties;
|
|
11135
12021
|
var init_scanner = __esm({
|
|
11136
12022
|
"src/compiler/scanner.ts"() {
|
|
11137
12023
|
"use strict";
|
|
@@ -11286,6 +12172,26 @@ ${lanes.join("\n")}
|
|
|
11286
12172
|
"#": 63 /* HashToken */,
|
|
11287
12173
|
"`": 62 /* BacktickToken */
|
|
11288
12174
|
}));
|
|
12175
|
+
charToRegExpFlag = new Map(Object.entries({
|
|
12176
|
+
d: 1 /* HasIndices */,
|
|
12177
|
+
g: 2 /* Global */,
|
|
12178
|
+
i: 4 /* IgnoreCase */,
|
|
12179
|
+
m: 8 /* Multiline */,
|
|
12180
|
+
s: 16 /* DotAll */,
|
|
12181
|
+
u: 32 /* Unicode */,
|
|
12182
|
+
v: 64 /* UnicodeSets */,
|
|
12183
|
+
y: 128 /* Sticky */
|
|
12184
|
+
}));
|
|
12185
|
+
regExpFlagToFirstAvailableLanguageVersion = /* @__PURE__ */ new Map([
|
|
12186
|
+
[1 /* HasIndices */, 9 /* ES2022 */],
|
|
12187
|
+
[2 /* Global */, 0 /* ES3 */],
|
|
12188
|
+
[4 /* IgnoreCase */, 0 /* ES3 */],
|
|
12189
|
+
[8 /* Multiline */, 0 /* ES3 */],
|
|
12190
|
+
[16 /* DotAll */, 5 /* ES2018 */],
|
|
12191
|
+
[32 /* Unicode */, 2 /* ES2015 */],
|
|
12192
|
+
[64 /* UnicodeSets */, 11 /* ES2024 */],
|
|
12193
|
+
[128 /* Sticky */, 2 /* ES2015 */]
|
|
12194
|
+
]);
|
|
11289
12195
|
unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500];
|
|
11290
12196
|
unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500];
|
|
11291
12197
|
unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6e3, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43e3, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500];
|
|
@@ -11296,9 +12202,26 @@ ${lanes.join("\n")}
|
|
|
11296
12202
|
commentDirectiveRegExMultiLine = /^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/;
|
|
11297
12203
|
semanticJSDocTagRegEx = /@(?:see|link)/i;
|
|
11298
12204
|
tokenStrings = makeReverseMap(textToToken);
|
|
12205
|
+
regExpFlagChars = makeReverseMap(charToRegExpFlag);
|
|
11299
12206
|
mergeConflictMarkerLength = "<<<<<<<".length;
|
|
11300
12207
|
shebangTriviaRegex = /^#!.*/;
|
|
11301
12208
|
utf16EncodeAsStringWorker = String.fromCodePoint ? (codePoint) => String.fromCodePoint(codePoint) : utf16EncodeAsStringFallback;
|
|
12209
|
+
nonBinaryUnicodeProperties = new Map(Object.entries({
|
|
12210
|
+
General_Category: "General_Category",
|
|
12211
|
+
gc: "General_Category",
|
|
12212
|
+
Script: "Script",
|
|
12213
|
+
sc: "Script",
|
|
12214
|
+
Script_Extensions: "Script_Extensions",
|
|
12215
|
+
scx: "Script_Extensions"
|
|
12216
|
+
}));
|
|
12217
|
+
binaryUnicodeProperties = /* @__PURE__ */ new Set(["ASCII", "ASCII_Hex_Digit", "AHex", "Alphabetic", "Alpha", "Any", "Assigned", "Bidi_Control", "Bidi_C", "Bidi_Mirrored", "Bidi_M", "Case_Ignorable", "CI", "Cased", "Changes_When_Casefolded", "CWCF", "Changes_When_Casemapped", "CWCM", "Changes_When_Lowercased", "CWL", "Changes_When_NFKC_Casefolded", "CWKCF", "Changes_When_Titlecased", "CWT", "Changes_When_Uppercased", "CWU", "Dash", "Default_Ignorable_Code_Point", "DI", "Deprecated", "Dep", "Diacritic", "Dia", "Emoji", "Emoji_Component", "EComp", "Emoji_Modifier", "EMod", "Emoji_Modifier_Base", "EBase", "Emoji_Presentation", "EPres", "Extended_Pictographic", "ExtPict", "Extender", "Ext", "Grapheme_Base", "Gr_Base", "Grapheme_Extend", "Gr_Ext", "Hex_Digit", "Hex", "IDS_Binary_Operator", "IDSB", "IDS_Trinary_Operator", "IDST", "ID_Continue", "IDC", "ID_Start", "IDS", "Ideographic", "Ideo", "Join_Control", "Join_C", "Logical_Order_Exception", "LOE", "Lowercase", "Lower", "Math", "Noncharacter_Code_Point", "NChar", "Pattern_Syntax", "Pat_Syn", "Pattern_White_Space", "Pat_WS", "Quotation_Mark", "QMark", "Radical", "Regional_Indicator", "RI", "Sentence_Terminal", "STerm", "Soft_Dotted", "SD", "Terminal_Punctuation", "Term", "Unified_Ideograph", "UIdeo", "Uppercase", "Upper", "Variation_Selector", "VS", "White_Space", "space", "XID_Continue", "XIDC", "XID_Start", "XIDS"]);
|
|
12218
|
+
binaryUnicodePropertiesOfStrings = /* @__PURE__ */ new Set(["Basic_Emoji", "Emoji_Keycap_Sequence", "RGI_Emoji_Modifier_Sequence", "RGI_Emoji_Flag_Sequence", "RGI_Emoji_Tag_Sequence", "RGI_Emoji_ZWJ_Sequence", "RGI_Emoji"]);
|
|
12219
|
+
valuesOfNonBinaryUnicodeProperties = {
|
|
12220
|
+
General_Category: /* @__PURE__ */ new Set(["C", "Other", "Cc", "Control", "cntrl", "Cf", "Format", "Cn", "Unassigned", "Co", "Private_Use", "Cs", "Surrogate", "L", "Letter", "LC", "Cased_Letter", "Ll", "Lowercase_Letter", "Lm", "Modifier_Letter", "Lo", "Other_Letter", "Lt", "Titlecase_Letter", "Lu", "Uppercase_Letter", "M", "Mark", "Combining_Mark", "Mc", "Spacing_Mark", "Me", "Enclosing_Mark", "Mn", "Nonspacing_Mark", "N", "Number", "Nd", "Decimal_Number", "digit", "Nl", "Letter_Number", "No", "Other_Number", "P", "Punctuation", "punct", "Pc", "Connector_Punctuation", "Pd", "Dash_Punctuation", "Pe", "Close_Punctuation", "Pf", "Final_Punctuation", "Pi", "Initial_Punctuation", "Po", "Other_Punctuation", "Ps", "Open_Punctuation", "S", "Symbol", "Sc", "Currency_Symbol", "Sk", "Modifier_Symbol", "Sm", "Math_Symbol", "So", "Other_Symbol", "Z", "Separator", "Zl", "Line_Separator", "Zp", "Paragraph_Separator", "Zs", "Space_Separator"]),
|
|
12221
|
+
Script: /* @__PURE__ */ new Set(["Adlm", "Adlam", "Aghb", "Caucasian_Albanian", "Ahom", "Ahom", "Arab", "Arabic", "Armi", "Imperial_Aramaic", "Armn", "Armenian", "Avst", "Avestan", "Bali", "Balinese", "Bamu", "Bamum", "Bass", "Bassa_Vah", "Batk", "Batak", "Beng", "Bengali", "Bhks", "Bhaiksuki", "Bopo", "Bopomofo", "Brah", "Brahmi", "Brai", "Braille", "Bugi", "Buginese", "Buhd", "Buhid", "Cakm", "Chakma", "Cans", "Canadian_Aboriginal", "Cari", "Carian", "Cham", "Cham", "Cher", "Cherokee", "Chrs", "Chorasmian", "Copt", "Coptic", "Qaac", "Cpmn", "Cypro_Minoan", "Cprt", "Cypriot", "Cyrl", "Cyrillic", "Deva", "Devanagari", "Diak", "Dives_Akuru", "Dogr", "Dogra", "Dsrt", "Deseret", "Dupl", "Duployan", "Egyp", "Egyptian_Hieroglyphs", "Elba", "Elbasan", "Elym", "Elymaic", "Ethi", "Ethiopic", "Geor", "Georgian", "Glag", "Glagolitic", "Gong", "Gunjala_Gondi", "Gonm", "Masaram_Gondi", "Goth", "Gothic", "Gran", "Grantha", "Grek", "Greek", "Gujr", "Gujarati", "Guru", "Gurmukhi", "Hang", "Hangul", "Hani", "Han", "Hano", "Hanunoo", "Hatr", "Hatran", "Hebr", "Hebrew", "Hira", "Hiragana", "Hluw", "Anatolian_Hieroglyphs", "Hmng", "Pahawh_Hmong", "Hmnp", "Nyiakeng_Puachue_Hmong", "Hrkt", "Katakana_Or_Hiragana", "Hung", "Old_Hungarian", "Ital", "Old_Italic", "Java", "Javanese", "Kali", "Kayah_Li", "Kana", "Katakana", "Kawi", "Kawi", "Khar", "Kharoshthi", "Khmr", "Khmer", "Khoj", "Khojki", "Kits", "Khitan_Small_Script", "Knda", "Kannada", "Kthi", "Kaithi", "Lana", "Tai_Tham", "Laoo", "Lao", "Latn", "Latin", "Lepc", "Lepcha", "Limb", "Limbu", "Lina", "Linear_A", "Linb", "Linear_B", "Lisu", "Lisu", "Lyci", "Lycian", "Lydi", "Lydian", "Mahj", "Mahajani", "Maka", "Makasar", "Mand", "Mandaic", "Mani", "Manichaean", "Marc", "Marchen", "Medf", "Medefaidrin", "Mend", "Mende_Kikakui", "Merc", "Meroitic_Cursive", "Mero", "Meroitic_Hieroglyphs", "Mlym", "Malayalam", "Modi", "Modi", "Mong", "Mongolian", "Mroo", "Mro", "Mtei", "Meetei_Mayek", "Mult", "Multani", "Mymr", "Myanmar", "Nagm", "Nag_Mundari", "Nand", "Nandinagari", "Narb", "Old_North_Arabian", "Nbat", "Nabataean", "Newa", "Newa", "Nkoo", "Nko", "Nshu", "Nushu", "Ogam", "Ogham", "Olck", "Ol_Chiki", "Orkh", "Old_Turkic", "Orya", "Oriya", "Osge", "Osage", "Osma", "Osmanya", "Ougr", "Old_Uyghur", "Palm", "Palmyrene", "Pauc", "Pau_Cin_Hau", "Perm", "Old_Permic", "Phag", "Phags_Pa", "Phli", "Inscriptional_Pahlavi", "Phlp", "Psalter_Pahlavi", "Phnx", "Phoenician", "Plrd", "Miao", "Prti", "Inscriptional_Parthian", "Rjng", "Rejang", "Rohg", "Hanifi_Rohingya", "Runr", "Runic", "Samr", "Samaritan", "Sarb", "Old_South_Arabian", "Saur", "Saurashtra", "Sgnw", "SignWriting", "Shaw", "Shavian", "Shrd", "Sharada", "Sidd", "Siddham", "Sind", "Khudawadi", "Sinh", "Sinhala", "Sogd", "Sogdian", "Sogo", "Old_Sogdian", "Sora", "Sora_Sompeng", "Soyo", "Soyombo", "Sund", "Sundanese", "Sylo", "Syloti_Nagri", "Syrc", "Syriac", "Tagb", "Tagbanwa", "Takr", "Takri", "Tale", "Tai_Le", "Talu", "New_Tai_Lue", "Taml", "Tamil", "Tang", "Tangut", "Tavt", "Tai_Viet", "Telu", "Telugu", "Tfng", "Tifinagh", "Tglg", "Tagalog", "Thaa", "Thaana", "Thai", "Thai", "Tibt", "Tibetan", "Tirh", "Tirhuta", "Tnsa", "Tangsa", "Toto", "Toto", "Ugar", "Ugaritic", "Vaii", "Vai", "Vith", "Vithkuqi", "Wara", "Warang_Citi", "Wcho", "Wancho", "Xpeo", "Old_Persian", "Xsux", "Cuneiform", "Yezi", "Yezidi", "Yiii", "Yi", "Zanb", "Zanabazar_Square", "Zinh", "Inherited", "Qaai", "Zyyy", "Common", "Zzzz", "Unknown"]),
|
|
12222
|
+
Script_Extensions: /* @__PURE__ */ new Set()
|
|
12223
|
+
// Currently empty
|
|
12224
|
+
};
|
|
11302
12225
|
}
|
|
11303
12226
|
});
|
|
11304
12227
|
|
|
@@ -29356,7 +30279,10 @@ ${lanes.join("\n")}
|
|
|
29356
30279
|
function parseErrorAtPosition(start, length2, message, ...args) {
|
|
29357
30280
|
const lastError = lastOrUndefined(parseDiagnostics);
|
|
29358
30281
|
let result;
|
|
29359
|
-
if (
|
|
30282
|
+
if (message.category === 3 /* Message */ && lastError && start === lastError.start && length2 === lastError.length) {
|
|
30283
|
+
result = createDetachedDiagnostic(fileName, sourceText, start, length2, message, ...args);
|
|
30284
|
+
addRelatedInfo(lastError, result);
|
|
30285
|
+
} else if (!lastError || start !== lastError.start) {
|
|
29360
30286
|
result = createDetachedDiagnostic(fileName, sourceText, start, length2, message, ...args);
|
|
29361
30287
|
parseDiagnostics.push(result);
|
|
29362
30288
|
}
|
|
@@ -29512,7 +30438,7 @@ ${lanes.join("\n")}
|
|
|
29512
30438
|
parseErrorForInvalidName(Diagnostics.Type_alias_name_cannot_be_0, Diagnostics.Type_alias_must_be_given_a_name, 64 /* EqualsToken */);
|
|
29513
30439
|
return;
|
|
29514
30440
|
}
|
|
29515
|
-
const suggestion = getSpellingSuggestion(expressionText, viableKeywordSuggestions,
|
|
30441
|
+
const suggestion = getSpellingSuggestion(expressionText, viableKeywordSuggestions, identity) ?? getSpaceSuggestion(expressionText);
|
|
29516
30442
|
if (suggestion) {
|
|
29517
30443
|
parseErrorAt(pos, node.end, Diagnostics.Unknown_keyword_or_identifier_Did_you_mean_0, suggestion);
|
|
29518
30444
|
return;
|
|
@@ -40620,9 +41546,7 @@ ${lanes.join("\n")}
|
|
|
40620
41546
|
extensionsToExtensionsArray(extensions),
|
|
40621
41547
|
/*excludes*/
|
|
40622
41548
|
void 0,
|
|
40623
|
-
[
|
|
40624
|
-
isDeclarationFileName(target) ? target.replace("*", "**/*") : changeAnyExtension(target.replace("*", "**/*"), getDeclarationEmitExtensionForPath(target))
|
|
40625
|
-
]
|
|
41549
|
+
[changeAnyExtension(target.replace("*", "**/*"), getDeclarationEmitExtensionForPath(target))]
|
|
40626
41550
|
).forEach((entry) => {
|
|
40627
41551
|
entrypoints = appendIfUnique(entrypoints, {
|
|
40628
41552
|
path: entry,
|
|
@@ -50213,7 +51137,7 @@ ${lanes.join("\n")}
|
|
|
50213
51137
|
}
|
|
50214
51138
|
return factory.createInferTypeNode(typeParameterToDeclarationWithConstraint(type, context, constraintNode));
|
|
50215
51139
|
}
|
|
50216
|
-
if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && type.flags & 262144 /* TypeParameter */) {
|
|
51140
|
+
if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && type.flags & 262144 /* TypeParameter */ && !isTypeSymbolAccessible(type.symbol, context.enclosingDeclaration)) {
|
|
50217
51141
|
const name2 = typeParameterToName(type, context);
|
|
50218
51142
|
context.approximateLength += idText(name2).length;
|
|
50219
51143
|
return factory.createTypeReferenceNode(
|
|
@@ -50979,65 +51903,36 @@ ${lanes.join("\n")}
|
|
|
50979
51903
|
true
|
|
50980
51904
|
)[0];
|
|
50981
51905
|
let cleanup;
|
|
50982
|
-
if (context.enclosingDeclaration && signature.declaration && signature.declaration !== context.enclosingDeclaration && !isInJSFile(signature.declaration) &&
|
|
50983
|
-
|
|
50984
|
-
|
|
50985
|
-
|
|
50986
|
-
|
|
50987
|
-
|
|
50988
|
-
|
|
50989
|
-
|
|
50990
|
-
|
|
50991
|
-
|
|
50992
|
-
|
|
50993
|
-
|
|
50994
|
-
|
|
50995
|
-
if (!locals.has(name)) {
|
|
50996
|
-
newLocals = append(newLocals, name);
|
|
50997
|
-
locals.set(name, symbol);
|
|
50998
|
-
}
|
|
50999
|
-
});
|
|
51000
|
-
if (!newLocals)
|
|
51001
|
-
return;
|
|
51002
|
-
const oldCleanup = cleanup;
|
|
51003
|
-
function undo() {
|
|
51906
|
+
if (context.enclosingDeclaration && signature.declaration && signature.declaration !== context.enclosingDeclaration && !isInJSFile(signature.declaration) && some(expandedParams)) {
|
|
51907
|
+
const existingFakeScope = getNodeLinks(context.enclosingDeclaration).fakeScopeForSignatureDeclaration ? context.enclosingDeclaration : void 0;
|
|
51908
|
+
Debug.assertOptionalNode(existingFakeScope, isBlock);
|
|
51909
|
+
const locals = (existingFakeScope == null ? void 0 : existingFakeScope.locals) ?? createSymbolTable();
|
|
51910
|
+
let newLocals;
|
|
51911
|
+
for (const param of expandedParams) {
|
|
51912
|
+
if (!locals.has(param.escapedName)) {
|
|
51913
|
+
newLocals = append(newLocals, param.escapedName);
|
|
51914
|
+
locals.set(param.escapedName, param);
|
|
51915
|
+
}
|
|
51916
|
+
}
|
|
51917
|
+
if (newLocals) {
|
|
51918
|
+
let removeNewLocals2 = function() {
|
|
51004
51919
|
forEach(newLocals, (s) => locals.delete(s));
|
|
51005
|
-
|
|
51006
|
-
|
|
51920
|
+
};
|
|
51921
|
+
var removeNewLocals = removeNewLocals2;
|
|
51007
51922
|
if (existingFakeScope) {
|
|
51008
|
-
cleanup =
|
|
51923
|
+
cleanup = removeNewLocals2;
|
|
51009
51924
|
} else {
|
|
51010
51925
|
const fakeScope = parseNodeFactory.createBlock(emptyArray);
|
|
51011
|
-
getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration =
|
|
51926
|
+
getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration = true;
|
|
51012
51927
|
fakeScope.locals = locals;
|
|
51013
51928
|
const saveEnclosingDeclaration = context.enclosingDeclaration;
|
|
51014
51929
|
setParent(fakeScope, saveEnclosingDeclaration);
|
|
51015
51930
|
context.enclosingDeclaration = fakeScope;
|
|
51016
51931
|
cleanup = () => {
|
|
51017
51932
|
context.enclosingDeclaration = saveEnclosingDeclaration;
|
|
51018
|
-
|
|
51933
|
+
removeNewLocals2();
|
|
51019
51934
|
};
|
|
51020
51935
|
}
|
|
51021
|
-
};
|
|
51022
|
-
var pushFakeScope = pushFakeScope2;
|
|
51023
|
-
pushFakeScope2(
|
|
51024
|
-
"params",
|
|
51025
|
-
(add) => {
|
|
51026
|
-
for (const param of expandedParams) {
|
|
51027
|
-
add(param.escapedName, param);
|
|
51028
|
-
}
|
|
51029
|
-
}
|
|
51030
|
-
);
|
|
51031
|
-
if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */) {
|
|
51032
|
-
pushFakeScope2(
|
|
51033
|
-
"typeParams",
|
|
51034
|
-
(add) => {
|
|
51035
|
-
for (const typeParam of signature.typeParameters ?? emptyArray) {
|
|
51036
|
-
const typeParamName = typeParameterToName(typeParam, context).escapedText;
|
|
51037
|
-
add(typeParamName, typeParam.symbol);
|
|
51038
|
-
}
|
|
51039
|
-
}
|
|
51040
|
-
);
|
|
51041
51936
|
}
|
|
51042
51937
|
}
|
|
51043
51938
|
const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 176 /* Constructor */, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports));
|
|
@@ -51581,7 +52476,7 @@ ${lanes.join("\n")}
|
|
|
51581
52476
|
return identifier;
|
|
51582
52477
|
}
|
|
51583
52478
|
}
|
|
51584
|
-
function
|
|
52479
|
+
function typeParameterShadowsNameInScope(escapedName, context, type) {
|
|
51585
52480
|
const result = resolveName(
|
|
51586
52481
|
context.enclosingDeclaration,
|
|
51587
52482
|
escapedName,
|
|
@@ -51592,8 +52487,11 @@ ${lanes.join("\n")}
|
|
|
51592
52487
|
/*isUse*/
|
|
51593
52488
|
false
|
|
51594
52489
|
);
|
|
51595
|
-
if (result
|
|
51596
|
-
|
|
52490
|
+
if (result) {
|
|
52491
|
+
if (result.flags & 262144 /* TypeParameter */ && result === type.symbol) {
|
|
52492
|
+
return false;
|
|
52493
|
+
}
|
|
52494
|
+
return true;
|
|
51597
52495
|
}
|
|
51598
52496
|
return false;
|
|
51599
52497
|
}
|
|
@@ -51619,7 +52517,7 @@ ${lanes.join("\n")}
|
|
|
51619
52517
|
const rawtext = result.escapedText;
|
|
51620
52518
|
let i = ((_a = context.typeParameterNamesByTextNextNameCount) == null ? void 0 : _a.get(rawtext)) || 0;
|
|
51621
52519
|
let text = rawtext;
|
|
51622
|
-
while (((_b = context.typeParameterNamesByText) == null ? void 0 : _b.has(text)) ||
|
|
52520
|
+
while (((_b = context.typeParameterNamesByText) == null ? void 0 : _b.has(text)) || typeParameterShadowsNameInScope(text, context, type)) {
|
|
51623
52521
|
i++;
|
|
51624
52522
|
text = `${rawtext}_${i}`;
|
|
51625
52523
|
}
|
|
@@ -51630,7 +52528,7 @@ ${lanes.join("\n")}
|
|
|
51630
52528
|
}
|
|
51631
52529
|
(context.typeParameterNamesByTextNextNameCount || (context.typeParameterNamesByTextNextNameCount = /* @__PURE__ */ new Map())).set(rawtext, i);
|
|
51632
52530
|
(context.typeParameterNames || (context.typeParameterNames = /* @__PURE__ */ new Map())).set(getTypeId(type), result);
|
|
51633
|
-
(context.typeParameterNamesByText || (context.typeParameterNamesByText = /* @__PURE__ */ new Set())).add(
|
|
52531
|
+
(context.typeParameterNamesByText || (context.typeParameterNamesByText = /* @__PURE__ */ new Set())).add(rawtext);
|
|
51634
52532
|
}
|
|
51635
52533
|
return result;
|
|
51636
52534
|
}
|
|
@@ -51775,10 +52673,7 @@ ${lanes.join("\n")}
|
|
|
51775
52673
|
return !(getObjectFlags(type) & 4 /* Reference */) || !isTypeReferenceNode(existing) || length(existing.typeArguments) >= getMinTypeArgumentCount(type.target.typeParameters);
|
|
51776
52674
|
}
|
|
51777
52675
|
function getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration) {
|
|
51778
|
-
|
|
51779
|
-
enclosingDeclaration = enclosingDeclaration.parent;
|
|
51780
|
-
}
|
|
51781
|
-
return enclosingDeclaration;
|
|
52676
|
+
return getNodeLinks(enclosingDeclaration).fakeScopeForSignatureDeclaration ? enclosingDeclaration.parent : enclosingDeclaration;
|
|
51782
52677
|
}
|
|
51783
52678
|
function serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled) {
|
|
51784
52679
|
if (!isErrorType(type) && enclosingDeclaration) {
|
|
@@ -51858,7 +52753,7 @@ ${lanes.join("\n")}
|
|
|
51858
52753
|
}
|
|
51859
52754
|
if (isIdentifier(node)) {
|
|
51860
52755
|
const type = getDeclaredTypeOfSymbol(sym);
|
|
51861
|
-
const name = sym.flags & 262144 /* TypeParameter */ ? typeParameterToName(type, context) : factory.cloneNode(node);
|
|
52756
|
+
const name = sym.flags & 262144 /* TypeParameter */ && !isTypeSymbolAccessible(type.symbol, context.enclosingDeclaration) ? typeParameterToName(type, context) : factory.cloneNode(node);
|
|
51862
52757
|
name.symbol = sym;
|
|
51863
52758
|
return { introducesError, node: setEmitFlags(setOriginalNode(name, node), 16777216 /* NoAsciiEscaping */) };
|
|
51864
52759
|
}
|
|
@@ -55701,28 +56596,7 @@ ${lanes.join("\n")}
|
|
|
55701
56596
|
}
|
|
55702
56597
|
}
|
|
55703
56598
|
}
|
|
55704
|
-
|
|
55705
|
-
if (symbol.flags & 33554432 /* Transient */ && links.cjsExportMerged && symbol.declarations) {
|
|
55706
|
-
for (const decl of symbol.declarations) {
|
|
55707
|
-
const original = getSymbolLinks(decl.symbol)[resolutionKind];
|
|
55708
|
-
if (!resolved) {
|
|
55709
|
-
resolved = original;
|
|
55710
|
-
continue;
|
|
55711
|
-
}
|
|
55712
|
-
if (!original)
|
|
55713
|
-
continue;
|
|
55714
|
-
original.forEach((s, name) => {
|
|
55715
|
-
const existing = resolved.get(name);
|
|
55716
|
-
if (!existing)
|
|
55717
|
-
resolved.set(name, s);
|
|
55718
|
-
else if (existing === s)
|
|
55719
|
-
return;
|
|
55720
|
-
else
|
|
55721
|
-
resolved.set(name, mergeSymbol(existing, s));
|
|
55722
|
-
});
|
|
55723
|
-
}
|
|
55724
|
-
}
|
|
55725
|
-
links[resolutionKind] = resolved || emptySymbols;
|
|
56599
|
+
links[resolutionKind] = combineSymbolTables(earlySymbols, lateSymbols) || emptySymbols;
|
|
55726
56600
|
}
|
|
55727
56601
|
return links[resolutionKind];
|
|
55728
56602
|
}
|
|
@@ -139165,16 +140039,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
139165
140039
|
const { file, startPosition } = context;
|
|
139166
140040
|
const node = getNodeOrParentOfParentheses(file, startPosition);
|
|
139167
140041
|
const maybeBinary = getParentBinaryExpression(node);
|
|
139168
|
-
const nodeIsStringLiteral = isStringLiteral(maybeBinary);
|
|
139169
140042
|
const refactorInfo = { name: refactorName10, description: refactorDescription6, actions: [] };
|
|
139170
|
-
if (
|
|
139171
|
-
return emptyArray;
|
|
139172
|
-
}
|
|
139173
|
-
if (isExpressionNode(maybeBinary) && (nodeIsStringLiteral || isBinaryExpression(maybeBinary) && treeToArray(maybeBinary).isValidConcatenation)) {
|
|
140043
|
+
if (isBinaryExpression(maybeBinary) && treeToArray(maybeBinary).isValidConcatenation) {
|
|
139174
140044
|
refactorInfo.actions.push(convertStringAction);
|
|
139175
140045
|
return [refactorInfo];
|
|
139176
140046
|
} else if (context.preferences.provideRefactorNotApplicableReason) {
|
|
139177
|
-
refactorInfo.actions.push({ ...convertStringAction, notApplicableReason: getLocaleSpecificMessage(Diagnostics.
|
|
140047
|
+
refactorInfo.actions.push({ ...convertStringAction, notApplicableReason: getLocaleSpecificMessage(Diagnostics.Can_only_convert_string_concatenation) });
|
|
139178
140048
|
return [refactorInfo];
|
|
139179
140049
|
}
|
|
139180
140050
|
return emptyArray;
|
|
@@ -161185,7 +162055,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
161185
162055
|
["script" /* scriptElement */]: 1,
|
|
161186
162056
|
["external module name" /* externalModuleName */]: 2
|
|
161187
162057
|
};
|
|
161188
|
-
tripleSlashDirectiveFragmentRegex = /^(\/\/\/\s*<reference\s+(path|types)\s*=\s*(?:'|"))([^\
|
|
162058
|
+
tripleSlashDirectiveFragmentRegex = /^(\/\/\/\s*<reference\s+(path|types)\s*=\s*(?:'|"))([^\x03"]*)$/;
|
|
161189
162059
|
nodeModulesDependencyKeys = ["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"];
|
|
161190
162060
|
}
|
|
161191
162061
|
});
|
|
@@ -183858,6 +184728,7 @@ ${e.message}`;
|
|
|
183858
184728
|
PrivateIdentifierKind: () => PrivateIdentifierKind,
|
|
183859
184729
|
ProcessLevel: () => ProcessLevel,
|
|
183860
184730
|
QuotePreference: () => QuotePreference,
|
|
184731
|
+
RegularExpressionFlags: () => RegularExpressionFlags,
|
|
183861
184732
|
RelationComparisonResult: () => RelationComparisonResult,
|
|
183862
184733
|
Rename: () => ts_Rename_exports,
|
|
183863
184734
|
ScriptElementKind: () => ScriptElementKind,
|
|
@@ -183984,6 +184855,7 @@ ${e.message}`;
|
|
|
183984
184855
|
changeExtension: () => changeExtension,
|
|
183985
184856
|
changesAffectModuleResolution: () => changesAffectModuleResolution,
|
|
183986
184857
|
changesAffectingProgramStructure: () => changesAffectingProgramStructure,
|
|
184858
|
+
characterToRegularExpressionFlag: () => characterToRegularExpressionFlag,
|
|
183987
184859
|
childIsDecorated: () => childIsDecorated,
|
|
183988
184860
|
classElementOrClassElementParameterIsDecorated: () => classElementOrClassElementParameterIsDecorated,
|
|
183989
184861
|
classHasClassThisAssignment: () => classHasClassThisAssignment,
|
|
@@ -185740,6 +186612,7 @@ ${e.message}`;
|
|
|
185740
186612
|
reducePathComponents: () => reducePathComponents,
|
|
185741
186613
|
refactor: () => ts_refactor_exports,
|
|
185742
186614
|
regExpEscape: () => regExpEscape,
|
|
186615
|
+
regularExpressionFlagToCharacter: () => regularExpressionFlagToCharacter,
|
|
185743
186616
|
relativeComplement: () => relativeComplement,
|
|
185744
186617
|
removeAllComments: () => removeAllComments,
|
|
185745
186618
|
removeEmitHelper: () => removeEmitHelper,
|
|
@@ -186257,6 +187130,7 @@ ${e.message}`;
|
|
|
186257
187130
|
PrivateIdentifierKind: () => PrivateIdentifierKind,
|
|
186258
187131
|
ProcessLevel: () => ProcessLevel,
|
|
186259
187132
|
QuotePreference: () => QuotePreference,
|
|
187133
|
+
RegularExpressionFlags: () => RegularExpressionFlags,
|
|
186260
187134
|
RelationComparisonResult: () => RelationComparisonResult,
|
|
186261
187135
|
Rename: () => ts_Rename_exports,
|
|
186262
187136
|
ScriptElementKind: () => ScriptElementKind,
|
|
@@ -186383,6 +187257,7 @@ ${e.message}`;
|
|
|
186383
187257
|
changeExtension: () => changeExtension,
|
|
186384
187258
|
changesAffectModuleResolution: () => changesAffectModuleResolution,
|
|
186385
187259
|
changesAffectingProgramStructure: () => changesAffectingProgramStructure,
|
|
187260
|
+
characterToRegularExpressionFlag: () => characterToRegularExpressionFlag,
|
|
186386
187261
|
childIsDecorated: () => childIsDecorated,
|
|
186387
187262
|
classElementOrClassElementParameterIsDecorated: () => classElementOrClassElementParameterIsDecorated,
|
|
186388
187263
|
classHasClassThisAssignment: () => classHasClassThisAssignment,
|
|
@@ -188139,6 +189014,7 @@ ${e.message}`;
|
|
|
188139
189014
|
reducePathComponents: () => reducePathComponents,
|
|
188140
189015
|
refactor: () => ts_refactor_exports,
|
|
188141
189016
|
regExpEscape: () => regExpEscape,
|
|
189017
|
+
regularExpressionFlagToCharacter: () => regularExpressionFlagToCharacter,
|
|
188142
189018
|
relativeComplement: () => relativeComplement,
|
|
188143
189019
|
removeAllComments: () => removeAllComments,
|
|
188144
189020
|
removeEmitHelper: () => removeEmitHelper,
|