File tree 1 file changed +13
-4
lines changed
1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -186,7 +186,9 @@ function lexer(str: string) {
186
186
let pattern = "" ;
187
187
188
188
if ( chars [ i ] === "?" ) {
189
- throw new TypeError ( `Pattern cannot start with "?" at ${ i } ` ) ;
189
+ throw new TypeError (
190
+ `Pattern cannot start with "?" at ${ i } : ${ DEBUG_URL } ` ,
191
+ ) ;
190
192
}
191
193
192
194
while ( i < chars . length ) {
@@ -204,15 +206,22 @@ function lexer(str: string) {
204
206
} else if ( chars [ i ] === "(" ) {
205
207
count ++ ;
206
208
if ( chars [ i + 1 ] !== "?" ) {
207
- throw new TypeError ( `Capturing groups are not allowed at ${ i } ` ) ;
209
+ throw new TypeError (
210
+ `Capturing groups are not allowed at ${ i } : ${ DEBUG_URL } ` ,
211
+ ) ;
208
212
}
209
213
}
210
214
211
215
pattern += chars [ i ++ ] ;
212
216
}
213
217
214
- if ( count ) throw new TypeError ( `Unbalanced pattern at ${ pos } ` ) ;
215
- if ( ! pattern ) throw new TypeError ( `Missing pattern at ${ pos } ` ) ;
218
+ if ( count ) {
219
+ throw new TypeError ( `Unbalanced pattern at ${ pos } : ${ DEBUG_URL } ` ) ;
220
+ }
221
+
222
+ if ( ! pattern ) {
223
+ throw new TypeError ( `Missing pattern at ${ pos } : ${ DEBUG_URL } ` ) ;
224
+ }
216
225
217
226
tokens . push ( { type : "PATTERN" , index : i , value : pattern } ) ;
218
227
continue ;
You can’t perform that action at this time.
0 commit comments