@@ -179,13 +179,15 @@ type RegexpRule = ParsableRegexpRule & UnparsableRegexpRule
179179const regexpRules = new WeakMap < ESTree . Program , RegexpRule [ ] > ( )
180180
181181export const FLAG_GLOBAL = "g"
182- export const FLAG_DOTALL = "s"
182+ export const FLAG_DOT_ALL = "s"
183+ export const FLAG_HAS_INDICES = "d"
183184export const FLAG_IGNORECASE = "i"
184185export const FLAG_MULTILINE = "m"
185186export const FLAG_STICKY = "y"
186187export const FLAG_UNICODE = "u"
188+ export const FLAG_UNICODE_SETS = "v"
187189
188- const flagsCache = new Map < string , ReadonlyFlags > ( )
190+ const flagsCache = new Map < string , Required < ReadonlyFlags > > ( )
189191
190192/**
191193 * Given some flags, this will return a parsed flags object.
@@ -196,12 +198,14 @@ export function parseFlags(flags: string): ReadonlyFlags {
196198 let cached = flagsCache . get ( flags )
197199 if ( cached === undefined ) {
198200 cached = {
199- dotAll : flags . includes ( FLAG_DOTALL ) ,
201+ dotAll : flags . includes ( FLAG_DOT_ALL ) ,
200202 global : flags . includes ( FLAG_GLOBAL ) ,
203+ hasIndices : flags . includes ( FLAG_HAS_INDICES ) ,
201204 ignoreCase : flags . includes ( FLAG_IGNORECASE ) ,
202205 multiline : flags . includes ( FLAG_MULTILINE ) ,
203206 sticky : flags . includes ( FLAG_STICKY ) ,
204207 unicode : flags . includes ( FLAG_UNICODE ) ,
208+ unicodeSets : flags . includes ( FLAG_UNICODE_SETS ) ,
205209 }
206210 flagsCache . set ( flags , cached )
207211 }
0 commit comments