immosquare-cleaner 0.1.40 → 0.1.41
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/immosquare-cleaner/version.rb +1 -1
- data/node_modules/@eslint/config-array/README.md +9 -3
- data/node_modules/@eslint/config-array/dist/cjs/index.cjs +1 -0
- data/node_modules/@eslint/config-array/dist/esm/index.js +1 -0
- data/node_modules/@eslint/config-array/package.json +2 -2
- data/node_modules/@eslint/eslintrc/node_modules/espree/LICENSE +25 -0
- data/node_modules/@eslint/eslintrc/node_modules/espree/README.md +244 -0
- data/node_modules/@eslint/eslintrc/node_modules/espree/dist/espree.cjs +883 -0
- data/node_modules/@eslint/eslintrc/node_modules/espree/espree.js +177 -0
- data/node_modules/@eslint/eslintrc/node_modules/espree/lib/espree.js +349 -0
- data/node_modules/@eslint/eslintrc/node_modules/espree/lib/features.js +27 -0
- data/node_modules/@eslint/eslintrc/node_modules/espree/lib/options.js +123 -0
- data/node_modules/@eslint/eslintrc/node_modules/espree/lib/token-translator.js +263 -0
- data/node_modules/@eslint/eslintrc/node_modules/espree/lib/version.js +3 -0
- data/node_modules/@eslint/eslintrc/node_modules/espree/node_modules/acorn/CHANGELOG.md +880 -0
- data/node_modules/@eslint/eslintrc/node_modules/espree/node_modules/acorn/LICENSE +21 -0
- data/node_modules/@eslint/eslintrc/node_modules/espree/node_modules/acorn/README.md +283 -0
- data/node_modules/@eslint/eslintrc/node_modules/espree/node_modules/acorn/bin/acorn +4 -0
- data/node_modules/@eslint/eslintrc/node_modules/espree/node_modules/acorn/dist/acorn.d.mts +857 -0
- data/node_modules/@eslint/eslintrc/node_modules/espree/node_modules/acorn/dist/acorn.d.ts +857 -0
- data/node_modules/@eslint/eslintrc/node_modules/espree/node_modules/acorn/dist/acorn.js +6002 -0
- data/node_modules/@eslint/eslintrc/node_modules/espree/node_modules/acorn/dist/acorn.mjs +5973 -0
- data/node_modules/@eslint/eslintrc/node_modules/espree/node_modules/acorn/dist/bin.js +90 -0
- data/node_modules/@eslint/eslintrc/node_modules/espree/node_modules/acorn/package.json +50 -0
- data/node_modules/@eslint/eslintrc/node_modules/espree/package.json +86 -0
- data/node_modules/@eslint/js/package.json +1 -1
- data/node_modules/@eslint-community/regexpp/index.d.ts +19 -5
- data/node_modules/@eslint-community/regexpp/index.js +138 -17
- data/node_modules/@eslint-community/regexpp/index.js.map +1 -1
- data/node_modules/@eslint-community/regexpp/index.mjs +138 -17
- data/node_modules/@eslint-community/regexpp/index.mjs.map +1 -1
- data/node_modules/@eslint-community/regexpp/package.json +1 -3
- data/node_modules/acorn/CHANGELOG.md +24 -0
- data/node_modules/acorn/README.md +5 -6
- data/node_modules/acorn/dist/acorn.d.mts +8 -9
- data/node_modules/acorn/dist/acorn.d.ts +8 -9
- data/node_modules/acorn/dist/acorn.js +92 -29
- data/node_modules/acorn/dist/acorn.mjs +92 -29
- data/node_modules/acorn/package.json +3 -3
- data/node_modules/eslint/README.md +7 -8
- data/node_modules/eslint/conf/ecma-version.js +1 -1
- data/node_modules/eslint/conf/globals.js +6 -1
- data/node_modules/eslint/lib/cli.js +23 -2
- data/node_modules/eslint/lib/eslint/eslint-helpers.js +5 -0
- data/node_modules/eslint/lib/eslint/eslint.js +16 -2
- data/node_modules/eslint/lib/eslint/legacy-eslint.js +14 -0
- data/node_modules/eslint/lib/languages/js/index.js +10 -5
- data/node_modules/eslint/lib/languages/js/source-code/source-code.js +16 -6
- data/node_modules/eslint/lib/linter/apply-disable-directives.js +6 -3
- data/node_modules/eslint/lib/linter/config-comment-parser.js +3 -16
- data/node_modules/eslint/lib/linter/linter.js +194 -149
- data/node_modules/eslint/lib/linter/node-event-generator.js +2 -4
- data/node_modules/eslint/lib/linter/vfile.js +7 -0
- data/node_modules/eslint/lib/options.js +13 -1
- data/node_modules/eslint/lib/rules/no-restricted-imports.js +12 -5
- data/node_modules/eslint/lib/rules/no-unused-vars.js +34 -32
- data/node_modules/eslint/lib/rules/no-useless-backreference.js +81 -31
- data/node_modules/eslint/lib/rules/utils/regular-expressions.js +1 -1
- data/node_modules/eslint/lib/shared/flags.js +26 -0
- data/node_modules/eslint/lib/shared/logging.js +10 -1
- data/node_modules/eslint/lib/shared/types.js +1 -1
- data/node_modules/eslint/package.json +9 -13
- data/node_modules/eslint-scope/dist/eslint-scope.cjs +2 -2
- data/node_modules/eslint-scope/lib/referencer.js +1 -1
- data/node_modules/eslint-scope/lib/version.js +1 -1
- data/node_modules/eslint-scope/package.json +2 -2
- data/node_modules/espree/README.md +5 -5
- data/node_modules/espree/dist/espree.cjs +62 -6
- data/node_modules/espree/espree.js +1 -4
- data/node_modules/espree/lib/options.js +3 -2
- data/node_modules/espree/lib/token-translator.js +1 -1
- data/node_modules/espree/lib/version.js +1 -1
- data/node_modules/espree/package.json +7 -7
- data/node_modules/js-tokens/CHANGELOG.md +17 -0
- data/node_modules/js-tokens/LICENSE +1 -1
- data/node_modules/js-tokens/README.md +25 -7
- data/node_modules/js-tokens/index.js +3 -3
- data/node_modules/js-tokens/package.json +5 -5
- data/node_modules/jscodeshift/CHANGELOG.md +5 -0
- data/node_modules/jscodeshift/bin/jscodeshift.js +1 -1
- data/node_modules/jscodeshift/package.json +1 -2
- data/node_modules/jscodeshift/website/index.htm +9 -0
- data/node_modules/prettier/LICENSE +35 -34
- data/node_modules/prettier/doc.js +2 -2
- data/node_modules/prettier/doc.mjs +2 -2
- data/node_modules/prettier/index.cjs +8 -8
- data/node_modules/prettier/index.d.ts +1 -2
- data/node_modules/prettier/index.mjs +636 -704
- data/node_modules/prettier/internal/cli.mjs +4 -4
- data/node_modules/prettier/package.json +1 -1
- data/node_modules/prettier/plugins/acorn.js +14 -12
- data/node_modules/prettier/plugins/acorn.mjs +14 -12
- data/node_modules/prettier/plugins/angular.js +1 -1
- data/node_modules/prettier/plugins/angular.mjs +1 -1
- data/node_modules/prettier/plugins/babel.js +10 -11
- data/node_modules/prettier/plugins/babel.mjs +10 -11
- data/node_modules/prettier/plugins/estree.js +27 -27
- data/node_modules/prettier/plugins/estree.mjs +27 -27
- data/node_modules/prettier/plugins/flow.js +15 -16
- data/node_modules/prettier/plugins/flow.mjs +15 -16
- data/node_modules/prettier/plugins/glimmer.js +5 -5
- data/node_modules/prettier/plugins/glimmer.mjs +5 -5
- data/node_modules/prettier/plugins/graphql.js +8 -8
- data/node_modules/prettier/plugins/graphql.mjs +8 -8
- data/node_modules/prettier/plugins/html.js +17 -17
- data/node_modules/prettier/plugins/html.mjs +17 -17
- data/node_modules/prettier/plugins/markdown.js +44 -44
- data/node_modules/prettier/plugins/markdown.mjs +44 -44
- data/node_modules/prettier/plugins/meriyah.js +4 -5
- data/node_modules/prettier/plugins/meriyah.mjs +4 -5
- data/node_modules/prettier/plugins/postcss.js +26 -26
- data/node_modules/prettier/plugins/postcss.mjs +26 -26
- data/node_modules/prettier/plugins/typescript.js +15 -20
- data/node_modules/prettier/plugins/typescript.mjs +15 -20
- data/node_modules/prettier/plugins/yaml.js +6 -6
- data/node_modules/prettier/plugins/yaml.mjs +6 -6
- data/node_modules/prettier/standalone.js +31 -30
- data/node_modules/prettier/standalone.mjs +28 -27
- data/package.json +4 -4
- metadata +24 -2
@@ -2,7 +2,7 @@ var ast = /*#__PURE__*/Object.freeze({
|
|
2
2
|
__proto__: null
|
3
3
|
});
|
4
4
|
|
5
|
-
const latestEcmaVersion =
|
5
|
+
const latestEcmaVersion = 2025;
|
6
6
|
|
7
7
|
let largeIdStartRanges = undefined;
|
8
8
|
let largeIdContinueRanges = undefined;
|
@@ -70,7 +70,7 @@ function restoreRanges(data) {
|
|
70
70
|
}
|
71
71
|
|
72
72
|
class DataSet {
|
73
|
-
constructor(raw2018, raw2019, raw2020, raw2021, raw2022, raw2023, raw2024) {
|
73
|
+
constructor(raw2018, raw2019, raw2020, raw2021, raw2022, raw2023, raw2024, raw2025) {
|
74
74
|
this._raw2018 = raw2018;
|
75
75
|
this._raw2019 = raw2019;
|
76
76
|
this._raw2020 = raw2020;
|
@@ -78,6 +78,7 @@ class DataSet {
|
|
78
78
|
this._raw2022 = raw2022;
|
79
79
|
this._raw2023 = raw2023;
|
80
80
|
this._raw2024 = raw2024;
|
81
|
+
this._raw2025 = raw2025;
|
81
82
|
}
|
82
83
|
get es2018() {
|
83
84
|
var _a;
|
@@ -107,13 +108,17 @@ class DataSet {
|
|
107
108
|
var _a;
|
108
109
|
return ((_a = this._set2024) !== null && _a !== void 0 ? _a : (this._set2024 = new Set(this._raw2024.split(" "))));
|
109
110
|
}
|
111
|
+
get es2025() {
|
112
|
+
var _a;
|
113
|
+
return ((_a = this._set2025) !== null && _a !== void 0 ? _a : (this._set2025 = new Set(this._raw2025.split(" "))));
|
114
|
+
}
|
110
115
|
}
|
111
116
|
const gcNameSet = new Set(["General_Category", "gc"]);
|
112
117
|
const scNameSet = new Set(["Script", "Script_Extensions", "sc", "scx"]);
|
113
|
-
const gcValueSets = new DataSet("C Cased_Letter Cc Cf Close_Punctuation Cn Co Combining_Mark Connector_Punctuation Control Cs Currency_Symbol Dash_Punctuation Decimal_Number Enclosing_Mark Final_Punctuation Format Initial_Punctuation L LC Letter Letter_Number Line_Separator Ll Lm Lo Lowercase_Letter Lt Lu M Mark Math_Symbol Mc Me Mn Modifier_Letter Modifier_Symbol N Nd Nl No Nonspacing_Mark Number Open_Punctuation Other Other_Letter Other_Number Other_Punctuation Other_Symbol P Paragraph_Separator Pc Pd Pe Pf Pi Po Private_Use Ps Punctuation S Sc Separator Sk Sm So Space_Separator Spacing_Mark Surrogate Symbol Titlecase_Letter Unassigned Uppercase_Letter Z Zl Zp Zs cntrl digit punct", "", "", "", "", "", "");
|
114
|
-
const scValueSets = new DataSet("Adlam Adlm Aghb Ahom Anatolian_Hieroglyphs Arab Arabic Armenian Armi Armn Avestan Avst Bali Balinese Bamu Bamum Bass Bassa_Vah Batak Batk Beng Bengali Bhaiksuki Bhks Bopo Bopomofo Brah Brahmi Brai Braille Bugi Buginese Buhd Buhid Cakm Canadian_Aboriginal Cans Cari Carian Caucasian_Albanian Chakma Cham Cher Cherokee Common Copt Coptic Cprt Cuneiform Cypriot Cyrillic Cyrl Deseret Deva Devanagari Dsrt Dupl Duployan Egyp Egyptian_Hieroglyphs Elba Elbasan Ethi Ethiopic Geor Georgian Glag Glagolitic Gonm Goth Gothic Gran Grantha Greek Grek Gujarati Gujr Gurmukhi Guru Han Hang Hangul Hani Hano Hanunoo Hatr Hatran Hebr Hebrew Hira Hiragana Hluw Hmng Hung Imperial_Aramaic Inherited Inscriptional_Pahlavi Inscriptional_Parthian Ital Java Javanese Kaithi Kali Kana Kannada Katakana Kayah_Li Khar Kharoshthi Khmer Khmr Khoj Khojki Khudawadi Knda Kthi Lana Lao Laoo Latin Latn Lepc Lepcha Limb Limbu Lina Linb Linear_A Linear_B Lisu Lyci Lycian Lydi Lydian Mahajani Mahj Malayalam Mand Mandaic Mani Manichaean Marc Marchen Masaram_Gondi Meetei_Mayek Mend Mende_Kikakui Merc Mero Meroitic_Cursive Meroitic_Hieroglyphs Miao Mlym Modi Mong Mongolian Mro Mroo Mtei Mult Multani Myanmar Mymr Nabataean Narb Nbat New_Tai_Lue Newa Nko Nkoo Nshu Nushu Ogam Ogham Ol_Chiki Olck Old_Hungarian Old_Italic Old_North_Arabian Old_Permic Old_Persian Old_South_Arabian Old_Turkic Oriya Orkh Orya Osage Osge Osma Osmanya Pahawh_Hmong Palm Palmyrene Pau_Cin_Hau Pauc Perm Phag Phags_Pa Phli Phlp Phnx Phoenician Plrd Prti Psalter_Pahlavi Qaac Qaai Rejang Rjng Runic Runr Samaritan Samr Sarb Saur Saurashtra Sgnw Sharada Shavian Shaw Shrd Sidd Siddham SignWriting Sind Sinh Sinhala Sora Sora_Sompeng Soyo Soyombo Sund Sundanese Sylo Syloti_Nagri Syrc Syriac Tagalog Tagb Tagbanwa Tai_Le Tai_Tham Tai_Viet Takr Takri Tale Talu Tamil Taml Tang Tangut Tavt Telu Telugu Tfng Tglg Thaa Thaana Thai Tibetan Tibt Tifinagh Tirh Tirhuta Ugar Ugaritic Vai Vaii Wara Warang_Citi Xpeo Xsux Yi Yiii Zanabazar_Square Zanb Zinh Zyyy", "Dogr Dogra Gong Gunjala_Gondi Hanifi_Rohingya Maka Makasar Medefaidrin Medf Old_Sogdian Rohg Sogd Sogdian Sogo", "Elym Elymaic Hmnp Nand Nandinagari Nyiakeng_Puachue_Hmong Wancho Wcho", "Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi", "Cpmn Cypro_Minoan Old_Uyghur Ougr Tangsa Tnsa Toto Vith Vithkuqi", "Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz", "");
|
115
|
-
const binPropertySets = new DataSet("AHex ASCII ASCII_Hex_Digit Alpha Alphabetic Any Assigned Bidi_C Bidi_Control Bidi_M Bidi_Mirrored CI CWCF CWCM CWKCF CWL CWT CWU Case_Ignorable Cased Changes_When_Casefolded Changes_When_Casemapped Changes_When_Lowercased Changes_When_NFKC_Casefolded Changes_When_Titlecased Changes_When_Uppercased DI Dash Default_Ignorable_Code_Point Dep Deprecated Dia Diacritic Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Ext Extender Gr_Base Gr_Ext Grapheme_Base Grapheme_Extend Hex Hex_Digit IDC IDS IDSB IDST IDS_Binary_Operator IDS_Trinary_Operator ID_Continue ID_Start Ideo Ideographic Join_C Join_Control LOE Logical_Order_Exception Lower Lowercase Math NChar Noncharacter_Code_Point Pat_Syn Pat_WS Pattern_Syntax Pattern_White_Space QMark Quotation_Mark RI Radical Regional_Indicator SD STerm Sentence_Terminal Soft_Dotted Term Terminal_Punctuation UIdeo Unified_Ideograph Upper Uppercase VS Variation_Selector White_Space XIDC XIDS XID_Continue XID_Start space", "Extended_Pictographic", "", "EBase EComp EMod EPres ExtPict", "", "", "");
|
116
|
-
const binPropertyOfStringsSets = new DataSet("", "", "", "", "", "", "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji RGI_Emoji_Flag_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence");
|
118
|
+
const gcValueSets = new DataSet("C Cased_Letter Cc Cf Close_Punctuation Cn Co Combining_Mark Connector_Punctuation Control Cs Currency_Symbol Dash_Punctuation Decimal_Number Enclosing_Mark Final_Punctuation Format Initial_Punctuation L LC Letter Letter_Number Line_Separator Ll Lm Lo Lowercase_Letter Lt Lu M Mark Math_Symbol Mc Me Mn Modifier_Letter Modifier_Symbol N Nd Nl No Nonspacing_Mark Number Open_Punctuation Other Other_Letter Other_Number Other_Punctuation Other_Symbol P Paragraph_Separator Pc Pd Pe Pf Pi Po Private_Use Ps Punctuation S Sc Separator Sk Sm So Space_Separator Spacing_Mark Surrogate Symbol Titlecase_Letter Unassigned Uppercase_Letter Z Zl Zp Zs cntrl digit punct", "", "", "", "", "", "", "");
|
119
|
+
const scValueSets = new DataSet("Adlam Adlm Aghb Ahom Anatolian_Hieroglyphs Arab Arabic Armenian Armi Armn Avestan Avst Bali Balinese Bamu Bamum Bass Bassa_Vah Batak Batk Beng Bengali Bhaiksuki Bhks Bopo Bopomofo Brah Brahmi Brai Braille Bugi Buginese Buhd Buhid Cakm Canadian_Aboriginal Cans Cari Carian Caucasian_Albanian Chakma Cham Cher Cherokee Common Copt Coptic Cprt Cuneiform Cypriot Cyrillic Cyrl Deseret Deva Devanagari Dsrt Dupl Duployan Egyp Egyptian_Hieroglyphs Elba Elbasan Ethi Ethiopic Geor Georgian Glag Glagolitic Gonm Goth Gothic Gran Grantha Greek Grek Gujarati Gujr Gurmukhi Guru Han Hang Hangul Hani Hano Hanunoo Hatr Hatran Hebr Hebrew Hira Hiragana Hluw Hmng Hung Imperial_Aramaic Inherited Inscriptional_Pahlavi Inscriptional_Parthian Ital Java Javanese Kaithi Kali Kana Kannada Katakana Kayah_Li Khar Kharoshthi Khmer Khmr Khoj Khojki Khudawadi Knda Kthi Lana Lao Laoo Latin Latn Lepc Lepcha Limb Limbu Lina Linb Linear_A Linear_B Lisu Lyci Lycian Lydi Lydian Mahajani Mahj Malayalam Mand Mandaic Mani Manichaean Marc Marchen Masaram_Gondi Meetei_Mayek Mend Mende_Kikakui Merc Mero Meroitic_Cursive Meroitic_Hieroglyphs Miao Mlym Modi Mong Mongolian Mro Mroo Mtei Mult Multani Myanmar Mymr Nabataean Narb Nbat New_Tai_Lue Newa Nko Nkoo Nshu Nushu Ogam Ogham Ol_Chiki Olck Old_Hungarian Old_Italic Old_North_Arabian Old_Permic Old_Persian Old_South_Arabian Old_Turkic Oriya Orkh Orya Osage Osge Osma Osmanya Pahawh_Hmong Palm Palmyrene Pau_Cin_Hau Pauc Perm Phag Phags_Pa Phli Phlp Phnx Phoenician Plrd Prti Psalter_Pahlavi Qaac Qaai Rejang Rjng Runic Runr Samaritan Samr Sarb Saur Saurashtra Sgnw Sharada Shavian Shaw Shrd Sidd Siddham SignWriting Sind Sinh Sinhala Sora Sora_Sompeng Soyo Soyombo Sund Sundanese Sylo Syloti_Nagri Syrc Syriac Tagalog Tagb Tagbanwa Tai_Le Tai_Tham Tai_Viet Takr Takri Tale Talu Tamil Taml Tang Tangut Tavt Telu Telugu Tfng Tglg Thaa Thaana Thai Tibetan Tibt Tifinagh Tirh Tirhuta Ugar Ugaritic Vai Vaii Wara Warang_Citi Xpeo Xsux Yi Yiii Zanabazar_Square Zanb Zinh Zyyy", "Dogr Dogra Gong Gunjala_Gondi Hanifi_Rohingya Maka Makasar Medefaidrin Medf Old_Sogdian Rohg Sogd Sogdian Sogo", "Elym Elymaic Hmnp Nand Nandinagari Nyiakeng_Puachue_Hmong Wancho Wcho", "Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi", "Cpmn Cypro_Minoan Old_Uyghur Ougr Tangsa Tnsa Toto Vith Vithkuqi", "Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz", "", "");
|
120
|
+
const binPropertySets = new DataSet("AHex ASCII ASCII_Hex_Digit Alpha Alphabetic Any Assigned Bidi_C Bidi_Control Bidi_M Bidi_Mirrored CI CWCF CWCM CWKCF CWL CWT CWU Case_Ignorable Cased Changes_When_Casefolded Changes_When_Casemapped Changes_When_Lowercased Changes_When_NFKC_Casefolded Changes_When_Titlecased Changes_When_Uppercased DI Dash Default_Ignorable_Code_Point Dep Deprecated Dia Diacritic Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Ext Extender Gr_Base Gr_Ext Grapheme_Base Grapheme_Extend Hex Hex_Digit IDC IDS IDSB IDST IDS_Binary_Operator IDS_Trinary_Operator ID_Continue ID_Start Ideo Ideographic Join_C Join_Control LOE Logical_Order_Exception Lower Lowercase Math NChar Noncharacter_Code_Point Pat_Syn Pat_WS Pattern_Syntax Pattern_White_Space QMark Quotation_Mark RI Radical Regional_Indicator SD STerm Sentence_Terminal Soft_Dotted Term Terminal_Punctuation UIdeo Unified_Ideograph Upper Uppercase VS Variation_Selector White_Space XIDC XIDS XID_Continue XID_Start space", "Extended_Pictographic", "", "EBase EComp EMod EPres ExtPict", "", "", "", "");
|
121
|
+
const binPropertyOfStringsSets = new DataSet("", "", "", "", "", "", "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji RGI_Emoji_Flag_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence", "");
|
117
122
|
function isValidUnicodeProperty(version, name, value) {
|
118
123
|
if (gcNameSet.has(name)) {
|
119
124
|
return version >= 2018 && gcValueSets.es2018.has(value);
|
@@ -255,6 +260,103 @@ function combineSurrogatePair(lead, trail) {
|
|
255
260
|
return (lead - 0xd800) * 0x400 + (trail - 0xdc00) + 0x10000;
|
256
261
|
}
|
257
262
|
|
263
|
+
class GroupSpecifiersAsES2018 {
|
264
|
+
constructor() {
|
265
|
+
this.groupName = new Set();
|
266
|
+
}
|
267
|
+
clear() {
|
268
|
+
this.groupName.clear();
|
269
|
+
}
|
270
|
+
isEmpty() {
|
271
|
+
return !this.groupName.size;
|
272
|
+
}
|
273
|
+
hasInPattern(name) {
|
274
|
+
return this.groupName.has(name);
|
275
|
+
}
|
276
|
+
hasInScope(name) {
|
277
|
+
return this.hasInPattern(name);
|
278
|
+
}
|
279
|
+
addToScope(name) {
|
280
|
+
this.groupName.add(name);
|
281
|
+
}
|
282
|
+
enterDisjunction() {
|
283
|
+
}
|
284
|
+
enterAlternative() {
|
285
|
+
}
|
286
|
+
leaveDisjunction() {
|
287
|
+
}
|
288
|
+
}
|
289
|
+
class BranchID {
|
290
|
+
constructor(parent, base) {
|
291
|
+
this.parent = parent;
|
292
|
+
this.base = base !== null && base !== void 0 ? base : this;
|
293
|
+
}
|
294
|
+
separatedFrom(other) {
|
295
|
+
var _a, _b;
|
296
|
+
if (this.base === other.base && this !== other) {
|
297
|
+
return true;
|
298
|
+
}
|
299
|
+
if (other.parent && this.separatedFrom(other.parent)) {
|
300
|
+
return true;
|
301
|
+
}
|
302
|
+
return (_b = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.separatedFrom(other)) !== null && _b !== void 0 ? _b : false;
|
303
|
+
}
|
304
|
+
child() {
|
305
|
+
return new BranchID(this, null);
|
306
|
+
}
|
307
|
+
sibling() {
|
308
|
+
return new BranchID(this.parent, this.base);
|
309
|
+
}
|
310
|
+
}
|
311
|
+
class GroupSpecifiersAsES2025 {
|
312
|
+
constructor() {
|
313
|
+
this.branchID = new BranchID(null, null);
|
314
|
+
this.groupNames = new Map();
|
315
|
+
}
|
316
|
+
clear() {
|
317
|
+
this.branchID = new BranchID(null, null);
|
318
|
+
this.groupNames.clear();
|
319
|
+
}
|
320
|
+
isEmpty() {
|
321
|
+
return !this.groupNames.size;
|
322
|
+
}
|
323
|
+
enterDisjunction() {
|
324
|
+
this.branchID = this.branchID.child();
|
325
|
+
}
|
326
|
+
enterAlternative(index) {
|
327
|
+
if (index === 0) {
|
328
|
+
return;
|
329
|
+
}
|
330
|
+
this.branchID = this.branchID.sibling();
|
331
|
+
}
|
332
|
+
leaveDisjunction() {
|
333
|
+
this.branchID = this.branchID.parent;
|
334
|
+
}
|
335
|
+
hasInPattern(name) {
|
336
|
+
return this.groupNames.has(name);
|
337
|
+
}
|
338
|
+
hasInScope(name) {
|
339
|
+
const branches = this.groupNames.get(name);
|
340
|
+
if (!branches) {
|
341
|
+
return false;
|
342
|
+
}
|
343
|
+
for (const branch of branches) {
|
344
|
+
if (!branch.separatedFrom(this.branchID)) {
|
345
|
+
return true;
|
346
|
+
}
|
347
|
+
}
|
348
|
+
return false;
|
349
|
+
}
|
350
|
+
addToScope(name) {
|
351
|
+
const branches = this.groupNames.get(name);
|
352
|
+
if (branches) {
|
353
|
+
branches.push(this.branchID);
|
354
|
+
return;
|
355
|
+
}
|
356
|
+
this.groupNames.set(name, [this.branchID]);
|
357
|
+
}
|
358
|
+
}
|
359
|
+
|
258
360
|
const legacyImpl = {
|
259
361
|
at(s, end, i) {
|
260
362
|
return i < end ? s.charCodeAt(i) : -1;
|
@@ -487,10 +589,13 @@ class RegExpValidator {
|
|
487
589
|
this._lastStrValue = "";
|
488
590
|
this._lastAssertionIsQuantifiable = false;
|
489
591
|
this._numCapturingParens = 0;
|
490
|
-
this._groupNames = new Set();
|
491
592
|
this._backreferenceNames = new Set();
|
492
593
|
this._srcCtx = null;
|
493
594
|
this._options = options !== null && options !== void 0 ? options : {};
|
595
|
+
this._groupSpecifiers =
|
596
|
+
this.ecmaVersion >= 2025
|
597
|
+
? new GroupSpecifiersAsES2025()
|
598
|
+
: new GroupSpecifiersAsES2018();
|
494
599
|
}
|
495
600
|
validateLiteral(source, start = 0, end = source.length) {
|
496
601
|
this._srcCtx = { source, start, end, kind: "literal" };
|
@@ -533,7 +638,7 @@ class RegExpValidator {
|
|
533
638
|
this.consumePattern();
|
534
639
|
if (!this._nFlag &&
|
535
640
|
this.ecmaVersion >= 2018 &&
|
536
|
-
this.
|
641
|
+
!this._groupSpecifiers.isEmpty()) {
|
537
642
|
this._nFlag = true;
|
538
643
|
this.rewind(start);
|
539
644
|
this.consumePattern();
|
@@ -870,7 +975,7 @@ class RegExpValidator {
|
|
870
975
|
consumePattern() {
|
871
976
|
const start = this.index;
|
872
977
|
this._numCapturingParens = this.countCapturingParens();
|
873
|
-
this.
|
978
|
+
this._groupSpecifiers.clear();
|
874
979
|
this._backreferenceNames.clear();
|
875
980
|
this.onPatternEnter(start);
|
876
981
|
this.consumeDisjunction();
|
@@ -889,7 +994,7 @@ class RegExpValidator {
|
|
889
994
|
this.raise(`Unexpected character '${c}'`);
|
890
995
|
}
|
891
996
|
for (const name of this._backreferenceNames) {
|
892
|
-
if (!this.
|
997
|
+
if (!this._groupSpecifiers.hasInPattern(name)) {
|
893
998
|
this.raise("Invalid named capture referenced");
|
894
999
|
}
|
895
1000
|
}
|
@@ -930,6 +1035,7 @@ class RegExpValidator {
|
|
930
1035
|
consumeDisjunction() {
|
931
1036
|
const start = this.index;
|
932
1037
|
let i = 0;
|
1038
|
+
this._groupSpecifiers.enterDisjunction();
|
933
1039
|
this.onDisjunctionEnter(start);
|
934
1040
|
do {
|
935
1041
|
this.consumeAlternative(i++);
|
@@ -941,9 +1047,11 @@ class RegExpValidator {
|
|
941
1047
|
this.raise("Lone quantifier brackets");
|
942
1048
|
}
|
943
1049
|
this.onDisjunctionLeave(start, this.index);
|
1050
|
+
this._groupSpecifiers.leaveDisjunction();
|
944
1051
|
}
|
945
1052
|
consumeAlternative(i) {
|
946
1053
|
const start = this.index;
|
1054
|
+
this._groupSpecifiers.enterAlternative(i);
|
947
1055
|
this.onAlternativeEnter(start, i);
|
948
1056
|
while (this.currentCodePoint !== -1 && this.consumeTerm()) {
|
949
1057
|
}
|
@@ -1177,8 +1285,8 @@ class RegExpValidator {
|
|
1177
1285
|
consumeGroupSpecifier() {
|
1178
1286
|
if (this.eat(QUESTION_MARK)) {
|
1179
1287
|
if (this.eatGroupName()) {
|
1180
|
-
if (!this.
|
1181
|
-
this.
|
1288
|
+
if (!this._groupSpecifiers.hasInScope(this._lastStrValue)) {
|
1289
|
+
this._groupSpecifiers.addToScope(this._lastStrValue);
|
1182
1290
|
return true;
|
1183
1291
|
}
|
1184
1292
|
this.raise("Duplicate capture group name");
|
@@ -2001,11 +2109,21 @@ class RegExpParserState {
|
|
2001
2109
|
this._node.raw = this.source.slice(start, end);
|
2002
2110
|
for (const reference of this._backreferences) {
|
2003
2111
|
const ref = reference.ref;
|
2004
|
-
const
|
2005
|
-
? this._capturingGroups[ref - 1]
|
2006
|
-
: this._capturingGroups.
|
2007
|
-
|
2008
|
-
|
2112
|
+
const groups = typeof ref === "number"
|
2113
|
+
? [this._capturingGroups[ref - 1]]
|
2114
|
+
: this._capturingGroups.filter((g) => g.name === ref);
|
2115
|
+
if (groups.length === 1) {
|
2116
|
+
const group = groups[0];
|
2117
|
+
reference.ambiguous = false;
|
2118
|
+
reference.resolved = group;
|
2119
|
+
}
|
2120
|
+
else {
|
2121
|
+
reference.ambiguous = true;
|
2122
|
+
reference.resolved = groups;
|
2123
|
+
}
|
2124
|
+
for (const group of groups) {
|
2125
|
+
group.references.push(reference);
|
2126
|
+
}
|
2009
2127
|
}
|
2010
2128
|
}
|
2011
2129
|
onAlternativeEnter(start) {
|
@@ -2203,10 +2321,12 @@ class RegExpParserState {
|
|
2203
2321
|
}
|
2204
2322
|
const base = {
|
2205
2323
|
type: "CharacterSet",
|
2324
|
+
parent: null,
|
2206
2325
|
start,
|
2207
2326
|
end,
|
2208
2327
|
raw: this.source.slice(start, end),
|
2209
2328
|
kind,
|
2329
|
+
strings: null,
|
2210
2330
|
key,
|
2211
2331
|
};
|
2212
2332
|
if (strings) {
|
@@ -2249,6 +2369,7 @@ class RegExpParserState {
|
|
2249
2369
|
end,
|
2250
2370
|
raw: this.source.slice(start, end),
|
2251
2371
|
ref,
|
2372
|
+
ambiguous: false,
|
2252
2373
|
resolved: DUMMY_CAPTURING_GROUP,
|
2253
2374
|
};
|
2254
2375
|
parent.elements.push(node);
|