@typescript-deploys/pr-build 5.3.0-pr-55576-6 → 5.3.0-pr-55600-13

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/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.20230830`;
38
+ version = `${versionMajorMinor}.0-insiders.20230901`;
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";
@@ -4708,6 +4722,8 @@ ${lanes.join("\n")}
4708
4722
  ScriptTarget11[ScriptTarget11["ES2020"] = 7] = "ES2020";
4709
4723
  ScriptTarget11[ScriptTarget11["ES2021"] = 8] = "ES2021";
4710
4724
  ScriptTarget11[ScriptTarget11["ES2022"] = 9] = "ES2022";
4725
+ ScriptTarget11[ScriptTarget11["ES2023"] = 10] = "ES2023";
4726
+ ScriptTarget11[ScriptTarget11["ES2024"] = 11] = "ES2024";
4711
4727
  ScriptTarget11[ScriptTarget11["ESNext"] = 99] = "ESNext";
4712
4728
  ScriptTarget11[ScriptTarget11["JSON"] = 100] = "JSON";
4713
4729
  ScriptTarget11[ScriptTarget11["Latest"] = 99 /* ESNext */] = "Latest";
@@ -7393,6 +7409,43 @@ ${lanes.join("\n")}
7393
7409
  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."),
7394
7410
  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."),
7395
7411
  _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."),
7412
+ _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."),
7413
+ Unknown_regular_expression_flag: diag(1497, 1 /* Error */, "Unknown_regular_expression_flag_1497", "Unknown regular expression flag."),
7414
+ Duplicate_regular_expression_flag: diag(1498, 1 /* Error */, "Duplicate_regular_expression_flag_1498", "Duplicate regular expression flag."),
7415
+ 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."),
7416
+ 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."),
7417
+ 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."),
7418
+ 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."),
7419
+ Incomplete_quantifier_Digit_expected: diag(1503, 1 /* Error */, "Incomplete_quantifier_Digit_expected_1503", "Incomplete quantifier. Digit expected."),
7420
+ Numbers_out_of_order_in_quantifier: diag(1504, 1 /* Error */, "Numbers_out_of_order_in_quantifier_1504", "Numbers out of order in quantifier."),
7421
+ There_is_nothing_available_for_repetition: diag(1505, 1 /* Error */, "There_is_nothing_available_for_repetition_1505", "There is nothing available for repetition."),
7422
+ 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?"),
7423
+ 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."),
7424
+ 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."),
7425
+ 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."),
7426
+ 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."),
7427
+ Undetermined_character_escape: diag(1511, 1 /* Error */, "Undetermined_character_escape_1511", "Undetermined character escape."),
7428
+ Expected_a_capturing_group_name: diag(1512, 1 /* Error */, "Expected_a_capturing_group_name_1512", "Expected a capturing group name."),
7429
+ 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."),
7430
+ 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."),
7431
+ 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."),
7432
+ 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."),
7433
+ 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."),
7434
+ Expected_a_class_set_oprand: diag(1518, 1 /* Error */, "Expected_a_class_set_oprand_1518", "Expected a class set oprand."),
7435
+ 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."),
7436
+ 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?"),
7437
+ Expected_a_Unicode_property_name: diag(1521, 1 /* Error */, "Expected_a_Unicode_property_name_1521", "Expected a Unicode property name."),
7438
+ Unknown_Unicode_property_name: diag(1522, 1 /* Error */, "Unknown_Unicode_property_name_1522", "Unknown Unicode property name."),
7439
+ Expected_a_Unicode_property_value: diag(1523, 1 /* Error */, "Expected_a_Unicode_property_value_1523", "Expected a Unicode property value."),
7440
+ Unknown_Unicode_property_value: diag(1524, 1 /* Error */, "Unknown_Unicode_property_value_1524", "Unknown Unicode property value."),
7441
+ 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."),
7442
+ 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."),
7443
+ Unknown_Unicode_property_name_or_value: diag(1527, 1 /* Error */, "Unknown_Unicode_property_name_or_value_1527", "Unknown Unicode property name or value."),
7444
+ 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."),
7445
+ _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."),
7446
+ 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."),
7447
+ 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."),
7448
+ 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."),
7396
7449
  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."),
7397
7450
  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."),
7398
7451
  Call_signature_return_types_0_and_1_are_incompatible: diag(
@@ -9118,6 +9171,15 @@ ${lanes.join("\n")}
9118
9171
  function stringToToken(s) {
9119
9172
  return textToToken.get(s);
9120
9173
  }
9174
+ function regularExpressionFlagToCharacter(f) {
9175
+ return regExpFlagChars[f];
9176
+ }
9177
+ function characterToRegularExpressionFlag(c) {
9178
+ return charToRegExpFlag.get(c);
9179
+ }
9180
+ function regularExpressionFlagToFirstAvailableLanguageVersion(f) {
9181
+ return regExpFlagToFirstAvailableLanguageVersion.get(f);
9182
+ }
9121
9183
  function computeLineStarts(text) {
9122
9184
  const result = [];
9123
9185
  let pos = 0;
@@ -9214,8 +9276,11 @@ ${lanes.join("\n")}
9214
9276
  function isHexDigit(ch) {
9215
9277
  return isDigit(ch) || ch >= 65 /* A */ && ch <= 70 /* F */ || ch >= 97 /* a */ && ch <= 102 /* f */;
9216
9278
  }
9217
- function isCodePoint(code) {
9218
- return code <= 1114111;
9279
+ function isASCIILetter(ch) {
9280
+ return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */;
9281
+ }
9282
+ function isWordCharacter(ch) {
9283
+ return isASCIILetter(ch) || isDigit(ch) || ch === 95 /* _ */;
9219
9284
  }
9220
9285
  function isOctalDigit(ch) {
9221
9286
  return ch >= 48 /* _0 */ && ch <= 55 /* _7 */;
@@ -9552,10 +9617,10 @@ ${lanes.join("\n")}
9552
9617
  }
9553
9618
  }
9554
9619
  function isIdentifierStart(ch, languageVersion) {
9555
- return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion);
9620
+ return isASCIILetter(ch) || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion);
9556
9621
  }
9557
9622
  function isIdentifierPart(ch, languageVersion, identifierVariant) {
9558
- return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || // "-" and ":" are valid in JSX Identifiers
9623
+ return isWordCharacter(ch) || ch === 36 /* $ */ || // "-" and ":" are valid in JSX Identifiers
9559
9624
  (identifierVariant === 1 /* JSX */ ? ch === 45 /* minus */ || ch === 58 /* colon */ : false) || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion);
9560
9625
  }
9561
9626
  function isIdentifierText(name, languageVersion, identifierVariant) {
@@ -9641,13 +9706,8 @@ ${lanes.join("\n")}
9641
9706
  });
9642
9707
  }
9643
9708
  return scanner2;
9644
- function error2(message, errPos = pos, length3, arg0) {
9645
- if (onError) {
9646
- const oldPos = pos;
9647
- pos = errPos;
9648
- onError(message, length3 || 0, arg0);
9649
- pos = oldPos;
9650
- }
9709
+ function error2(message, errPos = pos, length3 = 0, ...args) {
9710
+ return onError == null ? void 0 : onError(message, errPos, length3, ...args);
9651
9711
  }
9652
9712
  function scanNumberFragment() {
9653
9713
  let start2 = pos;
@@ -9872,7 +9932,9 @@ ${lanes.join("\n")}
9872
9932
  result += text.substring(start2, pos);
9873
9933
  result += scanEscapeSequence(
9874
9934
  /*shouldEmitInvalidEscapeError*/
9875
- true
9935
+ true,
9936
+ /*isRegularExpression*/
9937
+ false
9876
9938
  );
9877
9939
  start2 = pos;
9878
9940
  continue;
@@ -9916,7 +9978,11 @@ ${lanes.join("\n")}
9916
9978
  }
9917
9979
  if (currChar === 92 /* backslash */) {
9918
9980
  contents += text.substring(start2, pos);
9919
- contents += scanEscapeSequence(shouldEmitInvalidEscapeError);
9981
+ contents += scanEscapeSequence(
9982
+ shouldEmitInvalidEscapeError,
9983
+ /*isRegularExpression*/
9984
+ false
9985
+ );
9920
9986
  start2 = pos;
9921
9987
  continue;
9922
9988
  }
@@ -9936,7 +10002,7 @@ ${lanes.join("\n")}
9936
10002
  tokenValue = contents;
9937
10003
  return resultingToken;
9938
10004
  }
9939
- function scanEscapeSequence(shouldEmitInvalidEscapeError) {
10005
+ function scanEscapeSequence(shouldEmitInvalidEscapeError, isRegularExpression) {
9940
10006
  const start2 = pos;
9941
10007
  pos++;
9942
10008
  if (pos >= end) {
@@ -9995,45 +10061,9 @@ ${lanes.join("\n")}
9995
10061
  case 34 /* doubleQuote */:
9996
10062
  return '"';
9997
10063
  case 117 /* u */:
9998
- if (pos < end && text.charCodeAt(pos) === 123 /* openBrace */) {
9999
- pos++;
10000
- const escapedValueString = scanMinimumNumberOfHexDigits(
10001
- 1,
10002
- /*canHaveSeparators*/
10003
- false
10004
- );
10005
- const escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1;
10006
- if (escapedValue < 0) {
10007
- tokenFlags |= 2048 /* ContainsInvalidEscape */;
10008
- if (shouldEmitInvalidEscapeError) {
10009
- error2(Diagnostics.Hexadecimal_digit_expected);
10010
- }
10011
- return text.substring(start2, pos);
10012
- }
10013
- if (!isCodePoint(escapedValue)) {
10014
- tokenFlags |= 2048 /* ContainsInvalidEscape */;
10015
- if (shouldEmitInvalidEscapeError) {
10016
- error2(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive);
10017
- }
10018
- return text.substring(start2, pos);
10019
- }
10020
- if (pos >= end) {
10021
- tokenFlags |= 2048 /* ContainsInvalidEscape */;
10022
- if (shouldEmitInvalidEscapeError) {
10023
- error2(Diagnostics.Unexpected_end_of_text);
10024
- }
10025
- return text.substring(start2, pos);
10026
- }
10027
- if (text.charCodeAt(pos) !== 125 /* closeBrace */) {
10028
- tokenFlags |= 2048 /* ContainsInvalidEscape */;
10029
- if (shouldEmitInvalidEscapeError) {
10030
- error2(Diagnostics.Unterminated_Unicode_escape_sequence);
10031
- }
10032
- return text.substring(start2, pos);
10033
- }
10034
- pos++;
10035
- tokenFlags |= 8 /* ExtendedUnicodeEscape */;
10036
- return utf16EncodeAsString(escapedValue);
10064
+ if ((!isRegularExpression || shouldEmitInvalidEscapeError) && pos < end && text.charCodeAt(pos) === 123 /* openBrace */) {
10065
+ pos -= 2;
10066
+ return scanExtendedUnicodeEscape(shouldEmitInvalidEscapeError);
10037
10067
  }
10038
10068
  for (; pos < start2 + 6; pos++) {
10039
10069
  if (!(pos < end && isHexDigit(text.charCodeAt(pos)))) {
@@ -10045,7 +10075,23 @@ ${lanes.join("\n")}
10045
10075
  }
10046
10076
  }
10047
10077
  tokenFlags |= 1024 /* UnicodeEscape */;
10048
- return String.fromCharCode(parseInt(text.substring(start2 + 2, pos), 16));
10078
+ const escapedValue = parseInt(text.substring(start2 + 2, pos), 16);
10079
+ const escapedValueString = String.fromCharCode(escapedValue);
10080
+ if (isRegularExpression && shouldEmitInvalidEscapeError && escapedValue >= 55296 && escapedValue <= 56319 && pos + 6 < end && text.substring(pos, pos + 2) === "\\u" && text.charCodeAt(pos + 2) !== 123 /* openBrace */) {
10081
+ const nextStart = pos;
10082
+ let nextPos = pos + 2;
10083
+ for (; nextPos < nextStart + 6; nextPos++) {
10084
+ if (!isHexDigit(text.charCodeAt(pos))) {
10085
+ return escapedValueString;
10086
+ }
10087
+ }
10088
+ const nextEscapedValue = parseInt(text.substring(nextStart + 2, nextPos), 16);
10089
+ if (nextEscapedValue >= 56320 && nextEscapedValue <= 57343) {
10090
+ pos = nextPos;
10091
+ return escapedValueString + String.fromCharCode(nextEscapedValue);
10092
+ }
10093
+ }
10094
+ return escapedValueString;
10049
10095
  case 120 /* x */:
10050
10096
  for (; pos < start2 + 4; pos++) {
10051
10097
  if (!(pos < end && isHexDigit(text.charCodeAt(pos)))) {
@@ -10067,10 +10113,16 @@ ${lanes.join("\n")}
10067
10113
  case 8233 /* paragraphSeparator */:
10068
10114
  return "";
10069
10115
  default:
10116
+ if (isRegularExpression && (shouldEmitInvalidEscapeError || isIdentifierPart(ch, languageVersion))) {
10117
+ error2(Diagnostics._0_is_not_a_valid_character_escape, pos - 2, 2, String.fromCharCode(ch));
10118
+ }
10070
10119
  return String.fromCharCode(ch);
10071
10120
  }
10072
10121
  }
10073
- function scanExtendedUnicodeEscape() {
10122
+ function scanExtendedUnicodeEscape(shouldEmitInvalidEscapeError = true) {
10123
+ const start2 = pos;
10124
+ pos += 3;
10125
+ const escapedStart = pos;
10074
10126
  const escapedValueString = scanMinimumNumberOfHexDigits(
10075
10127
  1,
10076
10128
  /*canHaveSeparators*/
@@ -10079,24 +10131,34 @@ ${lanes.join("\n")}
10079
10131
  const escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1;
10080
10132
  let isInvalidExtendedEscape = false;
10081
10133
  if (escapedValue < 0) {
10082
- error2(Diagnostics.Hexadecimal_digit_expected);
10134
+ if (shouldEmitInvalidEscapeError) {
10135
+ error2(Diagnostics.Hexadecimal_digit_expected);
10136
+ }
10083
10137
  isInvalidExtendedEscape = true;
10084
10138
  } else if (escapedValue > 1114111) {
10085
- error2(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive);
10139
+ if (shouldEmitInvalidEscapeError) {
10140
+ error2(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive, escapedStart, pos - escapedStart);
10141
+ }
10086
10142
  isInvalidExtendedEscape = true;
10087
10143
  }
10088
10144
  if (pos >= end) {
10089
- error2(Diagnostics.Unexpected_end_of_text);
10145
+ if (shouldEmitInvalidEscapeError) {
10146
+ error2(Diagnostics.Unexpected_end_of_text);
10147
+ }
10090
10148
  isInvalidExtendedEscape = true;
10091
10149
  } else if (text.charCodeAt(pos) === 125 /* closeBrace */) {
10092
10150
  pos++;
10093
10151
  } else {
10094
- error2(Diagnostics.Unterminated_Unicode_escape_sequence);
10152
+ if (shouldEmitInvalidEscapeError) {
10153
+ error2(Diagnostics.Unterminated_Unicode_escape_sequence);
10154
+ }
10095
10155
  isInvalidExtendedEscape = true;
10096
10156
  }
10097
10157
  if (isInvalidExtendedEscape) {
10098
- return "";
10158
+ tokenFlags |= 2048 /* ContainsInvalidEscape */;
10159
+ return text.substring(start2, pos);
10099
10160
  }
10161
+ tokenFlags |= 8 /* ExtendedUnicodeEscape */;
10100
10162
  return utf16EncodeAsString(escapedValue);
10101
10163
  }
10102
10164
  function peekUnicodeEscape() {
@@ -10138,8 +10200,6 @@ ${lanes.join("\n")}
10138
10200
  } else if (ch === 92 /* backslash */) {
10139
10201
  ch = peekExtendedUnicodeEscape();
10140
10202
  if (ch >= 0 && isIdentifierPart(ch, languageVersion)) {
10141
- pos += 3;
10142
- tokenFlags |= 8 /* ExtendedUnicodeEscape */;
10143
10203
  result += scanExtendedUnicodeEscape();
10144
10204
  start2 = pos;
10145
10205
  continue;
@@ -10609,8 +10669,6 @@ ${lanes.join("\n")}
10609
10669
  case 92 /* backslash */:
10610
10670
  const extendedCookedChar = peekExtendedUnicodeEscape();
10611
10671
  if (extendedCookedChar >= 0 && isIdentifierStart(extendedCookedChar, languageVersion)) {
10612
- pos += 3;
10613
- tokenFlags |= 8 /* ExtendedUnicodeEscape */;
10614
10672
  tokenValue = scanExtendedUnicodeEscape() + scanIdentifierParts();
10615
10673
  return token = getIdentifierToken();
10616
10674
  }
@@ -10626,7 +10684,7 @@ ${lanes.join("\n")}
10626
10684
  return token = 0 /* Unknown */;
10627
10685
  case 35 /* hash */:
10628
10686
  if (pos !== 0 && text[pos + 1] === "!") {
10629
- error2(Diagnostics.can_only_be_used_at_the_start_of_a_file);
10687
+ error2(Diagnostics.can_only_be_used_at_the_start_of_a_file, pos, 2);
10630
10688
  pos++;
10631
10689
  return token = 0 /* Unknown */;
10632
10690
  }
@@ -10635,8 +10693,6 @@ ${lanes.join("\n")}
10635
10693
  pos++;
10636
10694
  const extendedCookedChar2 = peekExtendedUnicodeEscape();
10637
10695
  if (extendedCookedChar2 >= 0 && isIdentifierStart(extendedCookedChar2, languageVersion)) {
10638
- pos += 3;
10639
- tokenFlags |= 8 /* ExtendedUnicodeEscape */;
10640
10696
  tokenValue = "#" + scanExtendedUnicodeEscape() + scanIdentifierParts();
10641
10697
  return token = 81 /* PrivateIdentifier */;
10642
10698
  }
@@ -10759,14 +10815,831 @@ ${lanes.join("\n")}
10759
10815
  }
10760
10816
  p++;
10761
10817
  }
10762
- while (p < end && isIdentifierPart(text.charCodeAt(p), languageVersion)) {
10818
+ const isUnterminated = !!(tokenFlags & 4 /* Unterminated */);
10819
+ const endOfBody = p - (isUnterminated ? 0 : 1);
10820
+ let regExpFlags = 0 /* None */;
10821
+ while (p < end) {
10822
+ const ch = text.charCodeAt(p);
10823
+ if (!isIdentifierPart(ch, languageVersion)) {
10824
+ break;
10825
+ }
10826
+ const flag = characterToRegularExpressionFlag(String.fromCharCode(ch));
10827
+ if (flag === void 0) {
10828
+ error2(Diagnostics.Unknown_regular_expression_flag, p, 1);
10829
+ } else if (regExpFlags & flag) {
10830
+ error2(Diagnostics.Duplicate_regular_expression_flag, p, 1);
10831
+ } else if (((regExpFlags | flag) & 96 /* UnicodeMode */) === 96 /* UnicodeMode */) {
10832
+ error2(Diagnostics.The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously, p, 1);
10833
+ } else {
10834
+ regExpFlags |= flag;
10835
+ const availableFrom = regularExpressionFlagToFirstAvailableLanguageVersion(flag);
10836
+ if (languageVersion < availableFrom) {
10837
+ error2(Diagnostics.This_regular_expression_flag_is_only_available_when_targeting_0_or_later, p, 1, ScriptTarget[availableFrom]);
10838
+ }
10839
+ }
10763
10840
  p++;
10764
10841
  }
10765
- pos = p;
10842
+ pos = tokenStart + 1;
10843
+ const saveTokenPos = tokenStart;
10844
+ const saveTokenFlags = tokenFlags;
10845
+ scanRegularExpressionWorker(text.slice(0, endOfBody), endOfBody, regExpFlags, isUnterminated);
10846
+ if (!isUnterminated) {
10847
+ pos = p;
10848
+ }
10849
+ tokenStart = saveTokenPos;
10850
+ tokenFlags = saveTokenFlags;
10766
10851
  tokenValue = text.substring(tokenStart, pos);
10767
10852
  token = 14 /* RegularExpressionLiteral */;
10768
10853
  }
10769
10854
  return token;
10855
+ function scanRegularExpressionWorker(text2, end2, regExpFlags, isUnterminated) {
10856
+ const unicodeMode = !!(regExpFlags & 96 /* UnicodeMode */);
10857
+ const unicodeSetsMode = !!(regExpFlags & 64 /* UnicodeSets */);
10858
+ let mayContainStrings = false;
10859
+ let numberOfCapturingGroups = 0;
10860
+ const groupSpecifiers = /* @__PURE__ */ new Set();
10861
+ const groupNameReferences = [];
10862
+ const decimalEscapes = [];
10863
+ const namedCapturingGroups = [];
10864
+ function scanDisjunction(isInGroup) {
10865
+ while (true) {
10866
+ namedCapturingGroups.push(/* @__PURE__ */ new Set());
10867
+ scanAlternative(isInGroup);
10868
+ namedCapturingGroups.pop();
10869
+ if (text2.charCodeAt(pos) !== 124 /* bar */) {
10870
+ return;
10871
+ }
10872
+ pos++;
10873
+ }
10874
+ }
10875
+ function scanAlternative(isInGroup) {
10876
+ let isPreviousTermQuantifiable = false;
10877
+ while (pos < end2) {
10878
+ const start2 = pos;
10879
+ const ch = text2.charCodeAt(pos);
10880
+ switch (ch) {
10881
+ case 94 /* caret */:
10882
+ case 36 /* $ */:
10883
+ pos++;
10884
+ isPreviousTermQuantifiable = false;
10885
+ break;
10886
+ case 92 /* backslash */:
10887
+ pos++;
10888
+ switch (text2.charCodeAt(pos)) {
10889
+ case 98 /* b */:
10890
+ case 66 /* B */:
10891
+ pos++;
10892
+ isPreviousTermQuantifiable = false;
10893
+ break;
10894
+ default:
10895
+ scanAtomEscape();
10896
+ isPreviousTermQuantifiable = true;
10897
+ break;
10898
+ }
10899
+ break;
10900
+ case 40 /* openParen */:
10901
+ pos++;
10902
+ if (text2.charCodeAt(pos) === 63 /* question */) {
10903
+ pos++;
10904
+ switch (text2.charCodeAt(pos)) {
10905
+ case 61 /* equals */:
10906
+ case 33 /* exclamation */:
10907
+ pos++;
10908
+ isPreviousTermQuantifiable = false;
10909
+ break;
10910
+ case 60 /* lessThan */:
10911
+ const groupNameStart = pos;
10912
+ pos++;
10913
+ switch (text2.charCodeAt(pos)) {
10914
+ case 61 /* equals */:
10915
+ case 33 /* exclamation */:
10916
+ pos++;
10917
+ isPreviousTermQuantifiable = false;
10918
+ break;
10919
+ default:
10920
+ scanGroupName(
10921
+ /*isReference*/
10922
+ false
10923
+ );
10924
+ scanExpectedChar(62 /* greaterThan */);
10925
+ if (languageVersion < 5 /* ES2018 */) {
10926
+ error2(Diagnostics.Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later, groupNameStart, pos - groupNameStart);
10927
+ }
10928
+ numberOfCapturingGroups++;
10929
+ isPreviousTermQuantifiable = true;
10930
+ break;
10931
+ }
10932
+ break;
10933
+ default:
10934
+ const start3 = pos;
10935
+ const setFlags = scanPatternModifiers();
10936
+ if (text2.charCodeAt(pos) === 45 /* minus */) {
10937
+ pos++;
10938
+ scanPatternModifiers(setFlags);
10939
+ if (pos === start3 + 1) {
10940
+ error2(Diagnostics.Subpattern_flags_must_be_present_when_there_is_a_minus_sign, start3, pos - start3);
10941
+ }
10942
+ }
10943
+ scanExpectedChar(58 /* colon */);
10944
+ isPreviousTermQuantifiable = true;
10945
+ break;
10946
+ }
10947
+ } else {
10948
+ numberOfCapturingGroups++;
10949
+ isPreviousTermQuantifiable = true;
10950
+ }
10951
+ scanDisjunction(
10952
+ /*isInGroup*/
10953
+ true
10954
+ );
10955
+ scanExpectedChar(41 /* closeParen */);
10956
+ break;
10957
+ case 123 /* openBrace */:
10958
+ pos++;
10959
+ const digitsStart = pos;
10960
+ scanDigits();
10961
+ const min2 = tokenValue;
10962
+ if (!min2) {
10963
+ error2(Diagnostics.Incomplete_quantifier_Digit_expected);
10964
+ }
10965
+ if (text2.charCodeAt(pos) === 44 /* comma */) {
10966
+ pos++;
10967
+ scanDigits();
10968
+ const max = tokenValue;
10969
+ if (max && Number.parseInt(min2) > Number.parseInt(max)) {
10970
+ error2(Diagnostics.Numbers_out_of_order_in_quantifier, digitsStart, pos - digitsStart);
10971
+ }
10972
+ }
10973
+ scanExpectedChar(125 /* closeBrace */);
10974
+ pos--;
10975
+ case 42 /* asterisk */:
10976
+ case 43 /* plus */:
10977
+ case 63 /* question */:
10978
+ pos++;
10979
+ if (text2.charCodeAt(pos) === 63 /* question */) {
10980
+ pos++;
10981
+ }
10982
+ if (!isPreviousTermQuantifiable) {
10983
+ error2(Diagnostics.There_is_nothing_available_for_repetition, start2, pos - start2);
10984
+ }
10985
+ isPreviousTermQuantifiable = false;
10986
+ break;
10987
+ case 46 /* dot */:
10988
+ pos++;
10989
+ isPreviousTermQuantifiable = true;
10990
+ break;
10991
+ case 91 /* openBracket */:
10992
+ pos++;
10993
+ if (unicodeSetsMode) {
10994
+ scanClassSetExpression();
10995
+ } else {
10996
+ scanClassRanges();
10997
+ }
10998
+ scanExpectedChar(93 /* closeBracket */);
10999
+ isPreviousTermQuantifiable = true;
11000
+ break;
11001
+ case 41 /* closeParen */:
11002
+ if (isInGroup) {
11003
+ return;
11004
+ }
11005
+ case 93 /* closeBracket */:
11006
+ case 125 /* closeBrace */:
11007
+ if (isUnterminated && !isInGroup) {
11008
+ return;
11009
+ }
11010
+ error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
11011
+ pos++;
11012
+ isPreviousTermQuantifiable = true;
11013
+ break;
11014
+ case 47 /* slash */:
11015
+ case 124 /* bar */:
11016
+ return;
11017
+ default:
11018
+ if (isLineBreak(ch)) {
11019
+ return;
11020
+ }
11021
+ scanSourceCharacter();
11022
+ isPreviousTermQuantifiable = true;
11023
+ break;
11024
+ }
11025
+ }
11026
+ }
11027
+ function scanPatternModifiers(currFlags = 0 /* None */) {
11028
+ while (pos < end2) {
11029
+ const ch = text2.charCodeAt(pos);
11030
+ if (!isIdentifierPart(ch, languageVersion)) {
11031
+ break;
11032
+ }
11033
+ const flag = characterToRegularExpressionFlag(String.fromCharCode(ch));
11034
+ if (flag === void 0) {
11035
+ error2(Diagnostics.Unknown_regular_expression_flag, pos, 1);
11036
+ } else if (currFlags & flag) {
11037
+ error2(Diagnostics.Duplicate_regular_expression_flag, pos, 1);
11038
+ } else if (!(flag & 28 /* Modifiers */)) {
11039
+ error2(Diagnostics.This_regular_expression_flag_cannot_be_toggled_within_a_subpattern, pos, 1);
11040
+ } else {
11041
+ currFlags |= flag;
11042
+ const availableFrom = regularExpressionFlagToFirstAvailableLanguageVersion(flag);
11043
+ if (languageVersion < availableFrom) {
11044
+ error2(Diagnostics.This_regular_expression_flag_is_only_available_when_targeting_0_or_later, pos, 1, ScriptTarget[availableFrom]);
11045
+ }
11046
+ }
11047
+ pos++;
11048
+ }
11049
+ return currFlags;
11050
+ }
11051
+ function scanAtomEscape() {
11052
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 92 /* backslash */);
11053
+ switch (text2.charCodeAt(pos)) {
11054
+ case 107 /* k */:
11055
+ pos++;
11056
+ if (text2.charCodeAt(pos) === 60 /* lessThan */) {
11057
+ pos++;
11058
+ scanGroupName(
11059
+ /*isReference*/
11060
+ true
11061
+ );
11062
+ scanExpectedChar(62 /* greaterThan */);
11063
+ } else if (unicodeMode) {
11064
+ error2(Diagnostics.k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets, pos - 2, 2);
11065
+ }
11066
+ break;
11067
+ case 113 /* q */:
11068
+ if (unicodeSetsMode) {
11069
+ pos++;
11070
+ error2(Diagnostics.q_is_only_available_inside_character_class, pos - 2, 2);
11071
+ break;
11072
+ }
11073
+ default:
11074
+ scanCharacterClassEscape() || scanDecimalEscape() || scanCharacterEscape();
11075
+ break;
11076
+ }
11077
+ }
11078
+ function scanDecimalEscape() {
11079
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 92 /* backslash */);
11080
+ const ch = text2.charCodeAt(pos);
11081
+ if (ch >= 49 /* _1 */ && ch <= 57 /* _9 */) {
11082
+ const start2 = pos;
11083
+ scanDigits();
11084
+ decimalEscapes.push({ pos: start2, end: pos, value: +tokenValue });
11085
+ return true;
11086
+ }
11087
+ return false;
11088
+ }
11089
+ function scanCharacterEscape() {
11090
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 92 /* backslash */);
11091
+ let ch = text2.charCodeAt(pos);
11092
+ switch (ch) {
11093
+ case 99 /* c */:
11094
+ pos++;
11095
+ ch = text2.charCodeAt(pos);
11096
+ if (isASCIILetter(ch)) {
11097
+ pos++;
11098
+ return String.fromCharCode(ch & 31);
11099
+ }
11100
+ if (unicodeMode) {
11101
+ error2(Diagnostics.c_must_be_followed_by_an_ASCII_letter, pos - 2, 2);
11102
+ }
11103
+ return String.fromCharCode(ch);
11104
+ case 94 /* caret */:
11105
+ case 36 /* $ */:
11106
+ case 47 /* slash */:
11107
+ case 92 /* backslash */:
11108
+ case 46 /* dot */:
11109
+ case 42 /* asterisk */:
11110
+ case 43 /* plus */:
11111
+ case 63 /* question */:
11112
+ case 40 /* openParen */:
11113
+ case 41 /* closeParen */:
11114
+ case 91 /* openBracket */:
11115
+ case 93 /* closeBracket */:
11116
+ case 123 /* openBrace */:
11117
+ case 125 /* closeBrace */:
11118
+ case 124 /* bar */:
11119
+ pos++;
11120
+ return String.fromCharCode(ch);
11121
+ default:
11122
+ if (pos >= end2 || isLineBreak(ch)) {
11123
+ error2(Diagnostics.Undetermined_character_escape, pos - 1, 1, ch);
11124
+ return "\\";
11125
+ }
11126
+ pos--;
11127
+ return scanEscapeSequence(
11128
+ /*shouldEmitInvalidEscapeError*/
11129
+ unicodeMode,
11130
+ /*isRegularExpression*/
11131
+ true
11132
+ );
11133
+ }
11134
+ }
11135
+ function scanGroupName(isReference) {
11136
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 60 /* lessThan */);
11137
+ tokenStart = pos;
11138
+ scanIdentifier(codePointAt(text2, pos), languageVersion);
11139
+ if (pos === tokenStart) {
11140
+ error2(Diagnostics.Expected_a_capturing_group_name);
11141
+ } else if (isReference) {
11142
+ groupNameReferences.push({ pos: tokenStart, end: pos, name: tokenValue });
11143
+ } else if (namedCapturingGroups.some((group2) => group2.has(tokenValue))) {
11144
+ error2(Diagnostics.Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other, tokenStart, pos - tokenStart);
11145
+ } else {
11146
+ last(namedCapturingGroups).add(tokenValue);
11147
+ groupSpecifiers.add(tokenValue);
11148
+ }
11149
+ }
11150
+ function isClassContentExit(ch) {
11151
+ return ch === 93 /* closeBracket */ || pos >= end2 || isLineBreak(ch);
11152
+ }
11153
+ function scanClassRanges() {
11154
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 91 /* openBracket */);
11155
+ if (text2.charCodeAt(pos) === 94 /* caret */) {
11156
+ pos++;
11157
+ }
11158
+ while (pos < end2) {
11159
+ const ch = text2.charCodeAt(pos);
11160
+ if (isClassContentExit(ch)) {
11161
+ return;
11162
+ }
11163
+ const minStart = pos;
11164
+ const minCharacter = scanClassAtom();
11165
+ if (text2.charCodeAt(pos) === 45 /* minus */) {
11166
+ pos++;
11167
+ const ch2 = text2.charCodeAt(pos);
11168
+ if (isClassContentExit(ch2)) {
11169
+ return;
11170
+ }
11171
+ if (!minCharacter) {
11172
+ error2(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, minStart, pos - 1 - minStart);
11173
+ }
11174
+ const maxStart = pos;
11175
+ const maxCharacter = scanClassAtom();
11176
+ if (!maxCharacter) {
11177
+ error2(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, maxStart, pos - maxStart);
11178
+ continue;
11179
+ }
11180
+ if (!minCharacter) {
11181
+ continue;
11182
+ }
11183
+ const minCharacterValue = codePointAt(minCharacter, 0);
11184
+ const maxCharacterValue = codePointAt(maxCharacter, 0);
11185
+ if (minCharacter.length === charSize(minCharacterValue) && maxCharacter.length === charSize(maxCharacterValue) && minCharacterValue > maxCharacterValue) {
11186
+ error2(Diagnostics.Range_out_of_order_in_character_class, minStart, pos - minStart);
11187
+ }
11188
+ }
11189
+ }
11190
+ }
11191
+ function scanClassSetExpression() {
11192
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 91 /* openBracket */);
11193
+ let isCharacterComplement = false;
11194
+ if (text2.charCodeAt(pos) === 94 /* caret */) {
11195
+ pos++;
11196
+ isCharacterComplement = true;
11197
+ }
11198
+ let expressionMayContainStrings = false;
11199
+ let ch = text2.charCodeAt(pos);
11200
+ if (isClassContentExit(ch)) {
11201
+ return;
11202
+ }
11203
+ let start2 = pos;
11204
+ let oprand;
11205
+ switch (text2.slice(pos, pos + 2)) {
11206
+ case "--":
11207
+ case "&&":
11208
+ error2(Diagnostics.Expected_a_class_set_oprand);
11209
+ mayContainStrings = false;
11210
+ break;
11211
+ default:
11212
+ oprand = scanClassSetOprand();
11213
+ break;
11214
+ }
11215
+ switch (text2.charCodeAt(pos)) {
11216
+ case 45 /* minus */:
11217
+ if (text2.charCodeAt(pos + 1) === 45 /* minus */) {
11218
+ if (isCharacterComplement && mayContainStrings) {
11219
+ error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start2, pos - start2);
11220
+ }
11221
+ expressionMayContainStrings = mayContainStrings;
11222
+ scanClassSetSubExpression(3 /* ClassSubtraction */);
11223
+ mayContainStrings = !isCharacterComplement && expressionMayContainStrings;
11224
+ return;
11225
+ }
11226
+ break;
11227
+ case 38 /* ampersand */:
11228
+ if (text2.charCodeAt(pos + 1) === 38 /* ampersand */) {
11229
+ scanClassSetSubExpression(2 /* ClassIntersection */);
11230
+ if (isCharacterComplement && mayContainStrings) {
11231
+ error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start2, pos - start2);
11232
+ }
11233
+ expressionMayContainStrings = mayContainStrings;
11234
+ mayContainStrings = !isCharacterComplement && expressionMayContainStrings;
11235
+ return;
11236
+ } else {
11237
+ error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
11238
+ }
11239
+ break;
11240
+ default:
11241
+ if (isCharacterComplement && mayContainStrings) {
11242
+ error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start2, pos - start2);
11243
+ }
11244
+ expressionMayContainStrings = mayContainStrings;
11245
+ break;
11246
+ }
11247
+ while (pos < end2) {
11248
+ ch = text2.charCodeAt(pos);
11249
+ switch (ch) {
11250
+ case 45 /* minus */:
11251
+ pos++;
11252
+ ch = text2.charCodeAt(pos);
11253
+ if (isClassContentExit(ch)) {
11254
+ mayContainStrings = !isCharacterComplement && expressionMayContainStrings;
11255
+ return;
11256
+ }
11257
+ if (ch === 45 /* minus */) {
11258
+ pos++;
11259
+ error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2);
11260
+ start2 = pos - 2;
11261
+ oprand = text2.slice(start2, pos);
11262
+ continue;
11263
+ } else {
11264
+ if (!oprand) {
11265
+ error2(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, start2, pos - 1 - start2);
11266
+ }
11267
+ const secondStart = pos;
11268
+ const secondOprand = scanClassSetOprand();
11269
+ if (isCharacterComplement && mayContainStrings) {
11270
+ error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, secondStart, pos - secondStart);
11271
+ }
11272
+ expressionMayContainStrings || (expressionMayContainStrings = mayContainStrings);
11273
+ if (!secondOprand) {
11274
+ error2(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, secondStart, pos - secondStart);
11275
+ break;
11276
+ }
11277
+ if (!oprand) {
11278
+ break;
11279
+ }
11280
+ const minCharacterValue = codePointAt(oprand, 0);
11281
+ const maxCharacterValue = codePointAt(secondOprand, 0);
11282
+ if (oprand.length === charSize(minCharacterValue) && secondOprand.length === charSize(maxCharacterValue) && minCharacterValue > maxCharacterValue) {
11283
+ error2(Diagnostics.Range_out_of_order_in_character_class, start2, pos - start2);
11284
+ }
11285
+ }
11286
+ break;
11287
+ case 38 /* ampersand */:
11288
+ start2 = pos;
11289
+ pos++;
11290
+ if (text2.charCodeAt(pos) === 38 /* ampersand */) {
11291
+ pos++;
11292
+ error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2);
11293
+ if (text2.charCodeAt(pos) === 38 /* ampersand */) {
11294
+ error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
11295
+ pos++;
11296
+ }
11297
+ } else {
11298
+ error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos - 1, 1, String.fromCharCode(ch));
11299
+ }
11300
+ oprand = text2.slice(start2, pos);
11301
+ continue;
11302
+ }
11303
+ if (isClassContentExit(text2.charCodeAt(pos))) {
11304
+ break;
11305
+ }
11306
+ start2 = pos;
11307
+ switch (text2.slice(pos, pos + 2)) {
11308
+ case "--":
11309
+ case "&&":
11310
+ error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos, 2);
11311
+ pos += 2;
11312
+ oprand = text2.slice(start2, pos);
11313
+ break;
11314
+ default:
11315
+ oprand = scanClassSetOprand();
11316
+ break;
11317
+ }
11318
+ }
11319
+ mayContainStrings = !isCharacterComplement && expressionMayContainStrings;
11320
+ }
11321
+ function scanClassSetSubExpression(expressionType) {
11322
+ let expressionMayContainStrings = mayContainStrings;
11323
+ while (pos < end2) {
11324
+ let ch = text2.charCodeAt(pos);
11325
+ if (isClassContentExit(ch)) {
11326
+ break;
11327
+ }
11328
+ switch (ch) {
11329
+ case 45 /* minus */:
11330
+ pos++;
11331
+ if (text2.charCodeAt(pos) === 45 /* minus */) {
11332
+ pos++;
11333
+ if (expressionType !== 3 /* ClassSubtraction */) {
11334
+ error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2);
11335
+ }
11336
+ } else {
11337
+ error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 1, 1);
11338
+ }
11339
+ break;
11340
+ case 38 /* ampersand */:
11341
+ pos++;
11342
+ if (text2.charCodeAt(pos) === 38 /* ampersand */) {
11343
+ pos++;
11344
+ if (expressionType !== 2 /* ClassIntersection */) {
11345
+ error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2);
11346
+ }
11347
+ if (text2.charCodeAt(pos) === 38 /* ampersand */) {
11348
+ error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
11349
+ pos++;
11350
+ }
11351
+ } else {
11352
+ error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos - 1, 1, String.fromCharCode(ch));
11353
+ }
11354
+ break;
11355
+ default:
11356
+ switch (expressionType) {
11357
+ case 3 /* ClassSubtraction */:
11358
+ error2(Diagnostics._0_expected, pos, 0, "--");
11359
+ break;
11360
+ case 2 /* ClassIntersection */:
11361
+ error2(Diagnostics._0_expected, pos, 0, "&&");
11362
+ break;
11363
+ default:
11364
+ break;
11365
+ }
11366
+ break;
11367
+ }
11368
+ ch = text2.charCodeAt(pos);
11369
+ if (isClassContentExit(ch)) {
11370
+ error2(Diagnostics.Expected_a_class_set_oprand);
11371
+ break;
11372
+ }
11373
+ scanClassSetOprand();
11374
+ expressionMayContainStrings && (expressionMayContainStrings = mayContainStrings);
11375
+ }
11376
+ mayContainStrings = expressionMayContainStrings;
11377
+ }
11378
+ function scanClassSetOprand() {
11379
+ mayContainStrings = false;
11380
+ switch (text2.charCodeAt(pos)) {
11381
+ case 91 /* openBracket */:
11382
+ pos++;
11383
+ scanClassSetExpression();
11384
+ scanExpectedChar(93 /* closeBracket */);
11385
+ return "";
11386
+ case 92 /* backslash */:
11387
+ pos++;
11388
+ if (scanCharacterClassEscape()) {
11389
+ return "";
11390
+ } else if (text2.charCodeAt(pos) === 113 /* q */) {
11391
+ pos++;
11392
+ if (text2.charCodeAt(pos) === 123 /* openBrace */) {
11393
+ pos++;
11394
+ scanClassStringDisjunctionContents();
11395
+ scanExpectedChar(125 /* closeBrace */);
11396
+ return "";
11397
+ } else {
11398
+ error2(Diagnostics.q_must_be_followed_by_string_alternatives_enclosed_in_braces, pos - 2, 2);
11399
+ return "q";
11400
+ }
11401
+ }
11402
+ pos--;
11403
+ default:
11404
+ return scanClassSetCharacter();
11405
+ }
11406
+ }
11407
+ function scanClassStringDisjunctionContents() {
11408
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 123 /* openBrace */);
11409
+ let characterCount = 0;
11410
+ while (pos < end2) {
11411
+ const ch = text2.charCodeAt(pos);
11412
+ switch (ch) {
11413
+ case 125 /* closeBrace */:
11414
+ if (characterCount !== 1) {
11415
+ mayContainStrings = true;
11416
+ }
11417
+ return;
11418
+ case 124 /* bar */:
11419
+ if (characterCount !== 1) {
11420
+ mayContainStrings = true;
11421
+ }
11422
+ pos++;
11423
+ start = pos;
11424
+ characterCount = 0;
11425
+ break;
11426
+ default:
11427
+ if (isLineBreak(ch)) {
11428
+ break;
11429
+ }
11430
+ scanClassSetCharacter();
11431
+ characterCount++;
11432
+ break;
11433
+ }
11434
+ }
11435
+ }
11436
+ function scanClassSetCharacter() {
11437
+ const ch = text2.charCodeAt(pos);
11438
+ if (ch === 92 /* backslash */) {
11439
+ pos++;
11440
+ const ch2 = text2.charCodeAt(pos);
11441
+ switch (ch2) {
11442
+ case 98 /* b */:
11443
+ pos++;
11444
+ return "\b";
11445
+ case 38 /* ampersand */:
11446
+ case 45 /* minus */:
11447
+ case 33 /* exclamation */:
11448
+ case 35 /* hash */:
11449
+ case 37 /* percent */:
11450
+ case 44 /* comma */:
11451
+ case 58 /* colon */:
11452
+ case 59 /* semicolon */:
11453
+ case 60 /* lessThan */:
11454
+ case 61 /* equals */:
11455
+ case 62 /* greaterThan */:
11456
+ case 64 /* at */:
11457
+ case 96 /* backtick */:
11458
+ case 126 /* tilde */:
11459
+ pos++;
11460
+ return String.fromCharCode(ch2);
11461
+ default:
11462
+ return scanCharacterEscape();
11463
+ }
11464
+ } else if (ch === text2.charCodeAt(pos + 1)) {
11465
+ switch (ch) {
11466
+ case 38 /* ampersand */:
11467
+ case 33 /* exclamation */:
11468
+ case 35 /* hash */:
11469
+ case 37 /* percent */:
11470
+ case 42 /* asterisk */:
11471
+ case 43 /* plus */:
11472
+ case 44 /* comma */:
11473
+ case 46 /* dot */:
11474
+ case 58 /* colon */:
11475
+ case 59 /* semicolon */:
11476
+ case 60 /* lessThan */:
11477
+ case 61 /* equals */:
11478
+ case 62 /* greaterThan */:
11479
+ case 63 /* question */:
11480
+ case 64 /* at */:
11481
+ case 96 /* backtick */:
11482
+ case 126 /* tilde */:
11483
+ error2(Diagnostics.A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backslash, pos, 2);
11484
+ pos += 2;
11485
+ return text2.substring(pos - 2, pos);
11486
+ }
11487
+ }
11488
+ switch (ch) {
11489
+ case 47 /* slash */:
11490
+ case 40 /* openParen */:
11491
+ case 41 /* closeParen */:
11492
+ case 91 /* openBracket */:
11493
+ case 93 /* closeBracket */:
11494
+ case 123 /* openBrace */:
11495
+ case 125 /* closeBrace */:
11496
+ case 45 /* minus */:
11497
+ case 124 /* bar */:
11498
+ error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
11499
+ pos++;
11500
+ return String.fromCharCode(ch);
11501
+ }
11502
+ return scanSourceCharacter();
11503
+ }
11504
+ function scanClassAtom() {
11505
+ if (text2.charCodeAt(pos) === 92 /* backslash */) {
11506
+ pos++;
11507
+ const ch = text2.charCodeAt(pos);
11508
+ switch (ch) {
11509
+ case 98 /* b */:
11510
+ pos++;
11511
+ return "\b";
11512
+ case 45 /* minus */:
11513
+ pos++;
11514
+ return String.fromCharCode(ch);
11515
+ default:
11516
+ if (scanCharacterClassEscape()) {
11517
+ return "";
11518
+ }
11519
+ return scanCharacterEscape();
11520
+ }
11521
+ } else {
11522
+ return scanSourceCharacter();
11523
+ }
11524
+ }
11525
+ function scanCharacterClassEscape() {
11526
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 92 /* backslash */);
11527
+ let isCharacterComplement = false;
11528
+ const start2 = pos - 1;
11529
+ const ch = text2.charCodeAt(pos);
11530
+ switch (ch) {
11531
+ case 100 /* d */:
11532
+ case 68 /* D */:
11533
+ case 115 /* s */:
11534
+ case 83 /* S */:
11535
+ case 119 /* w */:
11536
+ case 87 /* W */:
11537
+ pos++;
11538
+ return true;
11539
+ case 80 /* P */:
11540
+ isCharacterComplement = true;
11541
+ case 112 /* p */:
11542
+ pos++;
11543
+ if (text2.charCodeAt(pos) === 123 /* openBrace */) {
11544
+ pos++;
11545
+ const propertyNameOrValueStart = pos;
11546
+ const propertyNameOrValue = scanWordCharacters();
11547
+ if (text2.charCodeAt(pos) === 61 /* equals */) {
11548
+ const propertyName = nonBinaryUnicodeProperties.get(propertyNameOrValue);
11549
+ if (pos === propertyNameOrValueStart) {
11550
+ error2(Diagnostics.Expected_a_Unicode_property_name);
11551
+ } else if (propertyName === void 0) {
11552
+ error2(Diagnostics.Unknown_Unicode_property_name, propertyNameOrValueStart, pos - propertyNameOrValueStart);
11553
+ const suggestion = getSpellingSuggestion(propertyNameOrValue, nonBinaryUnicodeProperties.keys(), identity);
11554
+ if (suggestion) {
11555
+ error2(Diagnostics.Did_you_mean_0, propertyNameOrValueStart, pos - propertyNameOrValueStart, suggestion);
11556
+ }
11557
+ }
11558
+ pos++;
11559
+ const propertyValueStart = pos;
11560
+ const propertyValue = scanWordCharacters();
11561
+ if (pos === propertyValueStart) {
11562
+ error2(Diagnostics.Expected_a_Unicode_property_value);
11563
+ } else if (propertyName !== void 0 && !valuesOfNonBinaryUnicodeProperties[propertyName].has(propertyValue)) {
11564
+ error2(Diagnostics.Unknown_Unicode_property_value, propertyValueStart, pos - propertyValueStart);
11565
+ const suggestion = getSpellingSuggestion(propertyValue, valuesOfNonBinaryUnicodeProperties[propertyName], identity);
11566
+ if (suggestion) {
11567
+ error2(Diagnostics.Did_you_mean_0, propertyValueStart, pos - propertyValueStart, suggestion);
11568
+ }
11569
+ }
11570
+ } else {
11571
+ if (pos === propertyNameOrValueStart) {
11572
+ error2(Diagnostics.Expected_a_Unicode_property_name_or_value);
11573
+ } else if (binaryUnicodePropertiesOfStrings.has(propertyNameOrValue)) {
11574
+ if (!unicodeSetsMode) {
11575
+ 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);
11576
+ } else if (isCharacterComplement) {
11577
+ error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, propertyNameOrValueStart, pos - propertyNameOrValueStart);
11578
+ } else {
11579
+ mayContainStrings = true;
11580
+ }
11581
+ } else if (!valuesOfNonBinaryUnicodeProperties.General_Category.has(propertyNameOrValue) && !binaryUnicodeProperties.has(propertyNameOrValue)) {
11582
+ error2(Diagnostics.Unknown_Unicode_property_name_or_value, propertyNameOrValueStart, pos - propertyNameOrValueStart);
11583
+ const suggestion = getSpellingSuggestion(propertyNameOrValue, [...valuesOfNonBinaryUnicodeProperties.General_Category, ...binaryUnicodeProperties, ...binaryUnicodePropertiesOfStrings], identity);
11584
+ if (suggestion) {
11585
+ error2(Diagnostics.Did_you_mean_0, propertyNameOrValueStart, pos - propertyNameOrValueStart, suggestion);
11586
+ }
11587
+ }
11588
+ }
11589
+ scanExpectedChar(125 /* closeBrace */);
11590
+ if (!unicodeMode) {
11591
+ 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);
11592
+ }
11593
+ } else if (unicodeMode) {
11594
+ error2(Diagnostics._0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces, pos - 2, 2, String.fromCharCode(ch));
11595
+ }
11596
+ return true;
11597
+ }
11598
+ return false;
11599
+ }
11600
+ function scanWordCharacters() {
11601
+ let value = "";
11602
+ while (pos < end2) {
11603
+ const ch = text2.charCodeAt(pos);
11604
+ if (!isWordCharacter(ch)) {
11605
+ break;
11606
+ }
11607
+ value += String.fromCharCode(ch);
11608
+ pos++;
11609
+ }
11610
+ return value;
11611
+ }
11612
+ function scanSourceCharacter() {
11613
+ const size = unicodeMode ? charSize(codePointAt(text2, pos)) : 1;
11614
+ pos += size;
11615
+ return text2.substring(pos - size, pos);
11616
+ }
11617
+ function scanExpectedChar(ch) {
11618
+ if (text2.charCodeAt(pos) === ch) {
11619
+ pos++;
11620
+ } else {
11621
+ error2(Diagnostics._0_expected, pos, 0, String.fromCharCode(ch));
11622
+ }
11623
+ }
11624
+ scanDisjunction(
11625
+ /*isInGroup*/
11626
+ false
11627
+ );
11628
+ forEach(groupNameReferences, (reference) => {
11629
+ if (!groupSpecifiers.has(reference.name)) {
11630
+ error2(Diagnostics.There_is_no_capturing_group_named_0_in_this_regular_expression, reference.pos, reference.end - reference.pos, reference.name);
11631
+ }
11632
+ });
11633
+ forEach(decimalEscapes, (escape) => {
11634
+ if (escape.value > numberOfCapturingGroups) {
11635
+ if (numberOfCapturingGroups) {
11636
+ 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);
11637
+ } else {
11638
+ error2(Diagnostics.Decimal_escapes_are_invalid_when_there_are_no_capturing_groups_in_a_regular_expression, escape.pos, escape.end - escape.pos);
11639
+ }
11640
+ }
11641
+ });
11642
+ }
10770
11643
  }
10771
11644
  function appendIfCommentDirective(commentDirectives2, text2, commentDirectiveRegEx, lineStart) {
10772
11645
  const type = getDirectiveFromComment(text2.trimStart(), commentDirectiveRegEx);
@@ -10989,8 +11862,6 @@ ${lanes.join("\n")}
10989
11862
  pos--;
10990
11863
  const extendedCookedChar = peekExtendedUnicodeEscape();
10991
11864
  if (extendedCookedChar >= 0 && isIdentifierStart(extendedCookedChar, languageVersion)) {
10992
- pos += 3;
10993
- tokenFlags |= 8 /* ExtendedUnicodeEscape */;
10994
11865
  tokenValue = scanExtendedUnicodeEscape() + scanIdentifierParts();
10995
11866
  return token = getIdentifierToken();
10996
11867
  }
@@ -11124,7 +11995,7 @@ ${lanes.join("\n")}
11124
11995
  function utf16EncodeAsString(codePoint) {
11125
11996
  return utf16EncodeAsStringWorker(codePoint);
11126
11997
  }
11127
- var textToKeywordObj, textToKeyword, textToToken, unicodeES3IdentifierStart, unicodeES3IdentifierPart, unicodeES5IdentifierStart, unicodeES5IdentifierPart, unicodeESNextIdentifierStart, unicodeESNextIdentifierPart, commentDirectiveRegExSingleLine, commentDirectiveRegExMultiLine, tokenStrings, mergeConflictMarkerLength, shebangTriviaRegex, utf16EncodeAsStringWorker;
11998
+ var textToKeywordObj, textToKeyword, textToToken, charToRegExpFlag, regExpFlagToFirstAvailableLanguageVersion, unicodeES3IdentifierStart, unicodeES3IdentifierPart, unicodeES5IdentifierStart, unicodeES5IdentifierPart, unicodeESNextIdentifierStart, unicodeESNextIdentifierPart, commentDirectiveRegExSingleLine, commentDirectiveRegExMultiLine, tokenStrings, regExpFlagChars, mergeConflictMarkerLength, shebangTriviaRegex, utf16EncodeAsStringWorker, nonBinaryUnicodeProperties, binaryUnicodeProperties, binaryUnicodePropertiesOfStrings, valuesOfNonBinaryUnicodeProperties;
11128
11999
  var init_scanner = __esm({
11129
12000
  "src/compiler/scanner.ts"() {
11130
12001
  "use strict";
@@ -11279,6 +12150,26 @@ ${lanes.join("\n")}
11279
12150
  "#": 63 /* HashToken */,
11280
12151
  "`": 62 /* BacktickToken */
11281
12152
  }));
12153
+ charToRegExpFlag = new Map(Object.entries({
12154
+ d: 1 /* HasIndices */,
12155
+ g: 2 /* Global */,
12156
+ i: 4 /* IgnoreCase */,
12157
+ m: 8 /* Multiline */,
12158
+ s: 16 /* DotAll */,
12159
+ u: 32 /* Unicode */,
12160
+ v: 64 /* UnicodeSets */,
12161
+ y: 128 /* Sticky */
12162
+ }));
12163
+ regExpFlagToFirstAvailableLanguageVersion = /* @__PURE__ */ new Map([
12164
+ [1 /* HasIndices */, 9 /* ES2022 */],
12165
+ [2 /* Global */, 0 /* ES3 */],
12166
+ [4 /* IgnoreCase */, 0 /* ES3 */],
12167
+ [8 /* Multiline */, 0 /* ES3 */],
12168
+ [16 /* DotAll */, 5 /* ES2018 */],
12169
+ [32 /* Unicode */, 2 /* ES2015 */],
12170
+ [64 /* UnicodeSets */, 11 /* ES2024 */],
12171
+ [128 /* Sticky */, 2 /* ES2015 */]
12172
+ ]);
11282
12173
  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];
11283
12174
  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];
11284
12175
  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];
@@ -11288,9 +12179,26 @@ ${lanes.join("\n")}
11288
12179
  commentDirectiveRegExSingleLine = /^\/\/\/?\s*@(ts-expect-error|ts-ignore)/;
11289
12180
  commentDirectiveRegExMultiLine = /^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/;
11290
12181
  tokenStrings = makeReverseMap(textToToken);
12182
+ regExpFlagChars = makeReverseMap(charToRegExpFlag);
11291
12183
  mergeConflictMarkerLength = "<<<<<<<".length;
11292
12184
  shebangTriviaRegex = /^#!.*/;
11293
12185
  utf16EncodeAsStringWorker = String.fromCodePoint ? (codePoint) => String.fromCodePoint(codePoint) : utf16EncodeAsStringFallback;
12186
+ nonBinaryUnicodeProperties = new Map(Object.entries({
12187
+ General_Category: "General_Category",
12188
+ gc: "General_Category",
12189
+ Script: "Script",
12190
+ sc: "Script",
12191
+ Script_Extensions: "Script_Extensions",
12192
+ scx: "Script_Extensions"
12193
+ }));
12194
+ 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"]);
12195
+ 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"]);
12196
+ valuesOfNonBinaryUnicodeProperties = {
12197
+ 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"]),
12198
+ 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"]),
12199
+ Script_Extensions: /* @__PURE__ */ new Set()
12200
+ // Currently empty
12201
+ };
11294
12202
  }
11295
12203
  });
11296
12204
 
@@ -17441,7 +18349,7 @@ ${lanes.join("\n")}
17441
18349
  forEach(objectAllocatorPatchers, (fn) => fn(objectAllocator));
17442
18350
  }
17443
18351
  function formatStringFromArgs(text, args) {
17444
- return text.replace(/{(\d+)}/g, (_match, index) => "" + Debug.checkDefined(args[+index]));
18352
+ return text.replace(/\{(\d+)\}/g, (_match, index) => "" + Debug.checkDefined(args[+index]));
17445
18353
  }
17446
18354
  function setLocalizedDiagnosticMessages(messages) {
17447
18355
  localizedDiagnosticMessages = messages;
@@ -18427,7 +19335,7 @@ ${lanes.join("\n")}
18427
19335
  false
18428
19336
  );
18429
19337
  let success = true;
18430
- scanner2.setOnError(() => success = false);
19338
+ scanner2.setOnError(() => void (success = false));
18431
19339
  scanner2.setText(s + "n");
18432
19340
  let result = scanner2.scan();
18433
19341
  const negative = result === 41 /* MinusToken */;
@@ -29328,7 +30236,10 @@ ${lanes.join("\n")}
29328
30236
  function parseErrorAtPosition(start, length2, message, ...args) {
29329
30237
  const lastError = lastOrUndefined(parseDiagnostics);
29330
30238
  let result;
29331
- if (!lastError || start !== lastError.start) {
30239
+ if (message.category === 3 /* Message */ && lastError && start === lastError.start && length2 === lastError.length) {
30240
+ result = createDetachedDiagnostic(fileName, sourceText, start, length2, message, ...args);
30241
+ addRelatedInfo(lastError, result);
30242
+ } else if (!lastError || start !== lastError.start) {
29332
30243
  result = createDetachedDiagnostic(fileName, sourceText, start, length2, message, ...args);
29333
30244
  parseDiagnostics.push(result);
29334
30245
  }
@@ -29339,10 +30250,10 @@ ${lanes.join("\n")}
29339
30250
  return parseErrorAtPosition(start, end - start, message, ...args);
29340
30251
  }
29341
30252
  function parseErrorAtRange(range, message, ...args) {
29342
- parseErrorAt(range.pos, range.end, message, ...args);
30253
+ return parseErrorAt(range.pos, range.end, message, ...args);
29343
30254
  }
29344
- function scanError(message, length2, arg0) {
29345
- parseErrorAtPosition(scanner2.getTokenEnd(), length2, message, arg0);
30255
+ function scanError(message, pos, length2, ...args) {
30256
+ return parseErrorAtPosition(pos, length2, message, ...args);
29346
30257
  }
29347
30258
  function getNodePos() {
29348
30259
  return scanner2.getTokenFullStart();
@@ -29484,7 +30395,7 @@ ${lanes.join("\n")}
29484
30395
  parseErrorForInvalidName(Diagnostics.Type_alias_name_cannot_be_0, Diagnostics.Type_alias_must_be_given_a_name, 64 /* EqualsToken */);
29485
30396
  return;
29486
30397
  }
29487
- const suggestion = getSpellingSuggestion(expressionText, viableKeywordSuggestions, (n) => n) ?? getSpaceSuggestion(expressionText);
30398
+ const suggestion = getSpellingSuggestion(expressionText, viableKeywordSuggestions, identity) ?? getSpaceSuggestion(expressionText);
29488
30399
  if (suggestion) {
29489
30400
  parseErrorAt(pos, node.end, Diagnostics.Unknown_keyword_or_identifier_Did_you_mean_0, suggestion);
29490
30401
  return;
@@ -133605,6 +134516,21 @@ ${lanes.join("\n")}
133605
134516
  function createPatternMatcher(pattern) {
133606
134517
  const stringToWordSpans = /* @__PURE__ */ new Map();
133607
134518
  const dotSeparatedSegments = pattern.trim().split(".").map((p) => createSegment(p.trim()));
134519
+ if (dotSeparatedSegments.length === 1 && dotSeparatedSegments[0].totalTextChunk.text === "") {
134520
+ return {
134521
+ getMatchForLastSegmentOfPattern: () => createPatternMatch(
134522
+ 2 /* substring */,
134523
+ /*isCaseSensitive*/
134524
+ true
134525
+ ),
134526
+ getFullMatch: () => createPatternMatch(
134527
+ 2 /* substring */,
134528
+ /*isCaseSensitive*/
134529
+ true
134530
+ ),
134531
+ patternContainsDots: false
134532
+ };
134533
+ }
133608
134534
  if (dotSeparatedSegments.some((segment) => !segment.subWordTextChunks.length))
133609
134535
  return void 0;
133610
134536
  return {
@@ -146148,8 +147074,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
146148
147074
  });
146149
147075
 
146150
147076
  // src/services/codefixes/addNameToNamelessParameter.ts
146151
- function makeChange7(changeTracker, sourceFile, pos) {
146152
- const token = getTokenAtPosition(sourceFile, pos);
147077
+ function makeChange7(changeTracker, sourceFile, start) {
147078
+ const token = getTokenAtPosition(sourceFile, start);
146153
147079
  const param = token.parent;
146154
147080
  if (!isParameter(param)) {
146155
147081
  return Debug.fail("Tried to add a parameter name to a non-parameter: " + Debug.formatSyntaxKind(token.kind));
@@ -146157,20 +147083,34 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
146157
147083
  const i = param.parent.parameters.indexOf(param);
146158
147084
  Debug.assert(!param.type, "Tried to add a parameter name to a parameter that already had one.");
146159
147085
  Debug.assert(i > -1, "Parameter not found in parent parameter list.");
146160
- const typeNode = factory.createTypeReferenceNode(
147086
+ let end = param.name.getEnd();
147087
+ let typeNode = factory.createTypeReferenceNode(
146161
147088
  param.name,
146162
147089
  /*typeArguments*/
146163
147090
  void 0
146164
147091
  );
147092
+ let nextParam = tryGetNextParam(sourceFile, param);
147093
+ while (nextParam) {
147094
+ typeNode = factory.createArrayTypeNode(typeNode);
147095
+ end = nextParam.getEnd();
147096
+ nextParam = tryGetNextParam(sourceFile, nextParam);
147097
+ }
146165
147098
  const replacement = factory.createParameterDeclaration(
146166
147099
  param.modifiers,
146167
147100
  param.dotDotDotToken,
146168
147101
  "arg" + i,
146169
147102
  param.questionToken,
146170
- param.dotDotDotToken ? factory.createArrayTypeNode(typeNode) : typeNode,
147103
+ param.dotDotDotToken && !isArrayTypeNode(typeNode) ? factory.createArrayTypeNode(typeNode) : typeNode,
146171
147104
  param.initializer
146172
147105
  );
146173
- changeTracker.replaceNode(sourceFile, param, replacement);
147106
+ changeTracker.replaceRange(sourceFile, createRange(param.getStart(sourceFile), end), replacement);
147107
+ }
147108
+ function tryGetNextParam(sourceFile, param) {
147109
+ const nextToken = findNextToken(param.name, param.parent, sourceFile);
147110
+ if (nextToken && nextToken.kind === 23 /* OpenBracketToken */ && isArrayBindingPattern(nextToken.parent) && isParameter(nextToken.parent.parent)) {
147111
+ return nextToken.parent.parent;
147112
+ }
147113
+ return void 0;
146174
147114
  }
146175
147115
  var fixId7, errorCodes7;
146176
147116
  var init_addNameToNamelessParameter = __esm({
@@ -183203,6 +184143,7 @@ ${e.message}`;
183203
184143
  PrivateIdentifierKind: () => PrivateIdentifierKind,
183204
184144
  ProcessLevel: () => ProcessLevel,
183205
184145
  QuotePreference: () => QuotePreference,
184146
+ RegularExpressionFlags: () => RegularExpressionFlags,
183206
184147
  RelationComparisonResult: () => RelationComparisonResult,
183207
184148
  Rename: () => ts_Rename_exports,
183208
184149
  ScriptElementKind: () => ScriptElementKind,
@@ -183329,6 +184270,7 @@ ${e.message}`;
183329
184270
  changeExtension: () => changeExtension,
183330
184271
  changesAffectModuleResolution: () => changesAffectModuleResolution,
183331
184272
  changesAffectingProgramStructure: () => changesAffectingProgramStructure,
184273
+ characterToRegularExpressionFlag: () => characterToRegularExpressionFlag,
183332
184274
  childIsDecorated: () => childIsDecorated,
183333
184275
  classElementOrClassElementParameterIsDecorated: () => classElementOrClassElementParameterIsDecorated,
183334
184276
  classHasClassThisAssignment: () => classHasClassThisAssignment,
@@ -185086,6 +186028,7 @@ ${e.message}`;
185086
186028
  reducePathComponents: () => reducePathComponents,
185087
186029
  refactor: () => ts_refactor_exports,
185088
186030
  regExpEscape: () => regExpEscape,
186031
+ regularExpressionFlagToCharacter: () => regularExpressionFlagToCharacter,
185089
186032
  relativeComplement: () => relativeComplement,
185090
186033
  removeAllComments: () => removeAllComments,
185091
186034
  removeEmitHelper: () => removeEmitHelper,
@@ -185606,6 +186549,7 @@ ${e.message}`;
185606
186549
  PrivateIdentifierKind: () => PrivateIdentifierKind,
185607
186550
  ProcessLevel: () => ProcessLevel,
185608
186551
  QuotePreference: () => QuotePreference,
186552
+ RegularExpressionFlags: () => RegularExpressionFlags,
185609
186553
  RelationComparisonResult: () => RelationComparisonResult,
185610
186554
  Rename: () => ts_Rename_exports,
185611
186555
  ScriptElementKind: () => ScriptElementKind,
@@ -185732,6 +186676,7 @@ ${e.message}`;
185732
186676
  changeExtension: () => changeExtension,
185733
186677
  changesAffectModuleResolution: () => changesAffectModuleResolution,
185734
186678
  changesAffectingProgramStructure: () => changesAffectingProgramStructure,
186679
+ characterToRegularExpressionFlag: () => characterToRegularExpressionFlag,
185735
186680
  childIsDecorated: () => childIsDecorated,
185736
186681
  classElementOrClassElementParameterIsDecorated: () => classElementOrClassElementParameterIsDecorated,
185737
186682
  classHasClassThisAssignment: () => classHasClassThisAssignment,
@@ -187489,6 +188434,7 @@ ${e.message}`;
187489
188434
  reducePathComponents: () => reducePathComponents,
187490
188435
  refactor: () => ts_refactor_exports,
187491
188436
  regExpEscape: () => regExpEscape,
188437
+ regularExpressionFlagToCharacter: () => regularExpressionFlagToCharacter,
187492
188438
  relativeComplement: () => relativeComplement,
187493
188439
  removeAllComments: () => removeAllComments,
187494
188440
  removeEmitHelper: () => removeEmitHelper,