@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/tsserver.js CHANGED
@@ -147,6 +147,7 @@ __export(server_exports, {
147
147
  PrivateIdentifierKind: () => PrivateIdentifierKind,
148
148
  ProcessLevel: () => ProcessLevel,
149
149
  QuotePreference: () => QuotePreference,
150
+ RegularExpressionFlags: () => RegularExpressionFlags,
150
151
  RelationComparisonResult: () => RelationComparisonResult,
151
152
  Rename: () => ts_Rename_exports,
152
153
  ScriptElementKind: () => ScriptElementKind,
@@ -273,6 +274,7 @@ __export(server_exports, {
273
274
  changeExtension: () => changeExtension,
274
275
  changesAffectModuleResolution: () => changesAffectModuleResolution,
275
276
  changesAffectingProgramStructure: () => changesAffectingProgramStructure,
277
+ characterToRegularExpressionFlag: () => characterToRegularExpressionFlag,
276
278
  childIsDecorated: () => childIsDecorated,
277
279
  classElementOrClassElementParameterIsDecorated: () => classElementOrClassElementParameterIsDecorated,
278
280
  classHasClassThisAssignment: () => classHasClassThisAssignment,
@@ -2030,6 +2032,7 @@ __export(server_exports, {
2030
2032
  reducePathComponents: () => reducePathComponents,
2031
2033
  refactor: () => ts_refactor_exports,
2032
2034
  regExpEscape: () => regExpEscape,
2035
+ regularExpressionFlagToCharacter: () => regularExpressionFlagToCharacter,
2033
2036
  relativeComplement: () => relativeComplement,
2034
2037
  removeAllComments: () => removeAllComments,
2035
2038
  removeEmitHelper: () => removeEmitHelper,
@@ -2327,7 +2330,7 @@ module.exports = __toCommonJS(server_exports);
2327
2330
 
2328
2331
  // src/compiler/corePublic.ts
2329
2332
  var versionMajorMinor = "5.3";
2330
- var version = `${versionMajorMinor}.0-insiders.20230830`;
2333
+ var version = `${versionMajorMinor}.0-insiders.20230901`;
2331
2334
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2332
2335
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2333
2336
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -6239,6 +6242,20 @@ var GeneratedIdentifierFlags = /* @__PURE__ */ ((GeneratedIdentifierFlags2) => {
6239
6242
  GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["AllowNameSubstitution"] = 64] = "AllowNameSubstitution";
6240
6243
  return GeneratedIdentifierFlags2;
6241
6244
  })(GeneratedIdentifierFlags || {});
6245
+ var RegularExpressionFlags = /* @__PURE__ */ ((RegularExpressionFlags2) => {
6246
+ RegularExpressionFlags2[RegularExpressionFlags2["None"] = 0] = "None";
6247
+ RegularExpressionFlags2[RegularExpressionFlags2["HasIndices"] = 1] = "HasIndices";
6248
+ RegularExpressionFlags2[RegularExpressionFlags2["Global"] = 2] = "Global";
6249
+ RegularExpressionFlags2[RegularExpressionFlags2["IgnoreCase"] = 4] = "IgnoreCase";
6250
+ RegularExpressionFlags2[RegularExpressionFlags2["Multiline"] = 8] = "Multiline";
6251
+ RegularExpressionFlags2[RegularExpressionFlags2["DotAll"] = 16] = "DotAll";
6252
+ RegularExpressionFlags2[RegularExpressionFlags2["Unicode"] = 32] = "Unicode";
6253
+ RegularExpressionFlags2[RegularExpressionFlags2["UnicodeSets"] = 64] = "UnicodeSets";
6254
+ RegularExpressionFlags2[RegularExpressionFlags2["Sticky"] = 128] = "Sticky";
6255
+ RegularExpressionFlags2[RegularExpressionFlags2["UnicodeMode"] = 96] = "UnicodeMode";
6256
+ RegularExpressionFlags2[RegularExpressionFlags2["Modifiers"] = 28] = "Modifiers";
6257
+ return RegularExpressionFlags2;
6258
+ })(RegularExpressionFlags || {});
6242
6259
  var TokenFlags = /* @__PURE__ */ ((TokenFlags2) => {
6243
6260
  TokenFlags2[TokenFlags2["None"] = 0] = "None";
6244
6261
  TokenFlags2[TokenFlags2["PrecedingLineBreak"] = 1] = "PrecedingLineBreak";
@@ -6946,6 +6963,8 @@ var ScriptTarget = /* @__PURE__ */ ((ScriptTarget11) => {
6946
6963
  ScriptTarget11[ScriptTarget11["ES2020"] = 7] = "ES2020";
6947
6964
  ScriptTarget11[ScriptTarget11["ES2021"] = 8] = "ES2021";
6948
6965
  ScriptTarget11[ScriptTarget11["ES2022"] = 9] = "ES2022";
6966
+ ScriptTarget11[ScriptTarget11["ES2023"] = 10] = "ES2023";
6967
+ ScriptTarget11[ScriptTarget11["ES2024"] = 11] = "ES2024";
6949
6968
  ScriptTarget11[ScriptTarget11["ESNext"] = 99] = "ESNext";
6950
6969
  ScriptTarget11[ScriptTarget11["JSON"] = 100] = "JSON";
6951
6970
  ScriptTarget11[ScriptTarget11["Latest"] = 99 /* ESNext */] = "Latest";
@@ -9610,6 +9629,43 @@ var Diagnostics = {
9610
9629
  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."),
9611
9630
  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."),
9612
9631
  _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."),
9632
+ _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."),
9633
+ Unknown_regular_expression_flag: diag(1497, 1 /* Error */, "Unknown_regular_expression_flag_1497", "Unknown regular expression flag."),
9634
+ Duplicate_regular_expression_flag: diag(1498, 1 /* Error */, "Duplicate_regular_expression_flag_1498", "Duplicate regular expression flag."),
9635
+ 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."),
9636
+ 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."),
9637
+ 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."),
9638
+ 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."),
9639
+ Incomplete_quantifier_Digit_expected: diag(1503, 1 /* Error */, "Incomplete_quantifier_Digit_expected_1503", "Incomplete quantifier. Digit expected."),
9640
+ Numbers_out_of_order_in_quantifier: diag(1504, 1 /* Error */, "Numbers_out_of_order_in_quantifier_1504", "Numbers out of order in quantifier."),
9641
+ There_is_nothing_available_for_repetition: diag(1505, 1 /* Error */, "There_is_nothing_available_for_repetition_1505", "There is nothing available for repetition."),
9642
+ 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?"),
9643
+ 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."),
9644
+ 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."),
9645
+ 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."),
9646
+ 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."),
9647
+ Undetermined_character_escape: diag(1511, 1 /* Error */, "Undetermined_character_escape_1511", "Undetermined character escape."),
9648
+ Expected_a_capturing_group_name: diag(1512, 1 /* Error */, "Expected_a_capturing_group_name_1512", "Expected a capturing group name."),
9649
+ 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."),
9650
+ 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."),
9651
+ 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."),
9652
+ 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."),
9653
+ 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."),
9654
+ Expected_a_class_set_oprand: diag(1518, 1 /* Error */, "Expected_a_class_set_oprand_1518", "Expected a class set oprand."),
9655
+ 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."),
9656
+ 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?"),
9657
+ Expected_a_Unicode_property_name: diag(1521, 1 /* Error */, "Expected_a_Unicode_property_name_1521", "Expected a Unicode property name."),
9658
+ Unknown_Unicode_property_name: diag(1522, 1 /* Error */, "Unknown_Unicode_property_name_1522", "Unknown Unicode property name."),
9659
+ Expected_a_Unicode_property_value: diag(1523, 1 /* Error */, "Expected_a_Unicode_property_value_1523", "Expected a Unicode property value."),
9660
+ Unknown_Unicode_property_value: diag(1524, 1 /* Error */, "Unknown_Unicode_property_value_1524", "Unknown Unicode property value."),
9661
+ 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."),
9662
+ 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."),
9663
+ Unknown_Unicode_property_name_or_value: diag(1527, 1 /* Error */, "Unknown_Unicode_property_name_or_value_1527", "Unknown Unicode property name or value."),
9664
+ 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."),
9665
+ _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."),
9666
+ 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."),
9667
+ 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."),
9668
+ 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."),
9613
9669
  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."),
9614
9670
  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."),
9615
9671
  Call_signature_return_types_0_and_1_are_incompatible: diag(
@@ -11443,6 +11499,26 @@ var textToToken = new Map(Object.entries({
11443
11499
  "#": 63 /* HashToken */,
11444
11500
  "`": 62 /* BacktickToken */
11445
11501
  }));
11502
+ var charToRegExpFlag = new Map(Object.entries({
11503
+ d: 1 /* HasIndices */,
11504
+ g: 2 /* Global */,
11505
+ i: 4 /* IgnoreCase */,
11506
+ m: 8 /* Multiline */,
11507
+ s: 16 /* DotAll */,
11508
+ u: 32 /* Unicode */,
11509
+ v: 64 /* UnicodeSets */,
11510
+ y: 128 /* Sticky */
11511
+ }));
11512
+ var regExpFlagToFirstAvailableLanguageVersion = /* @__PURE__ */ new Map([
11513
+ [1 /* HasIndices */, 9 /* ES2022 */],
11514
+ [2 /* Global */, 0 /* ES3 */],
11515
+ [4 /* IgnoreCase */, 0 /* ES3 */],
11516
+ [8 /* Multiline */, 0 /* ES3 */],
11517
+ [16 /* DotAll */, 5 /* ES2018 */],
11518
+ [32 /* Unicode */, 2 /* ES2015 */],
11519
+ [64 /* UnicodeSets */, 11 /* ES2024 */],
11520
+ [128 /* Sticky */, 2 /* ES2015 */]
11521
+ ]);
11446
11522
  var 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];
11447
11523
  var 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];
11448
11524
  var 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];
@@ -11492,6 +11568,16 @@ function tokenToString(t) {
11492
11568
  function stringToToken(s) {
11493
11569
  return textToToken.get(s);
11494
11570
  }
11571
+ var regExpFlagChars = makeReverseMap(charToRegExpFlag);
11572
+ function regularExpressionFlagToCharacter(f) {
11573
+ return regExpFlagChars[f];
11574
+ }
11575
+ function characterToRegularExpressionFlag(c) {
11576
+ return charToRegExpFlag.get(c);
11577
+ }
11578
+ function regularExpressionFlagToFirstAvailableLanguageVersion(f) {
11579
+ return regExpFlagToFirstAvailableLanguageVersion.get(f);
11580
+ }
11495
11581
  function computeLineStarts(text) {
11496
11582
  const result = [];
11497
11583
  let pos = 0;
@@ -11588,8 +11674,11 @@ function isDigit(ch) {
11588
11674
  function isHexDigit(ch) {
11589
11675
  return isDigit(ch) || ch >= 65 /* A */ && ch <= 70 /* F */ || ch >= 97 /* a */ && ch <= 102 /* f */;
11590
11676
  }
11591
- function isCodePoint(code) {
11592
- return code <= 1114111;
11677
+ function isASCIILetter(ch) {
11678
+ return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */;
11679
+ }
11680
+ function isWordCharacter(ch) {
11681
+ return isASCIILetter(ch) || isDigit(ch) || ch === 95 /* _ */;
11593
11682
  }
11594
11683
  function isOctalDigit(ch) {
11595
11684
  return ch >= 48 /* _0 */ && ch <= 55 /* _7 */;
@@ -11928,10 +12017,10 @@ function getShebang(text) {
11928
12017
  }
11929
12018
  }
11930
12019
  function isIdentifierStart(ch, languageVersion) {
11931
- return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion);
12020
+ return isASCIILetter(ch) || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion);
11932
12021
  }
11933
12022
  function isIdentifierPart(ch, languageVersion, identifierVariant) {
11934
- 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
12023
+ return isWordCharacter(ch) || ch === 36 /* $ */ || // "-" and ":" are valid in JSX Identifiers
11935
12024
  (identifierVariant === 1 /* JSX */ ? ch === 45 /* minus */ || ch === 58 /* colon */ : false) || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion);
11936
12025
  }
11937
12026
  function isIdentifierText(name, languageVersion, identifierVariant) {
@@ -12017,13 +12106,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
12017
12106
  });
12018
12107
  }
12019
12108
  return scanner2;
12020
- function error2(message, errPos = pos, length3, arg0) {
12021
- if (onError) {
12022
- const oldPos = pos;
12023
- pos = errPos;
12024
- onError(message, length3 || 0, arg0);
12025
- pos = oldPos;
12026
- }
12109
+ function error2(message, errPos = pos, length3 = 0, ...args) {
12110
+ return onError == null ? void 0 : onError(message, errPos, length3, ...args);
12027
12111
  }
12028
12112
  function scanNumberFragment() {
12029
12113
  let start3 = pos;
@@ -12248,7 +12332,9 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
12248
12332
  result += text.substring(start3, pos);
12249
12333
  result += scanEscapeSequence(
12250
12334
  /*shouldEmitInvalidEscapeError*/
12251
- true
12335
+ true,
12336
+ /*isRegularExpression*/
12337
+ false
12252
12338
  );
12253
12339
  start3 = pos;
12254
12340
  continue;
@@ -12292,7 +12378,11 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
12292
12378
  }
12293
12379
  if (currChar === 92 /* backslash */) {
12294
12380
  contents += text.substring(start3, pos);
12295
- contents += scanEscapeSequence(shouldEmitInvalidEscapeError);
12381
+ contents += scanEscapeSequence(
12382
+ shouldEmitInvalidEscapeError,
12383
+ /*isRegularExpression*/
12384
+ false
12385
+ );
12296
12386
  start3 = pos;
12297
12387
  continue;
12298
12388
  }
@@ -12312,7 +12402,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
12312
12402
  tokenValue = contents;
12313
12403
  return resultingToken;
12314
12404
  }
12315
- function scanEscapeSequence(shouldEmitInvalidEscapeError) {
12405
+ function scanEscapeSequence(shouldEmitInvalidEscapeError, isRegularExpression) {
12316
12406
  const start3 = pos;
12317
12407
  pos++;
12318
12408
  if (pos >= end) {
@@ -12371,45 +12461,9 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
12371
12461
  case 34 /* doubleQuote */:
12372
12462
  return '"';
12373
12463
  case 117 /* u */:
12374
- if (pos < end && text.charCodeAt(pos) === 123 /* openBrace */) {
12375
- pos++;
12376
- const escapedValueString = scanMinimumNumberOfHexDigits(
12377
- 1,
12378
- /*canHaveSeparators*/
12379
- false
12380
- );
12381
- const escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1;
12382
- if (escapedValue < 0) {
12383
- tokenFlags |= 2048 /* ContainsInvalidEscape */;
12384
- if (shouldEmitInvalidEscapeError) {
12385
- error2(Diagnostics.Hexadecimal_digit_expected);
12386
- }
12387
- return text.substring(start3, pos);
12388
- }
12389
- if (!isCodePoint(escapedValue)) {
12390
- tokenFlags |= 2048 /* ContainsInvalidEscape */;
12391
- if (shouldEmitInvalidEscapeError) {
12392
- error2(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive);
12393
- }
12394
- return text.substring(start3, pos);
12395
- }
12396
- if (pos >= end) {
12397
- tokenFlags |= 2048 /* ContainsInvalidEscape */;
12398
- if (shouldEmitInvalidEscapeError) {
12399
- error2(Diagnostics.Unexpected_end_of_text);
12400
- }
12401
- return text.substring(start3, pos);
12402
- }
12403
- if (text.charCodeAt(pos) !== 125 /* closeBrace */) {
12404
- tokenFlags |= 2048 /* ContainsInvalidEscape */;
12405
- if (shouldEmitInvalidEscapeError) {
12406
- error2(Diagnostics.Unterminated_Unicode_escape_sequence);
12407
- }
12408
- return text.substring(start3, pos);
12409
- }
12410
- pos++;
12411
- tokenFlags |= 8 /* ExtendedUnicodeEscape */;
12412
- return utf16EncodeAsString(escapedValue);
12464
+ if ((!isRegularExpression || shouldEmitInvalidEscapeError) && pos < end && text.charCodeAt(pos) === 123 /* openBrace */) {
12465
+ pos -= 2;
12466
+ return scanExtendedUnicodeEscape(shouldEmitInvalidEscapeError);
12413
12467
  }
12414
12468
  for (; pos < start3 + 6; pos++) {
12415
12469
  if (!(pos < end && isHexDigit(text.charCodeAt(pos)))) {
@@ -12421,7 +12475,23 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
12421
12475
  }
12422
12476
  }
12423
12477
  tokenFlags |= 1024 /* UnicodeEscape */;
12424
- return String.fromCharCode(parseInt(text.substring(start3 + 2, pos), 16));
12478
+ const escapedValue = parseInt(text.substring(start3 + 2, pos), 16);
12479
+ const escapedValueString = String.fromCharCode(escapedValue);
12480
+ if (isRegularExpression && shouldEmitInvalidEscapeError && escapedValue >= 55296 && escapedValue <= 56319 && pos + 6 < end && text.substring(pos, pos + 2) === "\\u" && text.charCodeAt(pos + 2) !== 123 /* openBrace */) {
12481
+ const nextStart = pos;
12482
+ let nextPos = pos + 2;
12483
+ for (; nextPos < nextStart + 6; nextPos++) {
12484
+ if (!isHexDigit(text.charCodeAt(pos))) {
12485
+ return escapedValueString;
12486
+ }
12487
+ }
12488
+ const nextEscapedValue = parseInt(text.substring(nextStart + 2, nextPos), 16);
12489
+ if (nextEscapedValue >= 56320 && nextEscapedValue <= 57343) {
12490
+ pos = nextPos;
12491
+ return escapedValueString + String.fromCharCode(nextEscapedValue);
12492
+ }
12493
+ }
12494
+ return escapedValueString;
12425
12495
  case 120 /* x */:
12426
12496
  for (; pos < start3 + 4; pos++) {
12427
12497
  if (!(pos < end && isHexDigit(text.charCodeAt(pos)))) {
@@ -12443,10 +12513,16 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
12443
12513
  case 8233 /* paragraphSeparator */:
12444
12514
  return "";
12445
12515
  default:
12516
+ if (isRegularExpression && (shouldEmitInvalidEscapeError || isIdentifierPart(ch, languageVersion))) {
12517
+ error2(Diagnostics._0_is_not_a_valid_character_escape, pos - 2, 2, String.fromCharCode(ch));
12518
+ }
12446
12519
  return String.fromCharCode(ch);
12447
12520
  }
12448
12521
  }
12449
- function scanExtendedUnicodeEscape() {
12522
+ function scanExtendedUnicodeEscape(shouldEmitInvalidEscapeError = true) {
12523
+ const start3 = pos;
12524
+ pos += 3;
12525
+ const escapedStart = pos;
12450
12526
  const escapedValueString = scanMinimumNumberOfHexDigits(
12451
12527
  1,
12452
12528
  /*canHaveSeparators*/
@@ -12455,24 +12531,34 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
12455
12531
  const escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1;
12456
12532
  let isInvalidExtendedEscape = false;
12457
12533
  if (escapedValue < 0) {
12458
- error2(Diagnostics.Hexadecimal_digit_expected);
12534
+ if (shouldEmitInvalidEscapeError) {
12535
+ error2(Diagnostics.Hexadecimal_digit_expected);
12536
+ }
12459
12537
  isInvalidExtendedEscape = true;
12460
12538
  } else if (escapedValue > 1114111) {
12461
- error2(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive);
12539
+ if (shouldEmitInvalidEscapeError) {
12540
+ error2(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive, escapedStart, pos - escapedStart);
12541
+ }
12462
12542
  isInvalidExtendedEscape = true;
12463
12543
  }
12464
12544
  if (pos >= end) {
12465
- error2(Diagnostics.Unexpected_end_of_text);
12545
+ if (shouldEmitInvalidEscapeError) {
12546
+ error2(Diagnostics.Unexpected_end_of_text);
12547
+ }
12466
12548
  isInvalidExtendedEscape = true;
12467
12549
  } else if (text.charCodeAt(pos) === 125 /* closeBrace */) {
12468
12550
  pos++;
12469
12551
  } else {
12470
- error2(Diagnostics.Unterminated_Unicode_escape_sequence);
12552
+ if (shouldEmitInvalidEscapeError) {
12553
+ error2(Diagnostics.Unterminated_Unicode_escape_sequence);
12554
+ }
12471
12555
  isInvalidExtendedEscape = true;
12472
12556
  }
12473
12557
  if (isInvalidExtendedEscape) {
12474
- return "";
12558
+ tokenFlags |= 2048 /* ContainsInvalidEscape */;
12559
+ return text.substring(start3, pos);
12475
12560
  }
12561
+ tokenFlags |= 8 /* ExtendedUnicodeEscape */;
12476
12562
  return utf16EncodeAsString(escapedValue);
12477
12563
  }
12478
12564
  function peekUnicodeEscape() {
@@ -12514,8 +12600,6 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
12514
12600
  } else if (ch === 92 /* backslash */) {
12515
12601
  ch = peekExtendedUnicodeEscape();
12516
12602
  if (ch >= 0 && isIdentifierPart(ch, languageVersion)) {
12517
- pos += 3;
12518
- tokenFlags |= 8 /* ExtendedUnicodeEscape */;
12519
12603
  result += scanExtendedUnicodeEscape();
12520
12604
  start3 = pos;
12521
12605
  continue;
@@ -12985,8 +13069,6 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
12985
13069
  case 92 /* backslash */:
12986
13070
  const extendedCookedChar = peekExtendedUnicodeEscape();
12987
13071
  if (extendedCookedChar >= 0 && isIdentifierStart(extendedCookedChar, languageVersion)) {
12988
- pos += 3;
12989
- tokenFlags |= 8 /* ExtendedUnicodeEscape */;
12990
13072
  tokenValue = scanExtendedUnicodeEscape() + scanIdentifierParts();
12991
13073
  return token = getIdentifierToken();
12992
13074
  }
@@ -13002,7 +13084,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
13002
13084
  return token = 0 /* Unknown */;
13003
13085
  case 35 /* hash */:
13004
13086
  if (pos !== 0 && text[pos + 1] === "!") {
13005
- error2(Diagnostics.can_only_be_used_at_the_start_of_a_file);
13087
+ error2(Diagnostics.can_only_be_used_at_the_start_of_a_file, pos, 2);
13006
13088
  pos++;
13007
13089
  return token = 0 /* Unknown */;
13008
13090
  }
@@ -13011,8 +13093,6 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
13011
13093
  pos++;
13012
13094
  const extendedCookedChar2 = peekExtendedUnicodeEscape();
13013
13095
  if (extendedCookedChar2 >= 0 && isIdentifierStart(extendedCookedChar2, languageVersion)) {
13014
- pos += 3;
13015
- tokenFlags |= 8 /* ExtendedUnicodeEscape */;
13016
13096
  tokenValue = "#" + scanExtendedUnicodeEscape() + scanIdentifierParts();
13017
13097
  return token = 81 /* PrivateIdentifier */;
13018
13098
  }
@@ -13135,14 +13215,831 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
13135
13215
  }
13136
13216
  p++;
13137
13217
  }
13138
- while (p < end && isIdentifierPart(text.charCodeAt(p), languageVersion)) {
13218
+ const isUnterminated = !!(tokenFlags & 4 /* Unterminated */);
13219
+ const endOfBody = p - (isUnterminated ? 0 : 1);
13220
+ let regExpFlags = 0 /* None */;
13221
+ while (p < end) {
13222
+ const ch = text.charCodeAt(p);
13223
+ if (!isIdentifierPart(ch, languageVersion)) {
13224
+ break;
13225
+ }
13226
+ const flag = characterToRegularExpressionFlag(String.fromCharCode(ch));
13227
+ if (flag === void 0) {
13228
+ error2(Diagnostics.Unknown_regular_expression_flag, p, 1);
13229
+ } else if (regExpFlags & flag) {
13230
+ error2(Diagnostics.Duplicate_regular_expression_flag, p, 1);
13231
+ } else if (((regExpFlags | flag) & 96 /* UnicodeMode */) === 96 /* UnicodeMode */) {
13232
+ error2(Diagnostics.The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously, p, 1);
13233
+ } else {
13234
+ regExpFlags |= flag;
13235
+ const availableFrom = regularExpressionFlagToFirstAvailableLanguageVersion(flag);
13236
+ if (languageVersion < availableFrom) {
13237
+ error2(Diagnostics.This_regular_expression_flag_is_only_available_when_targeting_0_or_later, p, 1, ScriptTarget[availableFrom]);
13238
+ }
13239
+ }
13139
13240
  p++;
13140
13241
  }
13141
- pos = p;
13242
+ pos = tokenStart + 1;
13243
+ const saveTokenPos = tokenStart;
13244
+ const saveTokenFlags = tokenFlags;
13245
+ scanRegularExpressionWorker(text.slice(0, endOfBody), endOfBody, regExpFlags, isUnterminated);
13246
+ if (!isUnterminated) {
13247
+ pos = p;
13248
+ }
13249
+ tokenStart = saveTokenPos;
13250
+ tokenFlags = saveTokenFlags;
13142
13251
  tokenValue = text.substring(tokenStart, pos);
13143
13252
  token = 14 /* RegularExpressionLiteral */;
13144
13253
  }
13145
13254
  return token;
13255
+ function scanRegularExpressionWorker(text2, end2, regExpFlags, isUnterminated) {
13256
+ const unicodeMode = !!(regExpFlags & 96 /* UnicodeMode */);
13257
+ const unicodeSetsMode = !!(regExpFlags & 64 /* UnicodeSets */);
13258
+ let mayContainStrings = false;
13259
+ let numberOfCapturingGroups = 0;
13260
+ const groupSpecifiers = /* @__PURE__ */ new Set();
13261
+ const groupNameReferences = [];
13262
+ const decimalEscapes = [];
13263
+ const namedCapturingGroups = [];
13264
+ function scanDisjunction(isInGroup) {
13265
+ while (true) {
13266
+ namedCapturingGroups.push(/* @__PURE__ */ new Set());
13267
+ scanAlternative(isInGroup);
13268
+ namedCapturingGroups.pop();
13269
+ if (text2.charCodeAt(pos) !== 124 /* bar */) {
13270
+ return;
13271
+ }
13272
+ pos++;
13273
+ }
13274
+ }
13275
+ function scanAlternative(isInGroup) {
13276
+ let isPreviousTermQuantifiable = false;
13277
+ while (pos < end2) {
13278
+ const start3 = pos;
13279
+ const ch = text2.charCodeAt(pos);
13280
+ switch (ch) {
13281
+ case 94 /* caret */:
13282
+ case 36 /* $ */:
13283
+ pos++;
13284
+ isPreviousTermQuantifiable = false;
13285
+ break;
13286
+ case 92 /* backslash */:
13287
+ pos++;
13288
+ switch (text2.charCodeAt(pos)) {
13289
+ case 98 /* b */:
13290
+ case 66 /* B */:
13291
+ pos++;
13292
+ isPreviousTermQuantifiable = false;
13293
+ break;
13294
+ default:
13295
+ scanAtomEscape();
13296
+ isPreviousTermQuantifiable = true;
13297
+ break;
13298
+ }
13299
+ break;
13300
+ case 40 /* openParen */:
13301
+ pos++;
13302
+ if (text2.charCodeAt(pos) === 63 /* question */) {
13303
+ pos++;
13304
+ switch (text2.charCodeAt(pos)) {
13305
+ case 61 /* equals */:
13306
+ case 33 /* exclamation */:
13307
+ pos++;
13308
+ isPreviousTermQuantifiable = false;
13309
+ break;
13310
+ case 60 /* lessThan */:
13311
+ const groupNameStart = pos;
13312
+ pos++;
13313
+ switch (text2.charCodeAt(pos)) {
13314
+ case 61 /* equals */:
13315
+ case 33 /* exclamation */:
13316
+ pos++;
13317
+ isPreviousTermQuantifiable = false;
13318
+ break;
13319
+ default:
13320
+ scanGroupName(
13321
+ /*isReference*/
13322
+ false
13323
+ );
13324
+ scanExpectedChar(62 /* greaterThan */);
13325
+ if (languageVersion < 5 /* ES2018 */) {
13326
+ error2(Diagnostics.Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later, groupNameStart, pos - groupNameStart);
13327
+ }
13328
+ numberOfCapturingGroups++;
13329
+ isPreviousTermQuantifiable = true;
13330
+ break;
13331
+ }
13332
+ break;
13333
+ default:
13334
+ const start4 = pos;
13335
+ const setFlags = scanPatternModifiers();
13336
+ if (text2.charCodeAt(pos) === 45 /* minus */) {
13337
+ pos++;
13338
+ scanPatternModifiers(setFlags);
13339
+ if (pos === start4 + 1) {
13340
+ error2(Diagnostics.Subpattern_flags_must_be_present_when_there_is_a_minus_sign, start4, pos - start4);
13341
+ }
13342
+ }
13343
+ scanExpectedChar(58 /* colon */);
13344
+ isPreviousTermQuantifiable = true;
13345
+ break;
13346
+ }
13347
+ } else {
13348
+ numberOfCapturingGroups++;
13349
+ isPreviousTermQuantifiable = true;
13350
+ }
13351
+ scanDisjunction(
13352
+ /*isInGroup*/
13353
+ true
13354
+ );
13355
+ scanExpectedChar(41 /* closeParen */);
13356
+ break;
13357
+ case 123 /* openBrace */:
13358
+ pos++;
13359
+ const digitsStart = pos;
13360
+ scanDigits();
13361
+ const min2 = tokenValue;
13362
+ if (!min2) {
13363
+ error2(Diagnostics.Incomplete_quantifier_Digit_expected);
13364
+ }
13365
+ if (text2.charCodeAt(pos) === 44 /* comma */) {
13366
+ pos++;
13367
+ scanDigits();
13368
+ const max = tokenValue;
13369
+ if (max && Number.parseInt(min2) > Number.parseInt(max)) {
13370
+ error2(Diagnostics.Numbers_out_of_order_in_quantifier, digitsStart, pos - digitsStart);
13371
+ }
13372
+ }
13373
+ scanExpectedChar(125 /* closeBrace */);
13374
+ pos--;
13375
+ case 42 /* asterisk */:
13376
+ case 43 /* plus */:
13377
+ case 63 /* question */:
13378
+ pos++;
13379
+ if (text2.charCodeAt(pos) === 63 /* question */) {
13380
+ pos++;
13381
+ }
13382
+ if (!isPreviousTermQuantifiable) {
13383
+ error2(Diagnostics.There_is_nothing_available_for_repetition, start3, pos - start3);
13384
+ }
13385
+ isPreviousTermQuantifiable = false;
13386
+ break;
13387
+ case 46 /* dot */:
13388
+ pos++;
13389
+ isPreviousTermQuantifiable = true;
13390
+ break;
13391
+ case 91 /* openBracket */:
13392
+ pos++;
13393
+ if (unicodeSetsMode) {
13394
+ scanClassSetExpression();
13395
+ } else {
13396
+ scanClassRanges();
13397
+ }
13398
+ scanExpectedChar(93 /* closeBracket */);
13399
+ isPreviousTermQuantifiable = true;
13400
+ break;
13401
+ case 41 /* closeParen */:
13402
+ if (isInGroup) {
13403
+ return;
13404
+ }
13405
+ case 93 /* closeBracket */:
13406
+ case 125 /* closeBrace */:
13407
+ if (isUnterminated && !isInGroup) {
13408
+ return;
13409
+ }
13410
+ error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
13411
+ pos++;
13412
+ isPreviousTermQuantifiable = true;
13413
+ break;
13414
+ case 47 /* slash */:
13415
+ case 124 /* bar */:
13416
+ return;
13417
+ default:
13418
+ if (isLineBreak(ch)) {
13419
+ return;
13420
+ }
13421
+ scanSourceCharacter();
13422
+ isPreviousTermQuantifiable = true;
13423
+ break;
13424
+ }
13425
+ }
13426
+ }
13427
+ function scanPatternModifiers(currFlags = 0 /* None */) {
13428
+ while (pos < end2) {
13429
+ const ch = text2.charCodeAt(pos);
13430
+ if (!isIdentifierPart(ch, languageVersion)) {
13431
+ break;
13432
+ }
13433
+ const flag = characterToRegularExpressionFlag(String.fromCharCode(ch));
13434
+ if (flag === void 0) {
13435
+ error2(Diagnostics.Unknown_regular_expression_flag, pos, 1);
13436
+ } else if (currFlags & flag) {
13437
+ error2(Diagnostics.Duplicate_regular_expression_flag, pos, 1);
13438
+ } else if (!(flag & 28 /* Modifiers */)) {
13439
+ error2(Diagnostics.This_regular_expression_flag_cannot_be_toggled_within_a_subpattern, pos, 1);
13440
+ } else {
13441
+ currFlags |= flag;
13442
+ const availableFrom = regularExpressionFlagToFirstAvailableLanguageVersion(flag);
13443
+ if (languageVersion < availableFrom) {
13444
+ error2(Diagnostics.This_regular_expression_flag_is_only_available_when_targeting_0_or_later, pos, 1, ScriptTarget[availableFrom]);
13445
+ }
13446
+ }
13447
+ pos++;
13448
+ }
13449
+ return currFlags;
13450
+ }
13451
+ function scanAtomEscape() {
13452
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 92 /* backslash */);
13453
+ switch (text2.charCodeAt(pos)) {
13454
+ case 107 /* k */:
13455
+ pos++;
13456
+ if (text2.charCodeAt(pos) === 60 /* lessThan */) {
13457
+ pos++;
13458
+ scanGroupName(
13459
+ /*isReference*/
13460
+ true
13461
+ );
13462
+ scanExpectedChar(62 /* greaterThan */);
13463
+ } else if (unicodeMode) {
13464
+ error2(Diagnostics.k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets, pos - 2, 2);
13465
+ }
13466
+ break;
13467
+ case 113 /* q */:
13468
+ if (unicodeSetsMode) {
13469
+ pos++;
13470
+ error2(Diagnostics.q_is_only_available_inside_character_class, pos - 2, 2);
13471
+ break;
13472
+ }
13473
+ default:
13474
+ scanCharacterClassEscape() || scanDecimalEscape() || scanCharacterEscape();
13475
+ break;
13476
+ }
13477
+ }
13478
+ function scanDecimalEscape() {
13479
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 92 /* backslash */);
13480
+ const ch = text2.charCodeAt(pos);
13481
+ if (ch >= 49 /* _1 */ && ch <= 57 /* _9 */) {
13482
+ const start3 = pos;
13483
+ scanDigits();
13484
+ decimalEscapes.push({ pos: start3, end: pos, value: +tokenValue });
13485
+ return true;
13486
+ }
13487
+ return false;
13488
+ }
13489
+ function scanCharacterEscape() {
13490
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 92 /* backslash */);
13491
+ let ch = text2.charCodeAt(pos);
13492
+ switch (ch) {
13493
+ case 99 /* c */:
13494
+ pos++;
13495
+ ch = text2.charCodeAt(pos);
13496
+ if (isASCIILetter(ch)) {
13497
+ pos++;
13498
+ return String.fromCharCode(ch & 31);
13499
+ }
13500
+ if (unicodeMode) {
13501
+ error2(Diagnostics.c_must_be_followed_by_an_ASCII_letter, pos - 2, 2);
13502
+ }
13503
+ return String.fromCharCode(ch);
13504
+ case 94 /* caret */:
13505
+ case 36 /* $ */:
13506
+ case 47 /* slash */:
13507
+ case 92 /* backslash */:
13508
+ case 46 /* dot */:
13509
+ case 42 /* asterisk */:
13510
+ case 43 /* plus */:
13511
+ case 63 /* question */:
13512
+ case 40 /* openParen */:
13513
+ case 41 /* closeParen */:
13514
+ case 91 /* openBracket */:
13515
+ case 93 /* closeBracket */:
13516
+ case 123 /* openBrace */:
13517
+ case 125 /* closeBrace */:
13518
+ case 124 /* bar */:
13519
+ pos++;
13520
+ return String.fromCharCode(ch);
13521
+ default:
13522
+ if (pos >= end2 || isLineBreak(ch)) {
13523
+ error2(Diagnostics.Undetermined_character_escape, pos - 1, 1, ch);
13524
+ return "\\";
13525
+ }
13526
+ pos--;
13527
+ return scanEscapeSequence(
13528
+ /*shouldEmitInvalidEscapeError*/
13529
+ unicodeMode,
13530
+ /*isRegularExpression*/
13531
+ true
13532
+ );
13533
+ }
13534
+ }
13535
+ function scanGroupName(isReference) {
13536
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 60 /* lessThan */);
13537
+ tokenStart = pos;
13538
+ scanIdentifier(codePointAt(text2, pos), languageVersion);
13539
+ if (pos === tokenStart) {
13540
+ error2(Diagnostics.Expected_a_capturing_group_name);
13541
+ } else if (isReference) {
13542
+ groupNameReferences.push({ pos: tokenStart, end: pos, name: tokenValue });
13543
+ } else if (namedCapturingGroups.some((group2) => group2.has(tokenValue))) {
13544
+ error2(Diagnostics.Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other, tokenStart, pos - tokenStart);
13545
+ } else {
13546
+ last(namedCapturingGroups).add(tokenValue);
13547
+ groupSpecifiers.add(tokenValue);
13548
+ }
13549
+ }
13550
+ function isClassContentExit(ch) {
13551
+ return ch === 93 /* closeBracket */ || pos >= end2 || isLineBreak(ch);
13552
+ }
13553
+ function scanClassRanges() {
13554
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 91 /* openBracket */);
13555
+ if (text2.charCodeAt(pos) === 94 /* caret */) {
13556
+ pos++;
13557
+ }
13558
+ while (pos < end2) {
13559
+ const ch = text2.charCodeAt(pos);
13560
+ if (isClassContentExit(ch)) {
13561
+ return;
13562
+ }
13563
+ const minStart = pos;
13564
+ const minCharacter = scanClassAtom();
13565
+ if (text2.charCodeAt(pos) === 45 /* minus */) {
13566
+ pos++;
13567
+ const ch2 = text2.charCodeAt(pos);
13568
+ if (isClassContentExit(ch2)) {
13569
+ return;
13570
+ }
13571
+ if (!minCharacter) {
13572
+ error2(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, minStart, pos - 1 - minStart);
13573
+ }
13574
+ const maxStart = pos;
13575
+ const maxCharacter = scanClassAtom();
13576
+ if (!maxCharacter) {
13577
+ error2(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, maxStart, pos - maxStart);
13578
+ continue;
13579
+ }
13580
+ if (!minCharacter) {
13581
+ continue;
13582
+ }
13583
+ const minCharacterValue = codePointAt(minCharacter, 0);
13584
+ const maxCharacterValue = codePointAt(maxCharacter, 0);
13585
+ if (minCharacter.length === charSize(minCharacterValue) && maxCharacter.length === charSize(maxCharacterValue) && minCharacterValue > maxCharacterValue) {
13586
+ error2(Diagnostics.Range_out_of_order_in_character_class, minStart, pos - minStart);
13587
+ }
13588
+ }
13589
+ }
13590
+ }
13591
+ function scanClassSetExpression() {
13592
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 91 /* openBracket */);
13593
+ let isCharacterComplement = false;
13594
+ if (text2.charCodeAt(pos) === 94 /* caret */) {
13595
+ pos++;
13596
+ isCharacterComplement = true;
13597
+ }
13598
+ let expressionMayContainStrings = false;
13599
+ let ch = text2.charCodeAt(pos);
13600
+ if (isClassContentExit(ch)) {
13601
+ return;
13602
+ }
13603
+ let start3 = pos;
13604
+ let oprand;
13605
+ switch (text2.slice(pos, pos + 2)) {
13606
+ case "--":
13607
+ case "&&":
13608
+ error2(Diagnostics.Expected_a_class_set_oprand);
13609
+ mayContainStrings = false;
13610
+ break;
13611
+ default:
13612
+ oprand = scanClassSetOprand();
13613
+ break;
13614
+ }
13615
+ switch (text2.charCodeAt(pos)) {
13616
+ case 45 /* minus */:
13617
+ if (text2.charCodeAt(pos + 1) === 45 /* minus */) {
13618
+ if (isCharacterComplement && mayContainStrings) {
13619
+ error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start3, pos - start3);
13620
+ }
13621
+ expressionMayContainStrings = mayContainStrings;
13622
+ scanClassSetSubExpression(3 /* ClassSubtraction */);
13623
+ mayContainStrings = !isCharacterComplement && expressionMayContainStrings;
13624
+ return;
13625
+ }
13626
+ break;
13627
+ case 38 /* ampersand */:
13628
+ if (text2.charCodeAt(pos + 1) === 38 /* ampersand */) {
13629
+ scanClassSetSubExpression(2 /* ClassIntersection */);
13630
+ if (isCharacterComplement && mayContainStrings) {
13631
+ error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start3, pos - start3);
13632
+ }
13633
+ expressionMayContainStrings = mayContainStrings;
13634
+ mayContainStrings = !isCharacterComplement && expressionMayContainStrings;
13635
+ return;
13636
+ } else {
13637
+ error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
13638
+ }
13639
+ break;
13640
+ default:
13641
+ if (isCharacterComplement && mayContainStrings) {
13642
+ error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start3, pos - start3);
13643
+ }
13644
+ expressionMayContainStrings = mayContainStrings;
13645
+ break;
13646
+ }
13647
+ while (pos < end2) {
13648
+ ch = text2.charCodeAt(pos);
13649
+ switch (ch) {
13650
+ case 45 /* minus */:
13651
+ pos++;
13652
+ ch = text2.charCodeAt(pos);
13653
+ if (isClassContentExit(ch)) {
13654
+ mayContainStrings = !isCharacterComplement && expressionMayContainStrings;
13655
+ return;
13656
+ }
13657
+ if (ch === 45 /* minus */) {
13658
+ pos++;
13659
+ error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2);
13660
+ start3 = pos - 2;
13661
+ oprand = text2.slice(start3, pos);
13662
+ continue;
13663
+ } else {
13664
+ if (!oprand) {
13665
+ error2(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, start3, pos - 1 - start3);
13666
+ }
13667
+ const secondStart = pos;
13668
+ const secondOprand = scanClassSetOprand();
13669
+ if (isCharacterComplement && mayContainStrings) {
13670
+ error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, secondStart, pos - secondStart);
13671
+ }
13672
+ expressionMayContainStrings || (expressionMayContainStrings = mayContainStrings);
13673
+ if (!secondOprand) {
13674
+ error2(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, secondStart, pos - secondStart);
13675
+ break;
13676
+ }
13677
+ if (!oprand) {
13678
+ break;
13679
+ }
13680
+ const minCharacterValue = codePointAt(oprand, 0);
13681
+ const maxCharacterValue = codePointAt(secondOprand, 0);
13682
+ if (oprand.length === charSize(minCharacterValue) && secondOprand.length === charSize(maxCharacterValue) && minCharacterValue > maxCharacterValue) {
13683
+ error2(Diagnostics.Range_out_of_order_in_character_class, start3, pos - start3);
13684
+ }
13685
+ }
13686
+ break;
13687
+ case 38 /* ampersand */:
13688
+ start3 = pos;
13689
+ pos++;
13690
+ if (text2.charCodeAt(pos) === 38 /* ampersand */) {
13691
+ pos++;
13692
+ error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2);
13693
+ if (text2.charCodeAt(pos) === 38 /* ampersand */) {
13694
+ error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
13695
+ pos++;
13696
+ }
13697
+ } else {
13698
+ error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos - 1, 1, String.fromCharCode(ch));
13699
+ }
13700
+ oprand = text2.slice(start3, pos);
13701
+ continue;
13702
+ }
13703
+ if (isClassContentExit(text2.charCodeAt(pos))) {
13704
+ break;
13705
+ }
13706
+ start3 = pos;
13707
+ switch (text2.slice(pos, pos + 2)) {
13708
+ case "--":
13709
+ case "&&":
13710
+ error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos, 2);
13711
+ pos += 2;
13712
+ oprand = text2.slice(start3, pos);
13713
+ break;
13714
+ default:
13715
+ oprand = scanClassSetOprand();
13716
+ break;
13717
+ }
13718
+ }
13719
+ mayContainStrings = !isCharacterComplement && expressionMayContainStrings;
13720
+ }
13721
+ function scanClassSetSubExpression(expressionType) {
13722
+ let expressionMayContainStrings = mayContainStrings;
13723
+ while (pos < end2) {
13724
+ let ch = text2.charCodeAt(pos);
13725
+ if (isClassContentExit(ch)) {
13726
+ break;
13727
+ }
13728
+ switch (ch) {
13729
+ case 45 /* minus */:
13730
+ pos++;
13731
+ if (text2.charCodeAt(pos) === 45 /* minus */) {
13732
+ pos++;
13733
+ if (expressionType !== 3 /* ClassSubtraction */) {
13734
+ error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2);
13735
+ }
13736
+ } else {
13737
+ error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 1, 1);
13738
+ }
13739
+ break;
13740
+ case 38 /* ampersand */:
13741
+ pos++;
13742
+ if (text2.charCodeAt(pos) === 38 /* ampersand */) {
13743
+ pos++;
13744
+ if (expressionType !== 2 /* ClassIntersection */) {
13745
+ error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2);
13746
+ }
13747
+ if (text2.charCodeAt(pos) === 38 /* ampersand */) {
13748
+ error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
13749
+ pos++;
13750
+ }
13751
+ } else {
13752
+ error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos - 1, 1, String.fromCharCode(ch));
13753
+ }
13754
+ break;
13755
+ default:
13756
+ switch (expressionType) {
13757
+ case 3 /* ClassSubtraction */:
13758
+ error2(Diagnostics._0_expected, pos, 0, "--");
13759
+ break;
13760
+ case 2 /* ClassIntersection */:
13761
+ error2(Diagnostics._0_expected, pos, 0, "&&");
13762
+ break;
13763
+ default:
13764
+ break;
13765
+ }
13766
+ break;
13767
+ }
13768
+ ch = text2.charCodeAt(pos);
13769
+ if (isClassContentExit(ch)) {
13770
+ error2(Diagnostics.Expected_a_class_set_oprand);
13771
+ break;
13772
+ }
13773
+ scanClassSetOprand();
13774
+ expressionMayContainStrings && (expressionMayContainStrings = mayContainStrings);
13775
+ }
13776
+ mayContainStrings = expressionMayContainStrings;
13777
+ }
13778
+ function scanClassSetOprand() {
13779
+ mayContainStrings = false;
13780
+ switch (text2.charCodeAt(pos)) {
13781
+ case 91 /* openBracket */:
13782
+ pos++;
13783
+ scanClassSetExpression();
13784
+ scanExpectedChar(93 /* closeBracket */);
13785
+ return "";
13786
+ case 92 /* backslash */:
13787
+ pos++;
13788
+ if (scanCharacterClassEscape()) {
13789
+ return "";
13790
+ } else if (text2.charCodeAt(pos) === 113 /* q */) {
13791
+ pos++;
13792
+ if (text2.charCodeAt(pos) === 123 /* openBrace */) {
13793
+ pos++;
13794
+ scanClassStringDisjunctionContents();
13795
+ scanExpectedChar(125 /* closeBrace */);
13796
+ return "";
13797
+ } else {
13798
+ error2(Diagnostics.q_must_be_followed_by_string_alternatives_enclosed_in_braces, pos - 2, 2);
13799
+ return "q";
13800
+ }
13801
+ }
13802
+ pos--;
13803
+ default:
13804
+ return scanClassSetCharacter();
13805
+ }
13806
+ }
13807
+ function scanClassStringDisjunctionContents() {
13808
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 123 /* openBrace */);
13809
+ let characterCount = 0;
13810
+ while (pos < end2) {
13811
+ const ch = text2.charCodeAt(pos);
13812
+ switch (ch) {
13813
+ case 125 /* closeBrace */:
13814
+ if (characterCount !== 1) {
13815
+ mayContainStrings = true;
13816
+ }
13817
+ return;
13818
+ case 124 /* bar */:
13819
+ if (characterCount !== 1) {
13820
+ mayContainStrings = true;
13821
+ }
13822
+ pos++;
13823
+ start2 = pos;
13824
+ characterCount = 0;
13825
+ break;
13826
+ default:
13827
+ if (isLineBreak(ch)) {
13828
+ break;
13829
+ }
13830
+ scanClassSetCharacter();
13831
+ characterCount++;
13832
+ break;
13833
+ }
13834
+ }
13835
+ }
13836
+ function scanClassSetCharacter() {
13837
+ const ch = text2.charCodeAt(pos);
13838
+ if (ch === 92 /* backslash */) {
13839
+ pos++;
13840
+ const ch2 = text2.charCodeAt(pos);
13841
+ switch (ch2) {
13842
+ case 98 /* b */:
13843
+ pos++;
13844
+ return "\b";
13845
+ case 38 /* ampersand */:
13846
+ case 45 /* minus */:
13847
+ case 33 /* exclamation */:
13848
+ case 35 /* hash */:
13849
+ case 37 /* percent */:
13850
+ case 44 /* comma */:
13851
+ case 58 /* colon */:
13852
+ case 59 /* semicolon */:
13853
+ case 60 /* lessThan */:
13854
+ case 61 /* equals */:
13855
+ case 62 /* greaterThan */:
13856
+ case 64 /* at */:
13857
+ case 96 /* backtick */:
13858
+ case 126 /* tilde */:
13859
+ pos++;
13860
+ return String.fromCharCode(ch2);
13861
+ default:
13862
+ return scanCharacterEscape();
13863
+ }
13864
+ } else if (ch === text2.charCodeAt(pos + 1)) {
13865
+ switch (ch) {
13866
+ case 38 /* ampersand */:
13867
+ case 33 /* exclamation */:
13868
+ case 35 /* hash */:
13869
+ case 37 /* percent */:
13870
+ case 42 /* asterisk */:
13871
+ case 43 /* plus */:
13872
+ case 44 /* comma */:
13873
+ case 46 /* dot */:
13874
+ case 58 /* colon */:
13875
+ case 59 /* semicolon */:
13876
+ case 60 /* lessThan */:
13877
+ case 61 /* equals */:
13878
+ case 62 /* greaterThan */:
13879
+ case 63 /* question */:
13880
+ case 64 /* at */:
13881
+ case 96 /* backtick */:
13882
+ case 126 /* tilde */:
13883
+ error2(Diagnostics.A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backslash, pos, 2);
13884
+ pos += 2;
13885
+ return text2.substring(pos - 2, pos);
13886
+ }
13887
+ }
13888
+ switch (ch) {
13889
+ case 47 /* slash */:
13890
+ case 40 /* openParen */:
13891
+ case 41 /* closeParen */:
13892
+ case 91 /* openBracket */:
13893
+ case 93 /* closeBracket */:
13894
+ case 123 /* openBrace */:
13895
+ case 125 /* closeBrace */:
13896
+ case 45 /* minus */:
13897
+ case 124 /* bar */:
13898
+ error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
13899
+ pos++;
13900
+ return String.fromCharCode(ch);
13901
+ }
13902
+ return scanSourceCharacter();
13903
+ }
13904
+ function scanClassAtom() {
13905
+ if (text2.charCodeAt(pos) === 92 /* backslash */) {
13906
+ pos++;
13907
+ const ch = text2.charCodeAt(pos);
13908
+ switch (ch) {
13909
+ case 98 /* b */:
13910
+ pos++;
13911
+ return "\b";
13912
+ case 45 /* minus */:
13913
+ pos++;
13914
+ return String.fromCharCode(ch);
13915
+ default:
13916
+ if (scanCharacterClassEscape()) {
13917
+ return "";
13918
+ }
13919
+ return scanCharacterEscape();
13920
+ }
13921
+ } else {
13922
+ return scanSourceCharacter();
13923
+ }
13924
+ }
13925
+ function scanCharacterClassEscape() {
13926
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 92 /* backslash */);
13927
+ let isCharacterComplement = false;
13928
+ const start3 = pos - 1;
13929
+ const ch = text2.charCodeAt(pos);
13930
+ switch (ch) {
13931
+ case 100 /* d */:
13932
+ case 68 /* D */:
13933
+ case 115 /* s */:
13934
+ case 83 /* S */:
13935
+ case 119 /* w */:
13936
+ case 87 /* W */:
13937
+ pos++;
13938
+ return true;
13939
+ case 80 /* P */:
13940
+ isCharacterComplement = true;
13941
+ case 112 /* p */:
13942
+ pos++;
13943
+ if (text2.charCodeAt(pos) === 123 /* openBrace */) {
13944
+ pos++;
13945
+ const propertyNameOrValueStart = pos;
13946
+ const propertyNameOrValue = scanWordCharacters();
13947
+ if (text2.charCodeAt(pos) === 61 /* equals */) {
13948
+ const propertyName = nonBinaryUnicodeProperties.get(propertyNameOrValue);
13949
+ if (pos === propertyNameOrValueStart) {
13950
+ error2(Diagnostics.Expected_a_Unicode_property_name);
13951
+ } else if (propertyName === void 0) {
13952
+ error2(Diagnostics.Unknown_Unicode_property_name, propertyNameOrValueStart, pos - propertyNameOrValueStart);
13953
+ const suggestion = getSpellingSuggestion(propertyNameOrValue, nonBinaryUnicodeProperties.keys(), identity);
13954
+ if (suggestion) {
13955
+ error2(Diagnostics.Did_you_mean_0, propertyNameOrValueStart, pos - propertyNameOrValueStart, suggestion);
13956
+ }
13957
+ }
13958
+ pos++;
13959
+ const propertyValueStart = pos;
13960
+ const propertyValue = scanWordCharacters();
13961
+ if (pos === propertyValueStart) {
13962
+ error2(Diagnostics.Expected_a_Unicode_property_value);
13963
+ } else if (propertyName !== void 0 && !valuesOfNonBinaryUnicodeProperties[propertyName].has(propertyValue)) {
13964
+ error2(Diagnostics.Unknown_Unicode_property_value, propertyValueStart, pos - propertyValueStart);
13965
+ const suggestion = getSpellingSuggestion(propertyValue, valuesOfNonBinaryUnicodeProperties[propertyName], identity);
13966
+ if (suggestion) {
13967
+ error2(Diagnostics.Did_you_mean_0, propertyValueStart, pos - propertyValueStart, suggestion);
13968
+ }
13969
+ }
13970
+ } else {
13971
+ if (pos === propertyNameOrValueStart) {
13972
+ error2(Diagnostics.Expected_a_Unicode_property_name_or_value);
13973
+ } else if (binaryUnicodePropertiesOfStrings.has(propertyNameOrValue)) {
13974
+ if (!unicodeSetsMode) {
13975
+ 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);
13976
+ } else if (isCharacterComplement) {
13977
+ error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, propertyNameOrValueStart, pos - propertyNameOrValueStart);
13978
+ } else {
13979
+ mayContainStrings = true;
13980
+ }
13981
+ } else if (!valuesOfNonBinaryUnicodeProperties.General_Category.has(propertyNameOrValue) && !binaryUnicodeProperties.has(propertyNameOrValue)) {
13982
+ error2(Diagnostics.Unknown_Unicode_property_name_or_value, propertyNameOrValueStart, pos - propertyNameOrValueStart);
13983
+ const suggestion = getSpellingSuggestion(propertyNameOrValue, [...valuesOfNonBinaryUnicodeProperties.General_Category, ...binaryUnicodeProperties, ...binaryUnicodePropertiesOfStrings], identity);
13984
+ if (suggestion) {
13985
+ error2(Diagnostics.Did_you_mean_0, propertyNameOrValueStart, pos - propertyNameOrValueStart, suggestion);
13986
+ }
13987
+ }
13988
+ }
13989
+ scanExpectedChar(125 /* closeBrace */);
13990
+ if (!unicodeMode) {
13991
+ error2(Diagnostics.Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set, start3, pos - start3);
13992
+ }
13993
+ } else if (unicodeMode) {
13994
+ error2(Diagnostics._0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces, pos - 2, 2, String.fromCharCode(ch));
13995
+ }
13996
+ return true;
13997
+ }
13998
+ return false;
13999
+ }
14000
+ function scanWordCharacters() {
14001
+ let value = "";
14002
+ while (pos < end2) {
14003
+ const ch = text2.charCodeAt(pos);
14004
+ if (!isWordCharacter(ch)) {
14005
+ break;
14006
+ }
14007
+ value += String.fromCharCode(ch);
14008
+ pos++;
14009
+ }
14010
+ return value;
14011
+ }
14012
+ function scanSourceCharacter() {
14013
+ const size = unicodeMode ? charSize(codePointAt(text2, pos)) : 1;
14014
+ pos += size;
14015
+ return text2.substring(pos - size, pos);
14016
+ }
14017
+ function scanExpectedChar(ch) {
14018
+ if (text2.charCodeAt(pos) === ch) {
14019
+ pos++;
14020
+ } else {
14021
+ error2(Diagnostics._0_expected, pos, 0, String.fromCharCode(ch));
14022
+ }
14023
+ }
14024
+ scanDisjunction(
14025
+ /*isInGroup*/
14026
+ false
14027
+ );
14028
+ forEach(groupNameReferences, (reference) => {
14029
+ if (!groupSpecifiers.has(reference.name)) {
14030
+ error2(Diagnostics.There_is_no_capturing_group_named_0_in_this_regular_expression, reference.pos, reference.end - reference.pos, reference.name);
14031
+ }
14032
+ });
14033
+ forEach(decimalEscapes, (escape) => {
14034
+ if (escape.value > numberOfCapturingGroups) {
14035
+ if (numberOfCapturingGroups) {
14036
+ 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);
14037
+ } else {
14038
+ error2(Diagnostics.Decimal_escapes_are_invalid_when_there_are_no_capturing_groups_in_a_regular_expression, escape.pos, escape.end - escape.pos);
14039
+ }
14040
+ }
14041
+ });
14042
+ }
13146
14043
  }
13147
14044
  function appendIfCommentDirective(commentDirectives2, text2, commentDirectiveRegEx, lineStart) {
13148
14045
  const type = getDirectiveFromComment(text2.trimStart(), commentDirectiveRegEx);
@@ -13365,8 +14262,6 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
13365
14262
  pos--;
13366
14263
  const extendedCookedChar = peekExtendedUnicodeEscape();
13367
14264
  if (extendedCookedChar >= 0 && isIdentifierStart(extendedCookedChar, languageVersion)) {
13368
- pos += 3;
13369
- tokenFlags |= 8 /* ExtendedUnicodeEscape */;
13370
14265
  tokenValue = scanExtendedUnicodeEscape() + scanIdentifierParts();
13371
14266
  return token = getIdentifierToken();
13372
14267
  }
@@ -13501,6 +14396,22 @@ var utf16EncodeAsStringWorker = String.fromCodePoint ? (codePoint) => String.fro
13501
14396
  function utf16EncodeAsString(codePoint) {
13502
14397
  return utf16EncodeAsStringWorker(codePoint);
13503
14398
  }
14399
+ var nonBinaryUnicodeProperties = new Map(Object.entries({
14400
+ General_Category: "General_Category",
14401
+ gc: "General_Category",
14402
+ Script: "Script",
14403
+ sc: "Script",
14404
+ Script_Extensions: "Script_Extensions",
14405
+ scx: "Script_Extensions"
14406
+ }));
14407
+ var 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"]);
14408
+ var 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"]);
14409
+ var valuesOfNonBinaryUnicodeProperties = {
14410
+ 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"]),
14411
+ 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"]),
14412
+ Script_Extensions: /* @__PURE__ */ new Set()
14413
+ // Currently empty
14414
+ };
13504
14415
 
13505
14416
  // src/compiler/utilitiesPublic.ts
13506
14417
  function isExternalModuleNameRelative(moduleName) {
@@ -20151,7 +21062,7 @@ function setObjectAllocator(alloc) {
20151
21062
  forEach(objectAllocatorPatchers, (fn) => fn(objectAllocator));
20152
21063
  }
20153
21064
  function formatStringFromArgs(text, args) {
20154
- return text.replace(/{(\d+)}/g, (_match, index) => "" + Debug.checkDefined(args[+index]));
21065
+ return text.replace(/\{(\d+)\}/g, (_match, index) => "" + Debug.checkDefined(args[+index]));
20155
21066
  }
20156
21067
  var localizedDiagnosticMessages;
20157
21068
  function setLocalizedDiagnosticMessages(messages) {
@@ -21199,7 +22110,7 @@ function isValidBigIntString(s, roundTripOnly) {
21199
22110
  false
21200
22111
  );
21201
22112
  let success = true;
21202
- scanner2.setOnError(() => success = false);
22113
+ scanner2.setOnError(() => void (success = false));
21203
22114
  scanner2.setText(s + "n");
21204
22115
  let result = scanner2.scan();
21205
22116
  const negative = result === 41 /* MinusToken */;
@@ -31255,7 +32166,10 @@ var Parser;
31255
32166
  function parseErrorAtPosition(start2, length2, message, ...args) {
31256
32167
  const lastError = lastOrUndefined(parseDiagnostics);
31257
32168
  let result;
31258
- if (!lastError || start2 !== lastError.start) {
32169
+ if (message.category === 3 /* Message */ && lastError && start2 === lastError.start && length2 === lastError.length) {
32170
+ result = createDetachedDiagnostic(fileName, sourceText, start2, length2, message, ...args);
32171
+ addRelatedInfo(lastError, result);
32172
+ } else if (!lastError || start2 !== lastError.start) {
31259
32173
  result = createDetachedDiagnostic(fileName, sourceText, start2, length2, message, ...args);
31260
32174
  parseDiagnostics.push(result);
31261
32175
  }
@@ -31266,10 +32180,10 @@ var Parser;
31266
32180
  return parseErrorAtPosition(start2, end - start2, message, ...args);
31267
32181
  }
31268
32182
  function parseErrorAtRange(range, message, ...args) {
31269
- parseErrorAt(range.pos, range.end, message, ...args);
32183
+ return parseErrorAt(range.pos, range.end, message, ...args);
31270
32184
  }
31271
- function scanError(message, length2, arg0) {
31272
- parseErrorAtPosition(scanner2.getTokenEnd(), length2, message, arg0);
32185
+ function scanError(message, pos, length2, ...args) {
32186
+ return parseErrorAtPosition(pos, length2, message, ...args);
31273
32187
  }
31274
32188
  function getNodePos() {
31275
32189
  return scanner2.getTokenFullStart();
@@ -31411,7 +32325,7 @@ var Parser;
31411
32325
  parseErrorForInvalidName(Diagnostics.Type_alias_name_cannot_be_0, Diagnostics.Type_alias_must_be_given_a_name, 64 /* EqualsToken */);
31412
32326
  return;
31413
32327
  }
31414
- const suggestion = getSpellingSuggestion(expressionText, viableKeywordSuggestions, (n) => n) ?? getSpaceSuggestion(expressionText);
32328
+ const suggestion = getSpellingSuggestion(expressionText, viableKeywordSuggestions, identity) ?? getSpaceSuggestion(expressionText);
31415
32329
  if (suggestion) {
31416
32330
  parseErrorAt(pos, node.end, Diagnostics.Unknown_keyword_or_identifier_Did_you_mean_0, suggestion);
31417
32331
  return;
@@ -135265,6 +136179,21 @@ function createPatternMatch(kind, isCaseSensitive) {
135265
136179
  function createPatternMatcher(pattern) {
135266
136180
  const stringToWordSpans = /* @__PURE__ */ new Map();
135267
136181
  const dotSeparatedSegments = pattern.trim().split(".").map((p) => createSegment(p.trim()));
136182
+ if (dotSeparatedSegments.length === 1 && dotSeparatedSegments[0].totalTextChunk.text === "") {
136183
+ return {
136184
+ getMatchForLastSegmentOfPattern: () => createPatternMatch(
136185
+ 2 /* substring */,
136186
+ /*isCaseSensitive*/
136187
+ true
136188
+ ),
136189
+ getFullMatch: () => createPatternMatch(
136190
+ 2 /* substring */,
136191
+ /*isCaseSensitive*/
136192
+ true
136193
+ ),
136194
+ patternContainsDots: false
136195
+ };
136196
+ }
135268
136197
  if (dotSeparatedSegments.some((segment) => !segment.subWordTextChunks.length))
135269
136198
  return void 0;
135270
136199
  return {
@@ -147471,8 +148400,8 @@ registerCodeFix({
147471
148400
  fixIds: [fixId7],
147472
148401
  getAllCodeActions: (context) => codeFixAll(context, errorCodes7, (changes, diag2) => makeChange7(changes, diag2.file, diag2.start))
147473
148402
  });
147474
- function makeChange7(changeTracker, sourceFile, pos) {
147475
- const token = getTokenAtPosition(sourceFile, pos);
148403
+ function makeChange7(changeTracker, sourceFile, start2) {
148404
+ const token = getTokenAtPosition(sourceFile, start2);
147476
148405
  const param = token.parent;
147477
148406
  if (!isParameter(param)) {
147478
148407
  return Debug.fail("Tried to add a parameter name to a non-parameter: " + Debug.formatSyntaxKind(token.kind));
@@ -147480,20 +148409,34 @@ function makeChange7(changeTracker, sourceFile, pos) {
147480
148409
  const i = param.parent.parameters.indexOf(param);
147481
148410
  Debug.assert(!param.type, "Tried to add a parameter name to a parameter that already had one.");
147482
148411
  Debug.assert(i > -1, "Parameter not found in parent parameter list.");
147483
- const typeNode = factory.createTypeReferenceNode(
148412
+ let end = param.name.getEnd();
148413
+ let typeNode = factory.createTypeReferenceNode(
147484
148414
  param.name,
147485
148415
  /*typeArguments*/
147486
148416
  void 0
147487
148417
  );
148418
+ let nextParam = tryGetNextParam(sourceFile, param);
148419
+ while (nextParam) {
148420
+ typeNode = factory.createArrayTypeNode(typeNode);
148421
+ end = nextParam.getEnd();
148422
+ nextParam = tryGetNextParam(sourceFile, nextParam);
148423
+ }
147488
148424
  const replacement = factory.createParameterDeclaration(
147489
148425
  param.modifiers,
147490
148426
  param.dotDotDotToken,
147491
148427
  "arg" + i,
147492
148428
  param.questionToken,
147493
- param.dotDotDotToken ? factory.createArrayTypeNode(typeNode) : typeNode,
148429
+ param.dotDotDotToken && !isArrayTypeNode(typeNode) ? factory.createArrayTypeNode(typeNode) : typeNode,
147494
148430
  param.initializer
147495
148431
  );
147496
- changeTracker.replaceNode(sourceFile, param, replacement);
148432
+ changeTracker.replaceRange(sourceFile, createRange(param.getStart(sourceFile), end), replacement);
148433
+ }
148434
+ function tryGetNextParam(sourceFile, param) {
148435
+ const nextToken = findNextToken(param.name, param.parent, sourceFile);
148436
+ if (nextToken && nextToken.kind === 23 /* OpenBracketToken */ && isArrayBindingPattern(nextToken.parent) && isParameter(nextToken.parent.parent)) {
148437
+ return nextToken.parent.parent;
148438
+ }
148439
+ return void 0;
147497
148440
  }
147498
148441
 
147499
148442
  // src/services/codefixes/addOptionalPropertyUndefined.ts
@@ -172019,6 +172962,7 @@ __export(ts_exports2, {
172019
172962
  PrivateIdentifierKind: () => PrivateIdentifierKind,
172020
172963
  ProcessLevel: () => ProcessLevel,
172021
172964
  QuotePreference: () => QuotePreference,
172965
+ RegularExpressionFlags: () => RegularExpressionFlags,
172022
172966
  RelationComparisonResult: () => RelationComparisonResult,
172023
172967
  Rename: () => ts_Rename_exports,
172024
172968
  ScriptElementKind: () => ScriptElementKind,
@@ -172145,6 +173089,7 @@ __export(ts_exports2, {
172145
173089
  changeExtension: () => changeExtension,
172146
173090
  changesAffectModuleResolution: () => changesAffectModuleResolution,
172147
173091
  changesAffectingProgramStructure: () => changesAffectingProgramStructure,
173092
+ characterToRegularExpressionFlag: () => characterToRegularExpressionFlag,
172148
173093
  childIsDecorated: () => childIsDecorated,
172149
173094
  classElementOrClassElementParameterIsDecorated: () => classElementOrClassElementParameterIsDecorated,
172150
173095
  classHasClassThisAssignment: () => classHasClassThisAssignment,
@@ -173902,6 +174847,7 @@ __export(ts_exports2, {
173902
174847
  reducePathComponents: () => reducePathComponents,
173903
174848
  refactor: () => ts_refactor_exports,
173904
174849
  regExpEscape: () => regExpEscape,
174850
+ regularExpressionFlagToCharacter: () => regularExpressionFlagToCharacter,
173905
174851
  relativeComplement: () => relativeComplement,
173906
174852
  removeAllComments: () => removeAllComments,
173907
174853
  removeEmitHelper: () => removeEmitHelper,
@@ -186576,6 +187522,7 @@ start(initializeNodeSystem(), require("os").platform());
186576
187522
  PrivateIdentifierKind,
186577
187523
  ProcessLevel,
186578
187524
  QuotePreference,
187525
+ RegularExpressionFlags,
186579
187526
  RelationComparisonResult,
186580
187527
  Rename,
186581
187528
  ScriptElementKind,
@@ -186702,6 +187649,7 @@ start(initializeNodeSystem(), require("os").platform());
186702
187649
  changeExtension,
186703
187650
  changesAffectModuleResolution,
186704
187651
  changesAffectingProgramStructure,
187652
+ characterToRegularExpressionFlag,
186705
187653
  childIsDecorated,
186706
187654
  classElementOrClassElementParameterIsDecorated,
186707
187655
  classHasClassThisAssignment,
@@ -188459,6 +189407,7 @@ start(initializeNodeSystem(), require("os").platform());
188459
189407
  reducePathComponents,
188460
189408
  refactor,
188461
189409
  regExpEscape,
189410
+ regularExpressionFlagToCharacter,
188462
189411
  relativeComplement,
188463
189412
  removeAllComments,
188464
189413
  removeEmitHelper,