We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6a386a2 commit d757c6bCopy full SHA for d757c6b
2 files changed
src/lexer/regexp.ts
@@ -59,13 +59,13 @@ export function scanRegularExpression(parser: ParserState, context: Context): To
59
const bodyEnd = parser.index - 1;
60
61
const enum RegexFlags {
62
- Empty = 0b00000,
63
- IgnoreCase = 0b00001,
64
- Global = 0b00010,
65
- Multiline = 0b00100,
66
- Unicode = 0b10000,
67
- Sticky = 0b01000,
68
- DotAll = 0b1100
+ Empty = 0b000000,
+ IgnoreCase = 0b000001,
+ Global = 0b000010,
+ Multiline = 0b000100,
+ Unicode = 0b010000,
+ Sticky = 0b001000,
+ DotAll = 0b100000
69
}
70
71
let mask = RegexFlags.Empty;
test/lexer/regexp.ts
@@ -133,6 +133,13 @@ describe('Lexer - Regular expressions', () => {
133
[Context.AllowRegExp, '/a(?!b(?!c)d)e/', 'a(?!b(?!c)d)e', ''],
134
[Context.AllowRegExp, '/[^a-z]{4}/', '[^a-z]{4}', ''],
135
[Context.AllowRegExp, '/1?1/mig', '1?1', 'mig'],
136
+ [Context.AllowRegExp, '/.*/sm', '.*', 'sm'],
137
+ [Context.AllowRegExp, '/.*/ms', '.*', 'ms'],
138
+ [Context.AllowRegExp, '/.*/sy', '.*', 'sy'],
139
+ [Context.AllowRegExp, '/.*/ys', '.*', 'ys'],
140
+ [Context.AllowRegExp, '/.*/s', '.*', 's'],
141
+ [Context.AllowRegExp, '/.*/m', '.*', 'm'],
142
+ [Context.AllowRegExp, '/.*/y', '.*', 'y'],
143
[Context.AllowRegExp, '/\\%([0-9]*)\\[(\\^)?(\\]?[^\\]]*)\\]/', '\\%([0-9]*)\\[(\\^)?(\\]?[^\\]]*)\\]', '']
144
];
145
0 commit comments