@typescript-deploys/pr-build 5.4.0-pr-56183-8 → 5.4.0-pr-55600-40

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
@@ -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, JSDocParsingMode;
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, JSDocParsingMode;
3501
3501
  var init_types = __esm({
3502
3502
  "src/compiler/types.ts"() {
3503
3503
  "use strict";
@@ -4018,6 +4018,20 @@ ${lanes.join("\n")}
4018
4018
  GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["AllowNameSubstitution"] = 64] = "AllowNameSubstitution";
4019
4019
  return GeneratedIdentifierFlags2;
4020
4020
  })(GeneratedIdentifierFlags || {});
4021
+ RegularExpressionFlags = /* @__PURE__ */ ((RegularExpressionFlags2) => {
4022
+ RegularExpressionFlags2[RegularExpressionFlags2["None"] = 0] = "None";
4023
+ RegularExpressionFlags2[RegularExpressionFlags2["HasIndices"] = 1] = "HasIndices";
4024
+ RegularExpressionFlags2[RegularExpressionFlags2["Global"] = 2] = "Global";
4025
+ RegularExpressionFlags2[RegularExpressionFlags2["IgnoreCase"] = 4] = "IgnoreCase";
4026
+ RegularExpressionFlags2[RegularExpressionFlags2["Multiline"] = 8] = "Multiline";
4027
+ RegularExpressionFlags2[RegularExpressionFlags2["DotAll"] = 16] = "DotAll";
4028
+ RegularExpressionFlags2[RegularExpressionFlags2["Unicode"] = 32] = "Unicode";
4029
+ RegularExpressionFlags2[RegularExpressionFlags2["UnicodeSets"] = 64] = "UnicodeSets";
4030
+ RegularExpressionFlags2[RegularExpressionFlags2["Sticky"] = 128] = "Sticky";
4031
+ RegularExpressionFlags2[RegularExpressionFlags2["UnicodeMode"] = 96] = "UnicodeMode";
4032
+ RegularExpressionFlags2[RegularExpressionFlags2["Modifiers"] = 28] = "Modifiers";
4033
+ return RegularExpressionFlags2;
4034
+ })(RegularExpressionFlags || {});
4021
4035
  TokenFlags = /* @__PURE__ */ ((TokenFlags2) => {
4022
4036
  TokenFlags2[TokenFlags2["None"] = 0] = "None";
4023
4037
  TokenFlags2[TokenFlags2["PrecedingLineBreak"] = 1] = "PrecedingLineBreak";
@@ -4722,6 +4736,8 @@ ${lanes.join("\n")}
4722
4736
  ScriptTarget11[ScriptTarget11["ES2020"] = 7] = "ES2020";
4723
4737
  ScriptTarget11[ScriptTarget11["ES2021"] = 8] = "ES2021";
4724
4738
  ScriptTarget11[ScriptTarget11["ES2022"] = 9] = "ES2022";
4739
+ ScriptTarget11[ScriptTarget11["ES2023"] = 10] = "ES2023";
4740
+ ScriptTarget11[ScriptTarget11["ES2024"] = 11] = "ES2024";
4725
4741
  ScriptTarget11[ScriptTarget11["ESNext"] = 99] = "ESNext";
4726
4742
  ScriptTarget11[ScriptTarget11["JSON"] = 100] = "JSON";
4727
4743
  ScriptTarget11[ScriptTarget11["Latest"] = 99 /* ESNext */] = "Latest";
@@ -7417,6 +7433,43 @@ ${lanes.join("\n")}
7417
7433
  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."),
7418
7434
  _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."),
7419
7435
  Identifier_string_literal_or_number_literal_expected: diag(1496, 1 /* Error */, "Identifier_string_literal_or_number_literal_expected_1496", "Identifier, string literal, or number literal expected."),
7436
+ Unknown_regular_expression_flag: diag(1497, 1 /* Error */, "Unknown_regular_expression_flag_1497", "Unknown regular expression flag."),
7437
+ Duplicate_regular_expression_flag: diag(1498, 1 /* Error */, "Duplicate_regular_expression_flag_1498", "Duplicate regular expression flag."),
7438
+ 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."),
7439
+ 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."),
7440
+ 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."),
7441
+ 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."),
7442
+ Incomplete_quantifier_Digit_expected: diag(1503, 1 /* Error */, "Incomplete_quantifier_Digit_expected_1503", "Incomplete quantifier. Digit expected."),
7443
+ Numbers_out_of_order_in_quantifier: diag(1504, 1 /* Error */, "Numbers_out_of_order_in_quantifier_1504", "Numbers out of order in quantifier."),
7444
+ There_is_nothing_available_for_repetition: diag(1505, 1 /* Error */, "There_is_nothing_available_for_repetition_1505", "There is nothing available for repetition."),
7445
+ 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?"),
7446
+ 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."),
7447
+ 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."),
7448
+ 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."),
7449
+ 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."),
7450
+ Undetermined_character_escape: diag(1511, 1 /* Error */, "Undetermined_character_escape_1511", "Undetermined character escape."),
7451
+ Expected_a_capturing_group_name: diag(1512, 1 /* Error */, "Expected_a_capturing_group_name_1512", "Expected a capturing group name."),
7452
+ 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."),
7453
+ 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."),
7454
+ 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."),
7455
+ 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."),
7456
+ 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."),
7457
+ Expected_a_class_set_oprand: diag(1518, 1 /* Error */, "Expected_a_class_set_oprand_1518", "Expected a class set oprand."),
7458
+ 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."),
7459
+ 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?"),
7460
+ Expected_a_Unicode_property_name: diag(1521, 1 /* Error */, "Expected_a_Unicode_property_name_1521", "Expected a Unicode property name."),
7461
+ Unknown_Unicode_property_name: diag(1522, 1 /* Error */, "Unknown_Unicode_property_name_1522", "Unknown Unicode property name."),
7462
+ Expected_a_Unicode_property_value: diag(1523, 1 /* Error */, "Expected_a_Unicode_property_value_1523", "Expected a Unicode property value."),
7463
+ Unknown_Unicode_property_value: diag(1524, 1 /* Error */, "Unknown_Unicode_property_value_1524", "Unknown Unicode property value."),
7464
+ 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."),
7465
+ 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."),
7466
+ Unknown_Unicode_property_name_or_value: diag(1527, 1 /* Error */, "Unknown_Unicode_property_name_or_value_1527", "Unknown Unicode property name or value."),
7467
+ 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."),
7468
+ _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."),
7469
+ 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."),
7470
+ 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."),
7471
+ 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."),
7472
+ _0_is_not_a_valid_character_escape: diag(1533, 1 /* Error */, "_0_is_not_a_valid_character_escape_1533", "'\\{0}' is not a valid character escape."),
7420
7473
  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."),
7421
7474
  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."),
7422
7475
  Call_signature_return_types_0_and_1_are_incompatible: diag(
@@ -9151,6 +9204,15 @@ ${lanes.join("\n")}
9151
9204
  function stringToToken(s) {
9152
9205
  return textToToken.get(s);
9153
9206
  }
9207
+ function regularExpressionFlagToCharacter(f) {
9208
+ return regExpFlagChars[f];
9209
+ }
9210
+ function characterToRegularExpressionFlag(c) {
9211
+ return charToRegExpFlag.get(c);
9212
+ }
9213
+ function regularExpressionFlagToFirstAvailableLanguageVersion(f) {
9214
+ return regExpFlagToFirstAvailableLanguageVersion.get(f);
9215
+ }
9154
9216
  function computeLineStarts(text) {
9155
9217
  const result = [];
9156
9218
  let pos = 0;
@@ -9247,8 +9309,11 @@ ${lanes.join("\n")}
9247
9309
  function isHexDigit(ch) {
9248
9310
  return isDigit(ch) || ch >= 65 /* A */ && ch <= 70 /* F */ || ch >= 97 /* a */ && ch <= 102 /* f */;
9249
9311
  }
9250
- function isCodePoint(code) {
9251
- return code <= 1114111;
9312
+ function isASCIILetter(ch) {
9313
+ return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */;
9314
+ }
9315
+ function isWordCharacter(ch) {
9316
+ return isASCIILetter(ch) || isDigit(ch) || ch === 95 /* _ */;
9252
9317
  }
9253
9318
  function isOctalDigit(ch) {
9254
9319
  return ch >= 48 /* _0 */ && ch <= 55 /* _7 */;
@@ -9585,10 +9650,10 @@ ${lanes.join("\n")}
9585
9650
  }
9586
9651
  }
9587
9652
  function isIdentifierStart(ch, languageVersion) {
9588
- return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion);
9653
+ return isASCIILetter(ch) || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion);
9589
9654
  }
9590
9655
  function isIdentifierPart(ch, languageVersion, identifierVariant) {
9591
- 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
9656
+ return isWordCharacter(ch) || ch === 36 /* $ */ || // "-" and ":" are valid in JSX Identifiers
9592
9657
  (identifierVariant === 1 /* JSX */ ? ch === 45 /* minus */ || ch === 58 /* colon */ : false) || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion);
9593
9658
  }
9594
9659
  function isIdentifierText(name, languageVersion, identifierVariant) {
@@ -9909,7 +9974,9 @@ ${lanes.join("\n")}
9909
9974
  result += text.substring(start2, pos);
9910
9975
  result += scanEscapeSequence(
9911
9976
  /*shouldEmitInvalidEscapeError*/
9912
- true
9977
+ true,
9978
+ /*isRegularExpression*/
9979
+ false
9913
9980
  );
9914
9981
  start2 = pos;
9915
9982
  continue;
@@ -9953,7 +10020,11 @@ ${lanes.join("\n")}
9953
10020
  }
9954
10021
  if (currChar === 92 /* backslash */) {
9955
10022
  contents += text.substring(start2, pos);
9956
- contents += scanEscapeSequence(shouldEmitInvalidEscapeError);
10023
+ contents += scanEscapeSequence(
10024
+ shouldEmitInvalidEscapeError,
10025
+ /*isRegularExpression*/
10026
+ false
10027
+ );
9957
10028
  start2 = pos;
9958
10029
  continue;
9959
10030
  }
@@ -9973,7 +10044,7 @@ ${lanes.join("\n")}
9973
10044
  tokenValue = contents;
9974
10045
  return resultingToken;
9975
10046
  }
9976
- function scanEscapeSequence(shouldEmitInvalidEscapeError) {
10047
+ function scanEscapeSequence(shouldEmitInvalidEscapeError, isRegularExpression) {
9977
10048
  const start2 = pos;
9978
10049
  pos++;
9979
10050
  if (pos >= end) {
@@ -10001,7 +10072,7 @@ ${lanes.join("\n")}
10001
10072
  pos++;
10002
10073
  }
10003
10074
  tokenFlags |= 2048 /* ContainsInvalidEscape */;
10004
- if (shouldEmitInvalidEscapeError) {
10075
+ if (isRegularExpression || shouldEmitInvalidEscapeError) {
10005
10076
  const code = parseInt(text.substring(start2 + 1, pos), 8);
10006
10077
  error2(Diagnostics.Octal_escape_sequences_are_not_allowed_Use_the_syntax_0, start2, pos - start2, "\\x" + code.toString(16).padStart(2, "0"));
10007
10078
  return String.fromCharCode(code);
@@ -10010,7 +10081,7 @@ ${lanes.join("\n")}
10010
10081
  case 56 /* _8 */:
10011
10082
  case 57 /* _9 */:
10012
10083
  tokenFlags |= 2048 /* ContainsInvalidEscape */;
10013
- if (shouldEmitInvalidEscapeError) {
10084
+ if (isRegularExpression || shouldEmitInvalidEscapeError) {
10014
10085
  error2(Diagnostics.Escape_sequence_0_is_not_allowed, start2, pos - start2, text.substring(start2, pos));
10015
10086
  return String.fromCharCode(ch);
10016
10087
  }
@@ -10032,62 +10103,42 @@ ${lanes.join("\n")}
10032
10103
  case 34 /* doubleQuote */:
10033
10104
  return '"';
10034
10105
  case 117 /* u */:
10035
- if (pos < end && text.charCodeAt(pos) === 123 /* openBrace */) {
10036
- pos++;
10037
- const escapedValueString = scanMinimumNumberOfHexDigits(
10038
- 1,
10039
- /*canHaveSeparators*/
10040
- false
10041
- );
10042
- const escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1;
10043
- if (escapedValue < 0) {
10044
- tokenFlags |= 2048 /* ContainsInvalidEscape */;
10045
- if (shouldEmitInvalidEscapeError) {
10046
- error2(Diagnostics.Hexadecimal_digit_expected);
10047
- }
10048
- return text.substring(start2, pos);
10049
- }
10050
- if (!isCodePoint(escapedValue)) {
10051
- tokenFlags |= 2048 /* ContainsInvalidEscape */;
10052
- if (shouldEmitInvalidEscapeError) {
10053
- error2(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive);
10054
- }
10055
- return text.substring(start2, pos);
10056
- }
10057
- if (pos >= end) {
10058
- tokenFlags |= 2048 /* ContainsInvalidEscape */;
10059
- if (shouldEmitInvalidEscapeError) {
10060
- error2(Diagnostics.Unexpected_end_of_text);
10061
- }
10062
- return text.substring(start2, pos);
10063
- }
10064
- if (text.charCodeAt(pos) !== 125 /* closeBrace */) {
10065
- tokenFlags |= 2048 /* ContainsInvalidEscape */;
10066
- if (shouldEmitInvalidEscapeError) {
10067
- error2(Diagnostics.Unterminated_Unicode_escape_sequence);
10068
- }
10069
- return text.substring(start2, pos);
10070
- }
10071
- pos++;
10072
- tokenFlags |= 8 /* ExtendedUnicodeEscape */;
10073
- return utf16EncodeAsString(escapedValue);
10106
+ if ((!isRegularExpression || shouldEmitInvalidEscapeError) && pos < end && text.charCodeAt(pos) === 123 /* openBrace */) {
10107
+ pos -= 2;
10108
+ return scanExtendedUnicodeEscape(isRegularExpression || shouldEmitInvalidEscapeError);
10074
10109
  }
10075
10110
  for (; pos < start2 + 6; pos++) {
10076
10111
  if (!(pos < end && isHexDigit(text.charCodeAt(pos)))) {
10077
10112
  tokenFlags |= 2048 /* ContainsInvalidEscape */;
10078
- if (shouldEmitInvalidEscapeError) {
10113
+ if (isRegularExpression || shouldEmitInvalidEscapeError) {
10079
10114
  error2(Diagnostics.Hexadecimal_digit_expected);
10080
10115
  }
10081
10116
  return text.substring(start2, pos);
10082
10117
  }
10083
10118
  }
10084
10119
  tokenFlags |= 1024 /* UnicodeEscape */;
10085
- return String.fromCharCode(parseInt(text.substring(start2 + 2, pos), 16));
10120
+ const escapedValue = parseInt(text.substring(start2 + 2, pos), 16);
10121
+ const escapedValueString = String.fromCharCode(escapedValue);
10122
+ if (isRegularExpression && shouldEmitInvalidEscapeError && escapedValue >= 55296 && escapedValue <= 56319 && pos + 6 < end && text.substring(pos, pos + 2) === "\\u" && text.charCodeAt(pos + 2) !== 123 /* openBrace */) {
10123
+ const nextStart = pos;
10124
+ let nextPos = pos + 2;
10125
+ for (; nextPos < nextStart + 6; nextPos++) {
10126
+ if (!isHexDigit(text.charCodeAt(pos))) {
10127
+ return escapedValueString;
10128
+ }
10129
+ }
10130
+ const nextEscapedValue = parseInt(text.substring(nextStart + 2, nextPos), 16);
10131
+ if (nextEscapedValue >= 56320 && nextEscapedValue <= 57343) {
10132
+ pos = nextPos;
10133
+ return escapedValueString + String.fromCharCode(nextEscapedValue);
10134
+ }
10135
+ }
10136
+ return escapedValueString;
10086
10137
  case 120 /* x */:
10087
10138
  for (; pos < start2 + 4; pos++) {
10088
10139
  if (!(pos < end && isHexDigit(text.charCodeAt(pos)))) {
10089
10140
  tokenFlags |= 2048 /* ContainsInvalidEscape */;
10090
- if (shouldEmitInvalidEscapeError) {
10141
+ if (isRegularExpression || shouldEmitInvalidEscapeError) {
10091
10142
  error2(Diagnostics.Hexadecimal_digit_expected);
10092
10143
  }
10093
10144
  return text.substring(start2, pos);
@@ -10104,10 +10155,16 @@ ${lanes.join("\n")}
10104
10155
  case 8233 /* paragraphSeparator */:
10105
10156
  return "";
10106
10157
  default:
10158
+ if (isRegularExpression && (shouldEmitInvalidEscapeError || isIdentifierPart(ch, languageVersion))) {
10159
+ error2(Diagnostics._0_is_not_a_valid_character_escape, pos - 2, 2, String.fromCharCode(ch));
10160
+ }
10107
10161
  return String.fromCharCode(ch);
10108
10162
  }
10109
10163
  }
10110
- function scanExtendedUnicodeEscape() {
10164
+ function scanExtendedUnicodeEscape(shouldEmitInvalidEscapeError = true) {
10165
+ const start2 = pos;
10166
+ pos += 3;
10167
+ const escapedStart = pos;
10111
10168
  const escapedValueString = scanMinimumNumberOfHexDigits(
10112
10169
  1,
10113
10170
  /*canHaveSeparators*/
@@ -10116,24 +10173,34 @@ ${lanes.join("\n")}
10116
10173
  const escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1;
10117
10174
  let isInvalidExtendedEscape = false;
10118
10175
  if (escapedValue < 0) {
10119
- error2(Diagnostics.Hexadecimal_digit_expected);
10176
+ if (shouldEmitInvalidEscapeError) {
10177
+ error2(Diagnostics.Hexadecimal_digit_expected);
10178
+ }
10120
10179
  isInvalidExtendedEscape = true;
10121
10180
  } else if (escapedValue > 1114111) {
10122
- error2(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive);
10181
+ if (shouldEmitInvalidEscapeError) {
10182
+ error2(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive, escapedStart, pos - escapedStart);
10183
+ }
10123
10184
  isInvalidExtendedEscape = true;
10124
10185
  }
10125
10186
  if (pos >= end) {
10126
- error2(Diagnostics.Unexpected_end_of_text);
10187
+ if (shouldEmitInvalidEscapeError) {
10188
+ error2(Diagnostics.Unexpected_end_of_text);
10189
+ }
10127
10190
  isInvalidExtendedEscape = true;
10128
10191
  } else if (text.charCodeAt(pos) === 125 /* closeBrace */) {
10129
10192
  pos++;
10130
10193
  } else {
10131
- error2(Diagnostics.Unterminated_Unicode_escape_sequence);
10194
+ if (shouldEmitInvalidEscapeError) {
10195
+ error2(Diagnostics.Unterminated_Unicode_escape_sequence);
10196
+ }
10132
10197
  isInvalidExtendedEscape = true;
10133
10198
  }
10134
10199
  if (isInvalidExtendedEscape) {
10135
- return "";
10200
+ tokenFlags |= 2048 /* ContainsInvalidEscape */;
10201
+ return text.substring(start2, pos);
10136
10202
  }
10203
+ tokenFlags |= 8 /* ExtendedUnicodeEscape */;
10137
10204
  return utf16EncodeAsString(escapedValue);
10138
10205
  }
10139
10206
  function peekUnicodeEscape() {
@@ -10175,8 +10242,6 @@ ${lanes.join("\n")}
10175
10242
  } else if (ch === 92 /* backslash */) {
10176
10243
  ch = peekExtendedUnicodeEscape();
10177
10244
  if (ch >= 0 && isIdentifierPart(ch, languageVersion)) {
10178
- pos += 3;
10179
- tokenFlags |= 8 /* ExtendedUnicodeEscape */;
10180
10245
  result += scanExtendedUnicodeEscape();
10181
10246
  start2 = pos;
10182
10247
  continue;
@@ -10647,8 +10712,6 @@ ${lanes.join("\n")}
10647
10712
  case 92 /* backslash */:
10648
10713
  const extendedCookedChar = peekExtendedUnicodeEscape();
10649
10714
  if (extendedCookedChar >= 0 && isIdentifierStart(extendedCookedChar, languageVersion)) {
10650
- pos += 3;
10651
- tokenFlags |= 8 /* ExtendedUnicodeEscape */;
10652
10715
  tokenValue = scanExtendedUnicodeEscape() + scanIdentifierParts();
10653
10716
  return token = getIdentifierToken();
10654
10717
  }
@@ -10664,7 +10727,7 @@ ${lanes.join("\n")}
10664
10727
  return token = 0 /* Unknown */;
10665
10728
  case 35 /* hash */:
10666
10729
  if (pos !== 0 && text[pos + 1] === "!") {
10667
- error2(Diagnostics.can_only_be_used_at_the_start_of_a_file);
10730
+ error2(Diagnostics.can_only_be_used_at_the_start_of_a_file, pos, 2);
10668
10731
  pos++;
10669
10732
  return token = 0 /* Unknown */;
10670
10733
  }
@@ -10673,8 +10736,6 @@ ${lanes.join("\n")}
10673
10736
  pos++;
10674
10737
  const extendedCookedChar2 = peekExtendedUnicodeEscape();
10675
10738
  if (extendedCookedChar2 >= 0 && isIdentifierStart(extendedCookedChar2, languageVersion)) {
10676
- pos += 3;
10677
- tokenFlags |= 8 /* ExtendedUnicodeEscape */;
10678
10739
  tokenValue = "#" + scanExtendedUnicodeEscape() + scanIdentifierParts();
10679
10740
  return token = 81 /* PrivateIdentifier */;
10680
10741
  }
@@ -10812,14 +10873,841 @@ ${lanes.join("\n")}
10812
10873
  }
10813
10874
  p++;
10814
10875
  }
10815
- while (p < end && isIdentifierPart(text.charCodeAt(p), languageVersion)) {
10876
+ const isUnterminated = !!(tokenFlags & 4 /* Unterminated */);
10877
+ const endOfBody = p - (isUnterminated ? 0 : 1);
10878
+ let regExpFlags = 0 /* None */;
10879
+ while (p < end) {
10880
+ const ch = text.charCodeAt(p);
10881
+ if (!isIdentifierPart(ch, languageVersion)) {
10882
+ break;
10883
+ }
10884
+ const flag = characterToRegularExpressionFlag(String.fromCharCode(ch));
10885
+ if (flag === void 0) {
10886
+ error2(Diagnostics.Unknown_regular_expression_flag, p, 1);
10887
+ } else if (regExpFlags & flag) {
10888
+ error2(Diagnostics.Duplicate_regular_expression_flag, p, 1);
10889
+ } else if (((regExpFlags | flag) & 96 /* UnicodeMode */) === 96 /* UnicodeMode */) {
10890
+ error2(Diagnostics.The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously, p, 1);
10891
+ } else {
10892
+ regExpFlags |= flag;
10893
+ const availableFrom = regularExpressionFlagToFirstAvailableLanguageVersion(flag);
10894
+ if (languageVersion < availableFrom) {
10895
+ error2(Diagnostics.This_regular_expression_flag_is_only_available_when_targeting_0_or_later, p, 1, ScriptTarget[availableFrom]);
10896
+ }
10897
+ }
10816
10898
  p++;
10817
10899
  }
10818
- pos = p;
10900
+ pos = tokenStart + 1;
10901
+ const saveTokenPos = tokenStart;
10902
+ const saveTokenFlags = tokenFlags;
10903
+ scanRegularExpressionWorker(text.slice(0, endOfBody), endOfBody, regExpFlags, isUnterminated);
10904
+ if (!isUnterminated) {
10905
+ pos = p;
10906
+ }
10907
+ tokenStart = saveTokenPos;
10908
+ tokenFlags = saveTokenFlags;
10819
10909
  tokenValue = text.substring(tokenStart, pos);
10820
10910
  token = 14 /* RegularExpressionLiteral */;
10821
10911
  }
10822
10912
  return token;
10913
+ function scanRegularExpressionWorker(text2, end2, regExpFlags, isUnterminated) {
10914
+ const unicodeMode = !!(regExpFlags & 96 /* UnicodeMode */);
10915
+ const unicodeSetsMode = !!(regExpFlags & 64 /* UnicodeSets */);
10916
+ let mayContainStrings = false;
10917
+ let numberOfCapturingGroups = 0;
10918
+ const groupSpecifiers = /* @__PURE__ */ new Set();
10919
+ const groupNameReferences = [];
10920
+ const decimalEscapes = [];
10921
+ const namedCapturingGroups = [];
10922
+ function scanDisjunction(isInGroup) {
10923
+ while (true) {
10924
+ namedCapturingGroups.push(/* @__PURE__ */ new Set());
10925
+ scanAlternative(isInGroup);
10926
+ namedCapturingGroups.pop();
10927
+ if (text2.charCodeAt(pos) !== 124 /* bar */) {
10928
+ return;
10929
+ }
10930
+ pos++;
10931
+ }
10932
+ }
10933
+ function scanAlternative(isInGroup) {
10934
+ let isPreviousTermQuantifiable = false;
10935
+ while (pos < end2) {
10936
+ const start2 = pos;
10937
+ const ch = text2.charCodeAt(pos);
10938
+ switch (ch) {
10939
+ case 94 /* caret */:
10940
+ case 36 /* $ */:
10941
+ pos++;
10942
+ isPreviousTermQuantifiable = false;
10943
+ break;
10944
+ case 92 /* backslash */:
10945
+ pos++;
10946
+ switch (text2.charCodeAt(pos)) {
10947
+ case 98 /* b */:
10948
+ case 66 /* B */:
10949
+ pos++;
10950
+ isPreviousTermQuantifiable = false;
10951
+ break;
10952
+ default:
10953
+ scanAtomEscape();
10954
+ isPreviousTermQuantifiable = true;
10955
+ break;
10956
+ }
10957
+ break;
10958
+ case 40 /* openParen */:
10959
+ pos++;
10960
+ if (text2.charCodeAt(pos) === 63 /* question */) {
10961
+ pos++;
10962
+ switch (text2.charCodeAt(pos)) {
10963
+ case 61 /* equals */:
10964
+ case 33 /* exclamation */:
10965
+ pos++;
10966
+ isPreviousTermQuantifiable = false;
10967
+ break;
10968
+ case 60 /* lessThan */:
10969
+ const groupNameStart = pos;
10970
+ pos++;
10971
+ switch (text2.charCodeAt(pos)) {
10972
+ case 61 /* equals */:
10973
+ case 33 /* exclamation */:
10974
+ pos++;
10975
+ isPreviousTermQuantifiable = false;
10976
+ break;
10977
+ default:
10978
+ scanGroupName(
10979
+ /*isReference*/
10980
+ false
10981
+ );
10982
+ scanExpectedChar(62 /* greaterThan */);
10983
+ if (languageVersion < 5 /* ES2018 */) {
10984
+ error2(Diagnostics.Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later, groupNameStart, pos - groupNameStart);
10985
+ }
10986
+ numberOfCapturingGroups++;
10987
+ isPreviousTermQuantifiable = true;
10988
+ break;
10989
+ }
10990
+ break;
10991
+ default:
10992
+ const start3 = pos;
10993
+ const setFlags = scanPatternModifiers();
10994
+ if (text2.charCodeAt(pos) === 45 /* minus */) {
10995
+ pos++;
10996
+ scanPatternModifiers(setFlags);
10997
+ if (pos === start3 + 1) {
10998
+ error2(Diagnostics.Subpattern_flags_must_be_present_when_there_is_a_minus_sign, start3, pos - start3);
10999
+ }
11000
+ }
11001
+ scanExpectedChar(58 /* colon */);
11002
+ isPreviousTermQuantifiable = true;
11003
+ break;
11004
+ }
11005
+ } else {
11006
+ numberOfCapturingGroups++;
11007
+ isPreviousTermQuantifiable = true;
11008
+ }
11009
+ scanDisjunction(
11010
+ /*isInGroup*/
11011
+ true
11012
+ );
11013
+ scanExpectedChar(41 /* closeParen */);
11014
+ break;
11015
+ case 123 /* openBrace */:
11016
+ pos++;
11017
+ const digitsStart = pos;
11018
+ scanDigits();
11019
+ const min2 = tokenValue;
11020
+ if (text2.charCodeAt(pos) === 44 /* comma */) {
11021
+ pos++;
11022
+ scanDigits();
11023
+ const max = tokenValue;
11024
+ if (!min2) {
11025
+ if (max || text2.charCodeAt(pos) === 125 /* closeBrace */) {
11026
+ error2(Diagnostics.Incomplete_quantifier_Digit_expected, digitsStart, 0);
11027
+ } else {
11028
+ if (unicodeMode) {
11029
+ error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, start2, 1, String.fromCharCode(ch));
11030
+ }
11031
+ isPreviousTermQuantifiable = true;
11032
+ break;
11033
+ }
11034
+ }
11035
+ if (max && Number.parseInt(min2) > Number.parseInt(max)) {
11036
+ error2(Diagnostics.Numbers_out_of_order_in_quantifier, digitsStart, pos - digitsStart);
11037
+ }
11038
+ } else if (!min2) {
11039
+ if (unicodeMode) {
11040
+ error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, start2, 1, String.fromCharCode(ch));
11041
+ }
11042
+ isPreviousTermQuantifiable = true;
11043
+ break;
11044
+ }
11045
+ scanExpectedChar(125 /* closeBrace */);
11046
+ pos--;
11047
+ case 42 /* asterisk */:
11048
+ case 43 /* plus */:
11049
+ case 63 /* question */:
11050
+ pos++;
11051
+ if (text2.charCodeAt(pos) === 63 /* question */) {
11052
+ pos++;
11053
+ }
11054
+ if (!isPreviousTermQuantifiable) {
11055
+ error2(Diagnostics.There_is_nothing_available_for_repetition, start2, pos - start2);
11056
+ }
11057
+ isPreviousTermQuantifiable = false;
11058
+ break;
11059
+ case 46 /* dot */:
11060
+ pos++;
11061
+ isPreviousTermQuantifiable = true;
11062
+ break;
11063
+ case 91 /* openBracket */:
11064
+ pos++;
11065
+ if (unicodeSetsMode) {
11066
+ scanClassSetExpression();
11067
+ } else {
11068
+ scanClassRanges();
11069
+ }
11070
+ scanExpectedChar(93 /* closeBracket */);
11071
+ isPreviousTermQuantifiable = true;
11072
+ break;
11073
+ case 41 /* closeParen */:
11074
+ if (isInGroup) {
11075
+ return;
11076
+ }
11077
+ case 93 /* closeBracket */:
11078
+ case 125 /* closeBrace */:
11079
+ if (isUnterminated && !isInGroup) {
11080
+ return;
11081
+ }
11082
+ if (unicodeMode) {
11083
+ error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
11084
+ }
11085
+ pos++;
11086
+ isPreviousTermQuantifiable = true;
11087
+ break;
11088
+ case 47 /* slash */:
11089
+ case 124 /* bar */:
11090
+ return;
11091
+ default:
11092
+ scanSourceCharacter();
11093
+ isPreviousTermQuantifiable = true;
11094
+ break;
11095
+ }
11096
+ }
11097
+ }
11098
+ function scanPatternModifiers(currFlags = 0 /* None */) {
11099
+ while (pos < end2) {
11100
+ const ch = text2.charCodeAt(pos);
11101
+ if (!isIdentifierPart(ch, languageVersion)) {
11102
+ break;
11103
+ }
11104
+ const flag = characterToRegularExpressionFlag(String.fromCharCode(ch));
11105
+ if (flag === void 0) {
11106
+ error2(Diagnostics.Unknown_regular_expression_flag, pos, 1);
11107
+ } else if (currFlags & flag) {
11108
+ error2(Diagnostics.Duplicate_regular_expression_flag, pos, 1);
11109
+ } else if (!(flag & 28 /* Modifiers */)) {
11110
+ error2(Diagnostics.This_regular_expression_flag_cannot_be_toggled_within_a_subpattern, pos, 1);
11111
+ } else {
11112
+ currFlags |= flag;
11113
+ const availableFrom = regularExpressionFlagToFirstAvailableLanguageVersion(flag);
11114
+ if (languageVersion < availableFrom) {
11115
+ error2(Diagnostics.This_regular_expression_flag_is_only_available_when_targeting_0_or_later, pos, 1, ScriptTarget[availableFrom]);
11116
+ }
11117
+ }
11118
+ pos++;
11119
+ }
11120
+ return currFlags;
11121
+ }
11122
+ function scanAtomEscape() {
11123
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 92 /* backslash */);
11124
+ switch (text2.charCodeAt(pos)) {
11125
+ case 107 /* k */:
11126
+ pos++;
11127
+ if (text2.charCodeAt(pos) === 60 /* lessThan */) {
11128
+ pos++;
11129
+ scanGroupName(
11130
+ /*isReference*/
11131
+ true
11132
+ );
11133
+ scanExpectedChar(62 /* greaterThan */);
11134
+ } else if (unicodeMode) {
11135
+ error2(Diagnostics.k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets, pos - 2, 2);
11136
+ }
11137
+ break;
11138
+ case 113 /* q */:
11139
+ if (unicodeSetsMode) {
11140
+ pos++;
11141
+ error2(Diagnostics.q_is_only_available_inside_character_class, pos - 2, 2);
11142
+ break;
11143
+ }
11144
+ default:
11145
+ scanCharacterClassEscape() || scanDecimalEscape() || scanCharacterEscape();
11146
+ break;
11147
+ }
11148
+ }
11149
+ function scanDecimalEscape() {
11150
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 92 /* backslash */);
11151
+ const ch = text2.charCodeAt(pos);
11152
+ if (ch >= 49 /* _1 */ && ch <= 57 /* _9 */) {
11153
+ const start2 = pos;
11154
+ scanDigits();
11155
+ decimalEscapes.push({ pos: start2, end: pos, value: +tokenValue });
11156
+ return true;
11157
+ }
11158
+ return false;
11159
+ }
11160
+ function scanCharacterEscape() {
11161
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 92 /* backslash */);
11162
+ let ch = text2.charCodeAt(pos);
11163
+ switch (ch) {
11164
+ case 99 /* c */:
11165
+ pos++;
11166
+ ch = text2.charCodeAt(pos);
11167
+ if (isASCIILetter(ch)) {
11168
+ pos++;
11169
+ return String.fromCharCode(ch & 31);
11170
+ }
11171
+ if (unicodeMode) {
11172
+ error2(Diagnostics.c_must_be_followed_by_an_ASCII_letter, pos - 2, 2);
11173
+ }
11174
+ return String.fromCharCode(ch);
11175
+ case 94 /* caret */:
11176
+ case 36 /* $ */:
11177
+ case 47 /* slash */:
11178
+ case 92 /* backslash */:
11179
+ case 46 /* dot */:
11180
+ case 42 /* asterisk */:
11181
+ case 43 /* plus */:
11182
+ case 63 /* question */:
11183
+ case 40 /* openParen */:
11184
+ case 41 /* closeParen */:
11185
+ case 91 /* openBracket */:
11186
+ case 93 /* closeBracket */:
11187
+ case 123 /* openBrace */:
11188
+ case 125 /* closeBrace */:
11189
+ case 124 /* bar */:
11190
+ pos++;
11191
+ return String.fromCharCode(ch);
11192
+ default:
11193
+ if (pos >= end2) {
11194
+ error2(Diagnostics.Undetermined_character_escape, pos - 1, 1, ch);
11195
+ return "\\";
11196
+ }
11197
+ pos--;
11198
+ return scanEscapeSequence(
11199
+ /*shouldEmitInvalidEscapeError*/
11200
+ unicodeMode,
11201
+ /*isRegularExpression*/
11202
+ true
11203
+ );
11204
+ }
11205
+ }
11206
+ function scanGroupName(isReference) {
11207
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 60 /* lessThan */);
11208
+ tokenStart = pos;
11209
+ scanIdentifier(codePointAt(text2, pos), languageVersion);
11210
+ if (pos === tokenStart) {
11211
+ error2(Diagnostics.Expected_a_capturing_group_name);
11212
+ } else if (isReference) {
11213
+ groupNameReferences.push({ pos: tokenStart, end: pos, name: tokenValue });
11214
+ } else if (namedCapturingGroups.some((group2) => group2.has(tokenValue))) {
11215
+ error2(Diagnostics.Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other, tokenStart, pos - tokenStart);
11216
+ } else {
11217
+ last(namedCapturingGroups).add(tokenValue);
11218
+ groupSpecifiers.add(tokenValue);
11219
+ }
11220
+ }
11221
+ function isClassContentExit(ch) {
11222
+ return ch === 93 /* closeBracket */ || pos >= end2;
11223
+ }
11224
+ function scanClassRanges() {
11225
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 91 /* openBracket */);
11226
+ if (text2.charCodeAt(pos) === 94 /* caret */) {
11227
+ pos++;
11228
+ }
11229
+ while (pos < end2) {
11230
+ const ch = text2.charCodeAt(pos);
11231
+ if (isClassContentExit(ch)) {
11232
+ return;
11233
+ }
11234
+ const minStart = pos;
11235
+ const minCharacter = scanClassAtom();
11236
+ if (text2.charCodeAt(pos) === 45 /* minus */) {
11237
+ pos++;
11238
+ const ch2 = text2.charCodeAt(pos);
11239
+ if (isClassContentExit(ch2)) {
11240
+ return;
11241
+ }
11242
+ if (!minCharacter) {
11243
+ error2(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, minStart, pos - 1 - minStart);
11244
+ }
11245
+ const maxStart = pos;
11246
+ const maxCharacter = scanClassAtom();
11247
+ if (!maxCharacter) {
11248
+ error2(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, maxStart, pos - maxStart);
11249
+ continue;
11250
+ }
11251
+ if (!minCharacter) {
11252
+ continue;
11253
+ }
11254
+ const minCharacterValue = codePointAt(minCharacter, 0);
11255
+ const maxCharacterValue = codePointAt(maxCharacter, 0);
11256
+ if (minCharacter.length === charSize(minCharacterValue) && maxCharacter.length === charSize(maxCharacterValue) && minCharacterValue > maxCharacterValue) {
11257
+ error2(Diagnostics.Range_out_of_order_in_character_class, minStart, pos - minStart);
11258
+ }
11259
+ }
11260
+ }
11261
+ }
11262
+ function scanClassSetExpression() {
11263
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 91 /* openBracket */);
11264
+ let isCharacterComplement = false;
11265
+ if (text2.charCodeAt(pos) === 94 /* caret */) {
11266
+ pos++;
11267
+ isCharacterComplement = true;
11268
+ }
11269
+ let expressionMayContainStrings = false;
11270
+ let ch = text2.charCodeAt(pos);
11271
+ if (isClassContentExit(ch)) {
11272
+ return;
11273
+ }
11274
+ let start2 = pos;
11275
+ let oprand;
11276
+ switch (text2.slice(pos, pos + 2)) {
11277
+ case "--":
11278
+ case "&&":
11279
+ error2(Diagnostics.Expected_a_class_set_oprand);
11280
+ mayContainStrings = false;
11281
+ break;
11282
+ default:
11283
+ oprand = scanClassSetOprand();
11284
+ break;
11285
+ }
11286
+ switch (text2.charCodeAt(pos)) {
11287
+ case 45 /* minus */:
11288
+ if (text2.charCodeAt(pos + 1) === 45 /* minus */) {
11289
+ if (isCharacterComplement && mayContainStrings) {
11290
+ error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start2, pos - start2);
11291
+ }
11292
+ expressionMayContainStrings = mayContainStrings;
11293
+ scanClassSetSubExpression(3 /* ClassSubtraction */);
11294
+ mayContainStrings = !isCharacterComplement && expressionMayContainStrings;
11295
+ return;
11296
+ }
11297
+ break;
11298
+ case 38 /* ampersand */:
11299
+ if (text2.charCodeAt(pos + 1) === 38 /* ampersand */) {
11300
+ scanClassSetSubExpression(2 /* ClassIntersection */);
11301
+ if (isCharacterComplement && mayContainStrings) {
11302
+ error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start2, pos - start2);
11303
+ }
11304
+ expressionMayContainStrings = mayContainStrings;
11305
+ mayContainStrings = !isCharacterComplement && expressionMayContainStrings;
11306
+ return;
11307
+ } else {
11308
+ error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
11309
+ }
11310
+ break;
11311
+ default:
11312
+ if (isCharacterComplement && mayContainStrings) {
11313
+ error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start2, pos - start2);
11314
+ }
11315
+ expressionMayContainStrings = mayContainStrings;
11316
+ break;
11317
+ }
11318
+ while (pos < end2) {
11319
+ ch = text2.charCodeAt(pos);
11320
+ switch (ch) {
11321
+ case 45 /* minus */:
11322
+ pos++;
11323
+ ch = text2.charCodeAt(pos);
11324
+ if (isClassContentExit(ch)) {
11325
+ mayContainStrings = !isCharacterComplement && expressionMayContainStrings;
11326
+ return;
11327
+ }
11328
+ if (ch === 45 /* minus */) {
11329
+ pos++;
11330
+ error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2);
11331
+ start2 = pos - 2;
11332
+ oprand = text2.slice(start2, pos);
11333
+ continue;
11334
+ } else {
11335
+ if (!oprand) {
11336
+ error2(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, start2, pos - 1 - start2);
11337
+ }
11338
+ const secondStart = pos;
11339
+ const secondOprand = scanClassSetOprand();
11340
+ if (isCharacterComplement && mayContainStrings) {
11341
+ error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, secondStart, pos - secondStart);
11342
+ }
11343
+ expressionMayContainStrings || (expressionMayContainStrings = mayContainStrings);
11344
+ if (!secondOprand) {
11345
+ error2(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, secondStart, pos - secondStart);
11346
+ break;
11347
+ }
11348
+ if (!oprand) {
11349
+ break;
11350
+ }
11351
+ const minCharacterValue = codePointAt(oprand, 0);
11352
+ const maxCharacterValue = codePointAt(secondOprand, 0);
11353
+ if (oprand.length === charSize(minCharacterValue) && secondOprand.length === charSize(maxCharacterValue) && minCharacterValue > maxCharacterValue) {
11354
+ error2(Diagnostics.Range_out_of_order_in_character_class, start2, pos - start2);
11355
+ }
11356
+ }
11357
+ break;
11358
+ case 38 /* ampersand */:
11359
+ start2 = pos;
11360
+ pos++;
11361
+ if (text2.charCodeAt(pos) === 38 /* ampersand */) {
11362
+ pos++;
11363
+ error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2);
11364
+ if (text2.charCodeAt(pos) === 38 /* ampersand */) {
11365
+ error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
11366
+ pos++;
11367
+ }
11368
+ } else {
11369
+ error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos - 1, 1, String.fromCharCode(ch));
11370
+ }
11371
+ oprand = text2.slice(start2, pos);
11372
+ continue;
11373
+ }
11374
+ if (isClassContentExit(text2.charCodeAt(pos))) {
11375
+ break;
11376
+ }
11377
+ start2 = pos;
11378
+ switch (text2.slice(pos, pos + 2)) {
11379
+ case "--":
11380
+ case "&&":
11381
+ error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos, 2);
11382
+ pos += 2;
11383
+ oprand = text2.slice(start2, pos);
11384
+ break;
11385
+ default:
11386
+ oprand = scanClassSetOprand();
11387
+ break;
11388
+ }
11389
+ }
11390
+ mayContainStrings = !isCharacterComplement && expressionMayContainStrings;
11391
+ }
11392
+ function scanClassSetSubExpression(expressionType) {
11393
+ let expressionMayContainStrings = mayContainStrings;
11394
+ while (pos < end2) {
11395
+ let ch = text2.charCodeAt(pos);
11396
+ if (isClassContentExit(ch)) {
11397
+ break;
11398
+ }
11399
+ switch (ch) {
11400
+ case 45 /* minus */:
11401
+ pos++;
11402
+ if (text2.charCodeAt(pos) === 45 /* minus */) {
11403
+ pos++;
11404
+ if (expressionType !== 3 /* ClassSubtraction */) {
11405
+ error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2);
11406
+ }
11407
+ } else {
11408
+ error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 1, 1);
11409
+ }
11410
+ break;
11411
+ case 38 /* ampersand */:
11412
+ pos++;
11413
+ if (text2.charCodeAt(pos) === 38 /* ampersand */) {
11414
+ pos++;
11415
+ if (expressionType !== 2 /* ClassIntersection */) {
11416
+ error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2);
11417
+ }
11418
+ if (text2.charCodeAt(pos) === 38 /* ampersand */) {
11419
+ error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
11420
+ pos++;
11421
+ }
11422
+ } else {
11423
+ error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos - 1, 1, String.fromCharCode(ch));
11424
+ }
11425
+ break;
11426
+ default:
11427
+ switch (expressionType) {
11428
+ case 3 /* ClassSubtraction */:
11429
+ error2(Diagnostics._0_expected, pos, 0, "--");
11430
+ break;
11431
+ case 2 /* ClassIntersection */:
11432
+ error2(Diagnostics._0_expected, pos, 0, "&&");
11433
+ break;
11434
+ default:
11435
+ break;
11436
+ }
11437
+ break;
11438
+ }
11439
+ ch = text2.charCodeAt(pos);
11440
+ if (isClassContentExit(ch)) {
11441
+ error2(Diagnostics.Expected_a_class_set_oprand);
11442
+ break;
11443
+ }
11444
+ scanClassSetOprand();
11445
+ expressionMayContainStrings && (expressionMayContainStrings = mayContainStrings);
11446
+ }
11447
+ mayContainStrings = expressionMayContainStrings;
11448
+ }
11449
+ function scanClassSetOprand() {
11450
+ mayContainStrings = false;
11451
+ switch (text2.charCodeAt(pos)) {
11452
+ case 91 /* openBracket */:
11453
+ pos++;
11454
+ scanClassSetExpression();
11455
+ scanExpectedChar(93 /* closeBracket */);
11456
+ return "";
11457
+ case 92 /* backslash */:
11458
+ pos++;
11459
+ if (scanCharacterClassEscape()) {
11460
+ return "";
11461
+ } else if (text2.charCodeAt(pos) === 113 /* q */) {
11462
+ pos++;
11463
+ if (text2.charCodeAt(pos) === 123 /* openBrace */) {
11464
+ pos++;
11465
+ scanClassStringDisjunctionContents();
11466
+ scanExpectedChar(125 /* closeBrace */);
11467
+ return "";
11468
+ } else {
11469
+ error2(Diagnostics.q_must_be_followed_by_string_alternatives_enclosed_in_braces, pos - 2, 2);
11470
+ return "q";
11471
+ }
11472
+ }
11473
+ pos--;
11474
+ default:
11475
+ return scanClassSetCharacter();
11476
+ }
11477
+ }
11478
+ function scanClassStringDisjunctionContents() {
11479
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 123 /* openBrace */);
11480
+ let characterCount = 0;
11481
+ while (pos < end2) {
11482
+ const ch = text2.charCodeAt(pos);
11483
+ switch (ch) {
11484
+ case 125 /* closeBrace */:
11485
+ if (characterCount !== 1) {
11486
+ mayContainStrings = true;
11487
+ }
11488
+ return;
11489
+ case 124 /* bar */:
11490
+ if (characterCount !== 1) {
11491
+ mayContainStrings = true;
11492
+ }
11493
+ pos++;
11494
+ start = pos;
11495
+ characterCount = 0;
11496
+ break;
11497
+ default:
11498
+ scanClassSetCharacter();
11499
+ characterCount++;
11500
+ break;
11501
+ }
11502
+ }
11503
+ }
11504
+ function scanClassSetCharacter() {
11505
+ const ch = text2.charCodeAt(pos);
11506
+ if (ch === 92 /* backslash */) {
11507
+ pos++;
11508
+ const ch2 = text2.charCodeAt(pos);
11509
+ switch (ch2) {
11510
+ case 98 /* b */:
11511
+ pos++;
11512
+ return "\b";
11513
+ case 38 /* ampersand */:
11514
+ case 45 /* minus */:
11515
+ case 33 /* exclamation */:
11516
+ case 35 /* hash */:
11517
+ case 37 /* percent */:
11518
+ case 44 /* comma */:
11519
+ case 58 /* colon */:
11520
+ case 59 /* semicolon */:
11521
+ case 60 /* lessThan */:
11522
+ case 61 /* equals */:
11523
+ case 62 /* greaterThan */:
11524
+ case 64 /* at */:
11525
+ case 96 /* backtick */:
11526
+ case 126 /* tilde */:
11527
+ pos++;
11528
+ return String.fromCharCode(ch2);
11529
+ default:
11530
+ return scanCharacterEscape();
11531
+ }
11532
+ } else if (ch === text2.charCodeAt(pos + 1)) {
11533
+ switch (ch) {
11534
+ case 38 /* ampersand */:
11535
+ case 33 /* exclamation */:
11536
+ case 35 /* hash */:
11537
+ case 37 /* percent */:
11538
+ case 42 /* asterisk */:
11539
+ case 43 /* plus */:
11540
+ case 44 /* comma */:
11541
+ case 46 /* dot */:
11542
+ case 58 /* colon */:
11543
+ case 59 /* semicolon */:
11544
+ case 60 /* lessThan */:
11545
+ case 61 /* equals */:
11546
+ case 62 /* greaterThan */:
11547
+ case 63 /* question */:
11548
+ case 64 /* at */:
11549
+ case 96 /* backtick */:
11550
+ case 126 /* tilde */:
11551
+ error2(Diagnostics.A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backslash, pos, 2);
11552
+ pos += 2;
11553
+ return text2.substring(pos - 2, pos);
11554
+ }
11555
+ }
11556
+ switch (ch) {
11557
+ case 47 /* slash */:
11558
+ case 40 /* openParen */:
11559
+ case 41 /* closeParen */:
11560
+ case 91 /* openBracket */:
11561
+ case 93 /* closeBracket */:
11562
+ case 123 /* openBrace */:
11563
+ case 125 /* closeBrace */:
11564
+ case 45 /* minus */:
11565
+ case 124 /* bar */:
11566
+ error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
11567
+ pos++;
11568
+ return String.fromCharCode(ch);
11569
+ }
11570
+ return scanSourceCharacter();
11571
+ }
11572
+ function scanClassAtom() {
11573
+ if (text2.charCodeAt(pos) === 92 /* backslash */) {
11574
+ pos++;
11575
+ const ch = text2.charCodeAt(pos);
11576
+ switch (ch) {
11577
+ case 98 /* b */:
11578
+ pos++;
11579
+ return "\b";
11580
+ case 45 /* minus */:
11581
+ pos++;
11582
+ return String.fromCharCode(ch);
11583
+ default:
11584
+ if (scanCharacterClassEscape()) {
11585
+ return "";
11586
+ }
11587
+ return scanCharacterEscape();
11588
+ }
11589
+ } else {
11590
+ return scanSourceCharacter();
11591
+ }
11592
+ }
11593
+ function scanCharacterClassEscape() {
11594
+ Debug.assertEqual(text2.charCodeAt(pos - 1), 92 /* backslash */);
11595
+ let isCharacterComplement = false;
11596
+ const start2 = pos - 1;
11597
+ const ch = text2.charCodeAt(pos);
11598
+ switch (ch) {
11599
+ case 100 /* d */:
11600
+ case 68 /* D */:
11601
+ case 115 /* s */:
11602
+ case 83 /* S */:
11603
+ case 119 /* w */:
11604
+ case 87 /* W */:
11605
+ pos++;
11606
+ return true;
11607
+ case 80 /* P */:
11608
+ isCharacterComplement = true;
11609
+ case 112 /* p */:
11610
+ pos++;
11611
+ if (text2.charCodeAt(pos) === 123 /* openBrace */) {
11612
+ pos++;
11613
+ const propertyNameOrValueStart = pos;
11614
+ const propertyNameOrValue = scanWordCharacters();
11615
+ if (text2.charCodeAt(pos) === 61 /* equals */) {
11616
+ const propertyName = nonBinaryUnicodeProperties.get(propertyNameOrValue);
11617
+ if (pos === propertyNameOrValueStart) {
11618
+ error2(Diagnostics.Expected_a_Unicode_property_name);
11619
+ } else if (propertyName === void 0) {
11620
+ error2(Diagnostics.Unknown_Unicode_property_name, propertyNameOrValueStart, pos - propertyNameOrValueStart);
11621
+ const suggestion = getSpellingSuggestion(propertyNameOrValue, nonBinaryUnicodeProperties.keys(), identity);
11622
+ if (suggestion) {
11623
+ error2(Diagnostics.Did_you_mean_0, propertyNameOrValueStart, pos - propertyNameOrValueStart, suggestion);
11624
+ }
11625
+ }
11626
+ pos++;
11627
+ const propertyValueStart = pos;
11628
+ const propertyValue = scanWordCharacters();
11629
+ if (pos === propertyValueStart) {
11630
+ error2(Diagnostics.Expected_a_Unicode_property_value);
11631
+ } else if (propertyName !== void 0 && !valuesOfNonBinaryUnicodeProperties[propertyName].has(propertyValue)) {
11632
+ error2(Diagnostics.Unknown_Unicode_property_value, propertyValueStart, pos - propertyValueStart);
11633
+ const suggestion = getSpellingSuggestion(propertyValue, valuesOfNonBinaryUnicodeProperties[propertyName], identity);
11634
+ if (suggestion) {
11635
+ error2(Diagnostics.Did_you_mean_0, propertyValueStart, pos - propertyValueStart, suggestion);
11636
+ }
11637
+ }
11638
+ } else {
11639
+ if (pos === propertyNameOrValueStart) {
11640
+ error2(Diagnostics.Expected_a_Unicode_property_name_or_value);
11641
+ } else if (binaryUnicodePropertiesOfStrings.has(propertyNameOrValue)) {
11642
+ if (!unicodeSetsMode) {
11643
+ 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);
11644
+ } else if (isCharacterComplement) {
11645
+ error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, propertyNameOrValueStart, pos - propertyNameOrValueStart);
11646
+ } else {
11647
+ mayContainStrings = true;
11648
+ }
11649
+ } else if (!valuesOfNonBinaryUnicodeProperties.General_Category.has(propertyNameOrValue) && !binaryUnicodeProperties.has(propertyNameOrValue)) {
11650
+ error2(Diagnostics.Unknown_Unicode_property_name_or_value, propertyNameOrValueStart, pos - propertyNameOrValueStart);
11651
+ const suggestion = getSpellingSuggestion(propertyNameOrValue, [...valuesOfNonBinaryUnicodeProperties.General_Category, ...binaryUnicodeProperties, ...binaryUnicodePropertiesOfStrings], identity);
11652
+ if (suggestion) {
11653
+ error2(Diagnostics.Did_you_mean_0, propertyNameOrValueStart, pos - propertyNameOrValueStart, suggestion);
11654
+ }
11655
+ }
11656
+ }
11657
+ scanExpectedChar(125 /* closeBrace */);
11658
+ if (!unicodeMode) {
11659
+ 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);
11660
+ }
11661
+ } else if (unicodeMode) {
11662
+ error2(Diagnostics._0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces, pos - 2, 2, String.fromCharCode(ch));
11663
+ }
11664
+ return true;
11665
+ }
11666
+ return false;
11667
+ }
11668
+ function scanWordCharacters() {
11669
+ let value = "";
11670
+ while (pos < end2) {
11671
+ const ch = text2.charCodeAt(pos);
11672
+ if (!isWordCharacter(ch)) {
11673
+ break;
11674
+ }
11675
+ value += String.fromCharCode(ch);
11676
+ pos++;
11677
+ }
11678
+ return value;
11679
+ }
11680
+ function scanSourceCharacter() {
11681
+ const size = unicodeMode ? charSize(codePointAt(text2, pos)) : 1;
11682
+ pos += size;
11683
+ return text2.substring(pos - size, pos);
11684
+ }
11685
+ function scanExpectedChar(ch) {
11686
+ if (text2.charCodeAt(pos) === ch) {
11687
+ pos++;
11688
+ } else {
11689
+ error2(Diagnostics._0_expected, pos, 0, String.fromCharCode(ch));
11690
+ }
11691
+ }
11692
+ scanDisjunction(
11693
+ /*isInGroup*/
11694
+ false
11695
+ );
11696
+ forEach(groupNameReferences, (reference) => {
11697
+ if (!groupSpecifiers.has(reference.name)) {
11698
+ error2(Diagnostics.There_is_no_capturing_group_named_0_in_this_regular_expression, reference.pos, reference.end - reference.pos, reference.name);
11699
+ }
11700
+ });
11701
+ forEach(decimalEscapes, (escape) => {
11702
+ if (escape.value > numberOfCapturingGroups) {
11703
+ if (numberOfCapturingGroups) {
11704
+ 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);
11705
+ } else {
11706
+ error2(Diagnostics.Decimal_escapes_are_invalid_when_there_are_no_capturing_groups_in_a_regular_expression, escape.pos, escape.end - escape.pos);
11707
+ }
11708
+ }
11709
+ });
11710
+ }
10823
11711
  }
10824
11712
  function appendIfCommentDirective(commentDirectives2, text2, commentDirectiveRegEx, lineStart) {
10825
11713
  const type = getDirectiveFromComment(text2.trimStart(), commentDirectiveRegEx);
@@ -11042,8 +11930,6 @@ ${lanes.join("\n")}
11042
11930
  pos--;
11043
11931
  const extendedCookedChar = peekExtendedUnicodeEscape();
11044
11932
  if (extendedCookedChar >= 0 && isIdentifierStart(extendedCookedChar, languageVersion)) {
11045
- pos += 3;
11046
- tokenFlags |= 8 /* ExtendedUnicodeEscape */;
11047
11933
  tokenValue = scanExtendedUnicodeEscape() + scanIdentifierParts();
11048
11934
  return token = getIdentifierToken();
11049
11935
  }
@@ -11183,7 +12069,7 @@ ${lanes.join("\n")}
11183
12069
  function utf16EncodeAsString(codePoint) {
11184
12070
  return utf16EncodeAsStringWorker(codePoint);
11185
12071
  }
11186
- var textToKeywordObj, textToKeyword, textToToken, unicodeES3IdentifierStart, unicodeES3IdentifierPart, unicodeES5IdentifierStart, unicodeES5IdentifierPart, unicodeESNextIdentifierStart, unicodeESNextIdentifierPart, commentDirectiveRegExSingleLine, commentDirectiveRegExMultiLine, jsDocSeeOrLink, tokenStrings, mergeConflictMarkerLength, shebangTriviaRegex, utf16EncodeAsStringWorker;
12072
+ var textToKeywordObj, textToKeyword, textToToken, charToRegExpFlag, regExpFlagToFirstAvailableLanguageVersion, unicodeES3IdentifierStart, unicodeES3IdentifierPart, unicodeES5IdentifierStart, unicodeES5IdentifierPart, unicodeESNextIdentifierStart, unicodeESNextIdentifierPart, commentDirectiveRegExSingleLine, commentDirectiveRegExMultiLine, jsDocSeeOrLink, tokenStrings, regExpFlagChars, mergeConflictMarkerLength, shebangTriviaRegex, utf16EncodeAsStringWorker, nonBinaryUnicodeProperties, binaryUnicodeProperties, binaryUnicodePropertiesOfStrings, valuesOfNonBinaryUnicodeProperties;
11187
12073
  var init_scanner = __esm({
11188
12074
  "src/compiler/scanner.ts"() {
11189
12075
  "use strict";
@@ -11338,6 +12224,26 @@ ${lanes.join("\n")}
11338
12224
  "#": 63 /* HashToken */,
11339
12225
  "`": 62 /* BacktickToken */
11340
12226
  }));
12227
+ charToRegExpFlag = new Map(Object.entries({
12228
+ d: 1 /* HasIndices */,
12229
+ g: 2 /* Global */,
12230
+ i: 4 /* IgnoreCase */,
12231
+ m: 8 /* Multiline */,
12232
+ s: 16 /* DotAll */,
12233
+ u: 32 /* Unicode */,
12234
+ v: 64 /* UnicodeSets */,
12235
+ y: 128 /* Sticky */
12236
+ }));
12237
+ regExpFlagToFirstAvailableLanguageVersion = /* @__PURE__ */ new Map([
12238
+ [1 /* HasIndices */, 9 /* ES2022 */],
12239
+ [2 /* Global */, 0 /* ES3 */],
12240
+ [4 /* IgnoreCase */, 0 /* ES3 */],
12241
+ [8 /* Multiline */, 0 /* ES3 */],
12242
+ [16 /* DotAll */, 5 /* ES2018 */],
12243
+ [32 /* Unicode */, 2 /* ES2015 */],
12244
+ [64 /* UnicodeSets */, 11 /* ES2024 */],
12245
+ [128 /* Sticky */, 2 /* ES2015 */]
12246
+ ]);
11341
12247
  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];
11342
12248
  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];
11343
12249
  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];
@@ -11348,9 +12254,26 @@ ${lanes.join("\n")}
11348
12254
  commentDirectiveRegExMultiLine = /^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/;
11349
12255
  jsDocSeeOrLink = /@(?:see|link)/i;
11350
12256
  tokenStrings = makeReverseMap(textToToken);
12257
+ regExpFlagChars = makeReverseMap(charToRegExpFlag);
11351
12258
  mergeConflictMarkerLength = "<<<<<<<".length;
11352
12259
  shebangTriviaRegex = /^#!.*/;
11353
12260
  utf16EncodeAsStringWorker = String.fromCodePoint ? (codePoint) => String.fromCodePoint(codePoint) : utf16EncodeAsStringFallback;
12261
+ nonBinaryUnicodeProperties = new Map(Object.entries({
12262
+ General_Category: "General_Category",
12263
+ gc: "General_Category",
12264
+ Script: "Script",
12265
+ sc: "Script",
12266
+ Script_Extensions: "Script_Extensions",
12267
+ scx: "Script_Extensions"
12268
+ }));
12269
+ 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"]);
12270
+ 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"]);
12271
+ valuesOfNonBinaryUnicodeProperties = {
12272
+ 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"]),
12273
+ 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"]),
12274
+ Script_Extensions: /* @__PURE__ */ new Set()
12275
+ // Currently empty
12276
+ };
11354
12277
  }
11355
12278
  });
11356
12279
 
@@ -29498,7 +30421,10 @@ ${lanes.join("\n")}
29498
30421
  function parseErrorAtPosition(start, length2, message, ...args) {
29499
30422
  const lastError = lastOrUndefined(parseDiagnostics);
29500
30423
  let result;
29501
- if (!lastError || start !== lastError.start) {
30424
+ if (message.category === 3 /* Message */ && lastError && start === lastError.start && length2 === lastError.length) {
30425
+ result = createDetachedDiagnostic(fileName, sourceText, start, length2, message, ...args);
30426
+ addRelatedInfo(lastError, result);
30427
+ } else if (!lastError || start !== lastError.start) {
29502
30428
  result = createDetachedDiagnostic(fileName, sourceText, start, length2, message, ...args);
29503
30429
  parseDiagnostics.push(result);
29504
30430
  }
@@ -29654,7 +30580,7 @@ ${lanes.join("\n")}
29654
30580
  parseErrorForInvalidName(Diagnostics.Type_alias_name_cannot_be_0, Diagnostics.Type_alias_must_be_given_a_name, 64 /* EqualsToken */);
29655
30581
  return;
29656
30582
  }
29657
- const suggestion = getSpellingSuggestion(expressionText, viableKeywordSuggestions, (n) => n) ?? getSpaceSuggestion(expressionText);
30583
+ const suggestion = getSpellingSuggestion(expressionText, viableKeywordSuggestions, identity) ?? getSpaceSuggestion(expressionText);
29658
30584
  if (suggestion) {
29659
30585
  parseErrorAt(pos, node.end, Diagnostics.Unknown_keyword_or_identifier_Did_you_mean_0, suggestion);
29660
30586
  return;
@@ -70582,17 +71508,6 @@ ${lanes.join("\n")}
70582
71508
  isTypeAssignableTo
70583
71509
  );
70584
71510
  }
70585
- function filterContextualTypeForLiteralExpressionOfObject(node, contextualType) {
70586
- if (!isLiteralExpressionOfObject(node)) {
70587
- return contextualType;
70588
- }
70589
- return filterType(contextualType, (t) => {
70590
- if (!t.symbol || !(t.symbol.flags & 32 /* Class */)) {
70591
- return true;
70592
- }
70593
- return every(getPropertiesOfType(t), (p) => !p.valueDeclaration || !isNamedDeclaration(p.valueDeclaration) || !isPrivateIdentifier(p.valueDeclaration.name) && !(getDeclarationModifierFlagsFromSymbol(p) & 6 /* NonPublicAccessibilityModifier */));
70594
- });
70595
- }
70596
71511
  function getApparentTypeOfContextualType(node, contextFlags) {
70597
71512
  const contextualType = isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node, contextFlags) : getContextualType2(node, contextFlags);
70598
71513
  const instantiatedType = instantiateContextualType(contextualType, node, contextFlags);
@@ -70636,6 +71551,7 @@ ${lanes.join("\n")}
70636
71551
  return type;
70637
71552
  }
70638
71553
  function getContextualType2(node, contextFlags) {
71554
+ var _a;
70639
71555
  if (node.flags & 67108864 /* InWithStatement */) {
70640
71556
  return void 0;
70641
71557
  }
@@ -70647,14 +71563,6 @@ ${lanes.join("\n")}
70647
71563
  if (index >= 0) {
70648
71564
  return contextualTypes[index];
70649
71565
  }
70650
- const contextualType = getContextualTypeWorker(node, contextFlags);
70651
- if (!contextualType) {
70652
- return void 0;
70653
- }
70654
- return filterContextualTypeForLiteralExpressionOfObject(node, contextualType);
70655
- }
70656
- function getContextualTypeWorker(node, contextFlags) {
70657
- var _a;
70658
71566
  const { parent: parent2 } = node;
70659
71567
  switch (parent2.kind) {
70660
71568
  case 260 /* VariableDeclaration */:
@@ -77435,11 +78343,10 @@ ${lanes.join("\n")}
77435
78343
  return node;
77436
78344
  }
77437
78345
  function checkExpressionWithContextualType(node, contextualType, inferenceContext, checkMode) {
77438
- const filteredContextualType = filterContextualTypeForLiteralExpressionOfObject(node, contextualType);
77439
78346
  const contextNode = getContextNode2(node);
77440
78347
  pushContextualType(
77441
78348
  contextNode,
77442
- filteredContextualType,
78349
+ contextualType,
77443
78350
  /*isCache*/
77444
78351
  false
77445
78352
  );
@@ -77449,7 +78356,7 @@ ${lanes.join("\n")}
77449
78356
  inferenceContext.intraExpressionInferenceSites = void 0;
77450
78357
  }
77451
78358
  const result = maybeTypeOfKind(type, 2944 /* Literal */) && isLiteralOfContextualType(type, instantiateContextualType(
77452
- filteredContextualType,
78359
+ contextualType,
77453
78360
  node,
77454
78361
  /*contextFlags*/
77455
78362
  void 0
@@ -160026,7 +160933,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
160026
160933
  return checker.getAllPossiblePropertiesOfTypes(filter(type.types, (memberType) => !(memberType.flags & 402784252 /* Primitive */ || checker.isArrayLikeType(memberType) || checker.isTypeInvalidDueToUnionDiscriminant(memberType, node) || checker.typeHasCallOrConstructSignatures(memberType) || memberType.isClass() && containsNonPublicProperties(memberType.getApparentProperties()))));
160027
160934
  }
160028
160935
  function containsNonPublicProperties(props) {
160029
- return some(props, (p) => !!(getDeclarationModifierFlagsFromSymbol(p) & 6 /* NonPublicAccessibilityModifier */) || !!p.valueDeclaration && isNamedDeclaration(p.valueDeclaration) && isPrivateIdentifier(p.valueDeclaration.name));
160936
+ return some(props, (p) => !!(getDeclarationModifierFlagsFromSymbol(p) & 6 /* NonPublicAccessibilityModifier */));
160030
160937
  }
160031
160938
  function getPropertiesForCompletion(type, checker) {
160032
160939
  return type.isUnion() ? Debug.checkEachDefined(checker.getAllPossiblePropertiesOfTypes(type.types), "getAllPossiblePropertiesOfTypes() should all be defined") : Debug.checkEachDefined(type.getApparentProperties(), "getApparentProperties() should all be defined");
@@ -161292,7 +162199,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
161292
162199
  ["script" /* scriptElement */]: 1,
161293
162200
  ["external module name" /* externalModuleName */]: 2
161294
162201
  };
161295
- tripleSlashDirectiveFragmentRegex = /^(\/\/\/\s*<reference\s+(path|types)\s*=\s*(?:'|"))([^\3"]*)$/;
162202
+ tripleSlashDirectiveFragmentRegex = /^(\/\/\/\s*<reference\s+(path|types)\s*=\s*(?:'|"))([^\x03"]*)$/;
161296
162203
  nodeModulesDependencyKeys = ["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"];
161297
162204
  }
161298
162205
  });
@@ -184114,6 +185021,7 @@ ${e.message}`;
184114
185021
  ProcessLevel: () => ProcessLevel,
184115
185022
  ProgramUpdateLevel: () => ProgramUpdateLevel,
184116
185023
  QuotePreference: () => QuotePreference,
185024
+ RegularExpressionFlags: () => RegularExpressionFlags,
184117
185025
  RelationComparisonResult: () => RelationComparisonResult,
184118
185026
  Rename: () => ts_Rename_exports,
184119
185027
  ScriptElementKind: () => ScriptElementKind,
@@ -184239,6 +185147,7 @@ ${e.message}`;
184239
185147
  changeExtension: () => changeExtension,
184240
185148
  changesAffectModuleResolution: () => changesAffectModuleResolution,
184241
185149
  changesAffectingProgramStructure: () => changesAffectingProgramStructure,
185150
+ characterToRegularExpressionFlag: () => characterToRegularExpressionFlag,
184242
185151
  childIsDecorated: () => childIsDecorated,
184243
185152
  classElementOrClassElementParameterIsDecorated: () => classElementOrClassElementParameterIsDecorated,
184244
185153
  classHasClassThisAssignment: () => classHasClassThisAssignment,
@@ -186004,6 +186913,7 @@ ${e.message}`;
186004
186913
  reducePathComponents: () => reducePathComponents,
186005
186914
  refactor: () => ts_refactor_exports,
186006
186915
  regExpEscape: () => regExpEscape,
186916
+ regularExpressionFlagToCharacter: () => regularExpressionFlagToCharacter,
186007
186917
  relativeComplement: () => relativeComplement,
186008
186918
  removeAllComments: () => removeAllComments,
186009
186919
  removeEmitHelper: () => removeEmitHelper,
@@ -186524,6 +187434,7 @@ ${e.message}`;
186524
187434
  ProcessLevel: () => ProcessLevel,
186525
187435
  ProgramUpdateLevel: () => ProgramUpdateLevel,
186526
187436
  QuotePreference: () => QuotePreference,
187437
+ RegularExpressionFlags: () => RegularExpressionFlags,
186527
187438
  RelationComparisonResult: () => RelationComparisonResult,
186528
187439
  Rename: () => ts_Rename_exports,
186529
187440
  ScriptElementKind: () => ScriptElementKind,
@@ -186649,6 +187560,7 @@ ${e.message}`;
186649
187560
  changeExtension: () => changeExtension,
186650
187561
  changesAffectModuleResolution: () => changesAffectModuleResolution,
186651
187562
  changesAffectingProgramStructure: () => changesAffectingProgramStructure,
187563
+ characterToRegularExpressionFlag: () => characterToRegularExpressionFlag,
186652
187564
  childIsDecorated: () => childIsDecorated,
186653
187565
  classElementOrClassElementParameterIsDecorated: () => classElementOrClassElementParameterIsDecorated,
186654
187566
  classHasClassThisAssignment: () => classHasClassThisAssignment,
@@ -188414,6 +189326,7 @@ ${e.message}`;
188414
189326
  reducePathComponents: () => reducePathComponents,
188415
189327
  refactor: () => ts_refactor_exports,
188416
189328
  regExpEscape: () => regExpEscape,
189329
+ regularExpressionFlagToCharacter: () => regularExpressionFlagToCharacter,
188417
189330
  relativeComplement: () => relativeComplement,
188418
189331
  removeAllComments: () => removeAllComments,
188419
189332
  removeEmitHelper: () => removeEmitHelper,