@eslint-community/regexpp 4.10.1 → 4.11.1
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/index.d.ts +19 -5
- package/index.js +129 -15
- package/index.js.map +1 -1
- package/index.mjs +129 -15
- package/index.mjs.map +1 -1
- package/package.json +2 -2
package/index.mjs
CHANGED
|
@@ -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;
|
|
@@ -41,10 +41,10 @@ function isLargeIdContinue(cp) {
|
|
|
41
41
|
return isInRange(cp, largeIdContinueRanges !== null && largeIdContinueRanges !== void 0 ? largeIdContinueRanges : (largeIdContinueRanges = initLargeIdContinueRanges()));
|
|
42
42
|
}
|
|
43
43
|
function initLargeIdStartRanges() {
|
|
44
|
-
return restoreRanges("4q 0 b 0 5 0 6 m 2 u 2 cp 5 b f 4 8 0 2 0 3m 4 2 1 3 3 2 0 7 0 2 2 2 0 2 j 2 2a 2 3u 9 4l 2 11 3 0 7 14 20 q 5 3 1a 16 10 1 2 2q 2 0 g 1 8 1 b 2 3 0 h 0 2 t u 2g c 0 p w a 1 5 0 6 l 5 0 a 0 4 0 o o 8 a 6 n 2 5 i 15 1n 1h 4 0 j 0 8 9 g f 5 7 3 1 3 l 2 6 2 0 4 3 4 0 h 0 e 1 2 2 f 1 b 0 9 5 5 1 3 l 2 6 2 1 2 1 2 1 w 3 2 0 k 2 h 8 2 2 2 l 2 6 2 1 2 4 4 0 j 0 g 1 o 0 c 7 3 1 3 l 2 6 2 1 2 4 4 0 v 1 2 2 g 0 i 0 2 5 4 2 2 3 4 1 2 0 2 1 4 1 4 2 4 b n 0 1h 7 2 2 2 m 2 f 4 0 r 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 5 z 5 13 9 1f d a 2 e 2 6 2 1 2 a 2 e 2 6 2 1 4 1f d 8m a l b 7 p 5 2 15 2 8 1y 5 3 0 2 17 2 1 4 0 3 m b m a u 1u i 2 1 b l b p 1z 1j 7 1 1t 0 g 3 2 2 2 s 17 s 4 s 10 7 2 r s 1h b l b i e h 33 20 1k 1e e 1e e z 13 r a m 6z 15 7 1 h 2 1o s b 0 9 l 17 h 1b k s m d 1g 1m 1 3 0 e 18 x o r z u 0 3 0 9 y 4 0 d 1b f 3 m 0 2 0 10 h 2 o k 1 1s 6 2 0 2 3 2 e 2 9 8 1a 13 7 3 1 3 l 2 6 2 1 2 4 4 0 j 0 d 4 v 9 2 0 3 0 2 11 2 0 q 0 2 0 19 1g j 3 l 2 v 1b l 1 2 0 55 1a 16 3 11 1b l 0 1o 16 e 0 20 q 12 6 56 17 39 1r w 7 3 0 3 7 2 1 2 n g 0 2 0 2n 7 3 12 h 0 2 0 t 0 b 13 8 0 m 0 c 19 k 0 j 20 5k w w 8 2 10 i 0 1e t 35 6 2 1 2 11 m 0 q 5 2 1 2 v f 0 94 i g 0 2 c 2 x 3h 0 28 pl 2v 32 i 5f 219 2o g tr i 5 q 32y 6 g6 5a2 t 1cz fs 8 u i 26 i t j 1b h 3 w k 6 i c1 18 5w 1r 3l 22 6 0 1v c 1t 1 2 0 t 4qf 9 yd 16 9 6w8 3 2 6 2 1 2 82 g 0 u 2 3 0 f 3 9 az 1s5 2y 6 c 4 8 8 9 4mf 2c 2 1y 2 1 3 0 3 1 3 3 2 b 2 0 2 6 2 1s 2 3 3 7 2 6 2 r 2 3 2 4 2 0 4 6 2 9f 3 o 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 7 1f9 u 7 5 7a 1p 43 18 b 6 h 0 8y t j 17 dh r 6d t 3 0 ds 6 2 3 2 1 2 e 2 5g 1o 1v 8 0 xh 3 2 q 2 1 2 0 3 0 2 9 2 3 2 0 2 0 7 0 5 0 2 0 2 0 2 2 2 1 2 0 3 0 2 0 2 0 2 0 2 0 2 1 2 0 3 3 2 6 2 3 2 3 2 0 2 9 2 g 6 2 2 4 2 g 3et wyn x 37d 7 65 3 4g1 f 5rk g h9 1wj f1 15v 3t6 6 38f");
|
|
45
45
|
}
|
|
46
46
|
function initLargeIdContinueRanges() {
|
|
47
|
-
return restoreRanges("53 0 g9 33 o 0 70 4 7e 18 2 0 2 1 2 1 2 0 21 a 1d u 7 0 2u 6 3 5 3 1 2 3 3 9 o 0 v q 2k a g 9 y 8 a 0 p 3 2 8 2 2 2 4 18 2
|
|
47
|
+
return restoreRanges("53 0 g9 33 o 0 70 4 7e 18 2 0 2 1 2 1 2 0 21 a 1d u 7 0 2u 6 3 5 3 1 2 3 3 9 o 0 v q 2k a g 9 y 8 a 0 p 3 2 8 2 2 2 4 18 2 1o 8 17 n 2 w 1j 2 2 h 2 6 b 1 3 9 i 2 1l 0 2 6 3 1 3 2 a 0 b 1 3 9 f 0 3 2 1l 0 2 4 5 1 3 2 4 0 l b 4 0 c 2 1l 0 2 7 2 2 2 2 l 1 3 9 b 5 2 2 1l 0 2 6 3 1 3 2 8 2 b 1 3 9 j 0 1o 4 4 2 2 3 a 0 f 9 h 4 1k 0 2 6 2 2 2 3 8 1 c 1 3 9 i 2 1l 0 2 6 2 2 2 3 8 1 c 1 3 9 4 0 d 3 1k 1 2 6 2 2 2 3 a 0 b 1 3 9 i 2 1z 0 5 5 2 0 2 7 7 9 3 1 1q 0 3 6 d 7 2 9 2g 0 3 8 c 6 2 9 1r 1 7 9 c 0 2 0 2 0 5 1 1e j 2 1 6 a 2 z a 0 2t j 2 9 d 3 5 2 2 2 3 6 4 3 e b 2 e jk 2 a 8 pt 3 t 2 u 1 v 1 1t v a 0 3 9 y 2 2 a 40 0 3b b 5 b b 9 3l a 1p 4 1m 9 2 s 3 a 7 9 n d 2 f 1e 4 1c g c 9 i 8 d 2 v c 3 9 19 d 1d j 9 9 7 9 3b 2 2 k 5 0 7 0 3 2 5j 1r el 1 1e 1 k 0 3g c 5 0 4 b 2db 2 3y 0 2p v ff 5 2y 1 2p 0 n51 9 1y 0 5 9 x 1 29 1 7l 0 4 0 5 0 o 4 5 0 2c 1 1f h b 9 7 h e a t 7 q c 19 3 1c d g 9 c 0 b 9 1c d d 0 9 1 3 9 y 2 1f 0 2 2 3 1 6 1 2 0 16 4 6 1 6l 7 2 1 3 9 fmt 0 ki f h f 4 1 p 2 5d 9 12 0 12 0 ig 0 6b 0 46 4 86 9 120 2 2 1 6 3 15 2 5 0 4m 1 fy 3 9 9 7 9 w 4 8u 1 28 3 1z a 1e 3 3f 2 1i e w a 3 1 b 3 1a a 8 0 1a 9 7 2 11 d 2 9 6 1 19 0 d 2 1d d 9 3 2 b 2b b 7 0 3 0 4e b 6 9 7 3 1k 1 2 6 3 1 3 2 a 0 b 1 3 6 4 4 1w 8 2 0 3 0 2 3 2 4 2 0 f 1 2b h a 9 5 0 2a j d 9 5y 6 3 8 s 1 2b g g 9 2a c 9 9 7 j 1m e 5 9 6r e 4m 9 1z 5 2 1 3 3 2 0 2 1 d 9 3c 6 3 6 4 0 t 9 15 6 2 3 9 0 a a 1b f 9j 9 1i 7 2 7 h 9 1l l 2 d 3f 5 4 0 2 1 2 6 2 0 9 9 1d 4 2 1 2 4 9 9 96 3 a 1 2 0 1d 6 4 4 e a 44m 0 7 e 8uh r 1t3 9 2f 9 13 4 1o 6 q 9 ev 9 d2 0 2 1i 8 3 2a 0 c 1 f58 1 382 9 ef 19 3 m f3 4 4 5 9 7 3 6 v 3 45 2 13e 1d e9 1i 5 1d 9 0 f 0 n 4 2 e 11t 6 2 g 3 6 2 1 2 4 2t 0 4h 6 a 9 9x 0 1q d dv d 6t 1 2 9 k6 6 32 6 6 9 3o7 9 gvt3 6n");
|
|
48
48
|
}
|
|
49
49
|
function isInRange(cp, ranges) {
|
|
50
50
|
let l = 0, r = (ranges.length / 2) | 0, i = 0, min = 0, max = 0;
|
|
@@ -116,7 +116,7 @@ class DataSet {
|
|
|
116
116
|
const gcNameSet = new Set(["General_Category", "gc"]);
|
|
117
117
|
const scNameSet = new Set(["Script", "Script_Extensions", "sc", "scx"]);
|
|
118
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", "", "");
|
|
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", "Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz", "", "");
|
|
120
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
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", "");
|
|
122
122
|
function isValidUnicodeProperty(version, name, value) {
|
|
@@ -260,6 +260,103 @@ function combineSurrogatePair(lead, trail) {
|
|
|
260
260
|
return (lead - 0xd800) * 0x400 + (trail - 0xdc00) + 0x10000;
|
|
261
261
|
}
|
|
262
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
|
+
|
|
263
360
|
const legacyImpl = {
|
|
264
361
|
at(s, end, i) {
|
|
265
362
|
return i < end ? s.charCodeAt(i) : -1;
|
|
@@ -492,10 +589,13 @@ class RegExpValidator {
|
|
|
492
589
|
this._lastStrValue = "";
|
|
493
590
|
this._lastAssertionIsQuantifiable = false;
|
|
494
591
|
this._numCapturingParens = 0;
|
|
495
|
-
this._groupNames = new Set();
|
|
496
592
|
this._backreferenceNames = new Set();
|
|
497
593
|
this._srcCtx = null;
|
|
498
594
|
this._options = options !== null && options !== void 0 ? options : {};
|
|
595
|
+
this._groupSpecifiers =
|
|
596
|
+
this.ecmaVersion >= 2025
|
|
597
|
+
? new GroupSpecifiersAsES2025()
|
|
598
|
+
: new GroupSpecifiersAsES2018();
|
|
499
599
|
}
|
|
500
600
|
validateLiteral(source, start = 0, end = source.length) {
|
|
501
601
|
this._srcCtx = { source, start, end, kind: "literal" };
|
|
@@ -538,7 +638,7 @@ class RegExpValidator {
|
|
|
538
638
|
this.consumePattern();
|
|
539
639
|
if (!this._nFlag &&
|
|
540
640
|
this.ecmaVersion >= 2018 &&
|
|
541
|
-
this.
|
|
641
|
+
!this._groupSpecifiers.isEmpty()) {
|
|
542
642
|
this._nFlag = true;
|
|
543
643
|
this.rewind(start);
|
|
544
644
|
this.consumePattern();
|
|
@@ -875,7 +975,7 @@ class RegExpValidator {
|
|
|
875
975
|
consumePattern() {
|
|
876
976
|
const start = this.index;
|
|
877
977
|
this._numCapturingParens = this.countCapturingParens();
|
|
878
|
-
this.
|
|
978
|
+
this._groupSpecifiers.clear();
|
|
879
979
|
this._backreferenceNames.clear();
|
|
880
980
|
this.onPatternEnter(start);
|
|
881
981
|
this.consumeDisjunction();
|
|
@@ -894,7 +994,7 @@ class RegExpValidator {
|
|
|
894
994
|
this.raise(`Unexpected character '${c}'`);
|
|
895
995
|
}
|
|
896
996
|
for (const name of this._backreferenceNames) {
|
|
897
|
-
if (!this.
|
|
997
|
+
if (!this._groupSpecifiers.hasInPattern(name)) {
|
|
898
998
|
this.raise("Invalid named capture referenced");
|
|
899
999
|
}
|
|
900
1000
|
}
|
|
@@ -935,6 +1035,7 @@ class RegExpValidator {
|
|
|
935
1035
|
consumeDisjunction() {
|
|
936
1036
|
const start = this.index;
|
|
937
1037
|
let i = 0;
|
|
1038
|
+
this._groupSpecifiers.enterDisjunction();
|
|
938
1039
|
this.onDisjunctionEnter(start);
|
|
939
1040
|
do {
|
|
940
1041
|
this.consumeAlternative(i++);
|
|
@@ -946,9 +1047,11 @@ class RegExpValidator {
|
|
|
946
1047
|
this.raise("Lone quantifier brackets");
|
|
947
1048
|
}
|
|
948
1049
|
this.onDisjunctionLeave(start, this.index);
|
|
1050
|
+
this._groupSpecifiers.leaveDisjunction();
|
|
949
1051
|
}
|
|
950
1052
|
consumeAlternative(i) {
|
|
951
1053
|
const start = this.index;
|
|
1054
|
+
this._groupSpecifiers.enterAlternative(i);
|
|
952
1055
|
this.onAlternativeEnter(start, i);
|
|
953
1056
|
while (this.currentCodePoint !== -1 && this.consumeTerm()) {
|
|
954
1057
|
}
|
|
@@ -1182,8 +1285,8 @@ class RegExpValidator {
|
|
|
1182
1285
|
consumeGroupSpecifier() {
|
|
1183
1286
|
if (this.eat(QUESTION_MARK)) {
|
|
1184
1287
|
if (this.eatGroupName()) {
|
|
1185
|
-
if (!this.
|
|
1186
|
-
this.
|
|
1288
|
+
if (!this._groupSpecifiers.hasInScope(this._lastStrValue)) {
|
|
1289
|
+
this._groupSpecifiers.addToScope(this._lastStrValue);
|
|
1187
1290
|
return true;
|
|
1188
1291
|
}
|
|
1189
1292
|
this.raise("Duplicate capture group name");
|
|
@@ -2006,11 +2109,21 @@ class RegExpParserState {
|
|
|
2006
2109
|
this._node.raw = this.source.slice(start, end);
|
|
2007
2110
|
for (const reference of this._backreferences) {
|
|
2008
2111
|
const ref = reference.ref;
|
|
2009
|
-
const
|
|
2010
|
-
? this._capturingGroups[ref - 1]
|
|
2011
|
-
: this._capturingGroups.
|
|
2012
|
-
|
|
2013
|
-
|
|
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
|
+
}
|
|
2014
2127
|
}
|
|
2015
2128
|
}
|
|
2016
2129
|
onAlternativeEnter(start) {
|
|
@@ -2256,6 +2369,7 @@ class RegExpParserState {
|
|
|
2256
2369
|
end,
|
|
2257
2370
|
raw: this.source.slice(start, end),
|
|
2258
2371
|
ref,
|
|
2372
|
+
ambiguous: false,
|
|
2259
2373
|
resolved: DUMMY_CAPTURING_GROUP,
|
|
2260
2374
|
};
|
|
2261
2375
|
parent.elements.push(node);
|