@@ -179,13 +179,15 @@ type RegexpRule = ParsableRegexpRule & UnparsableRegexpRule
179
179
const regexpRules = new WeakMap < ESTree . Program , RegexpRule [ ] > ( )
180
180
181
181
export const FLAG_GLOBAL = "g"
182
- export const FLAG_DOTALL = "s"
182
+ export const FLAG_DOT_ALL = "s"
183
+ export const FLAG_HAS_INDICES = "d"
183
184
export const FLAG_IGNORECASE = "i"
184
185
export const FLAG_MULTILINE = "m"
185
186
export const FLAG_STICKY = "y"
186
187
export const FLAG_UNICODE = "u"
188
+ export const FLAG_UNICODE_SETS = "v"
187
189
188
- const flagsCache = new Map < string , ReadonlyFlags > ( )
190
+ const flagsCache = new Map < string , Required < ReadonlyFlags > > ( )
189
191
190
192
/**
191
193
* Given some flags, this will return a parsed flags object.
@@ -196,12 +198,14 @@ export function parseFlags(flags: string): ReadonlyFlags {
196
198
let cached = flagsCache . get ( flags )
197
199
if ( cached === undefined ) {
198
200
cached = {
199
- dotAll : flags . includes ( FLAG_DOTALL ) ,
201
+ dotAll : flags . includes ( FLAG_DOT_ALL ) ,
200
202
global : flags . includes ( FLAG_GLOBAL ) ,
203
+ hasIndices : flags . includes ( FLAG_HAS_INDICES ) ,
201
204
ignoreCase : flags . includes ( FLAG_IGNORECASE ) ,
202
205
multiline : flags . includes ( FLAG_MULTILINE ) ,
203
206
sticky : flags . includes ( FLAG_STICKY ) ,
204
207
unicode : flags . includes ( FLAG_UNICODE ) ,
208
+ unicodeSets : flags . includes ( FLAG_UNICODE_SETS ) ,
205
209
}
206
210
flagsCache . set ( flags , cached )
207
211
}
0 commit comments