File tree Expand file tree Collapse file tree 5 files changed +153
-0
lines changed Expand file tree Collapse file tree 5 files changed +153
-0
lines changed Original file line number Diff line number Diff line change 598
598
599
599
quantifier = parseQuantifier ( ) || false ;
600
600
if ( quantifier ) {
601
+ var type = anchorOrAtom . type , behavior = anchorOrAtom . behavior ;
602
+ if (
603
+ type === "group" &&
604
+ ( behavior === "negativeLookbehind" ||
605
+ behavior === "lookbehind" ||
606
+ ( isUnicodeMode &&
607
+ ( behavior === "negativeLookahead" || behavior === "lookahead" ) ) )
608
+ ) {
609
+ bail (
610
+ "Invalid quantifier" ,
611
+ "" ,
612
+ quantifier . range [ 0 ] ,
613
+ quantifier . range [ 1 ]
614
+ ) ;
615
+ }
601
616
quantifier . body = flattenBody ( anchorOrAtom ) ;
602
617
// The quantifier contains the atom. Therefore, the beginning of the
603
618
// quantifier range is given by the beginning of the atom.
Original file line number Diff line number Diff line change 359
359
"name" : " SyntaxError" ,
360
360
"message" : " atomEscape at position 1\n \\ k\n ^" ,
361
361
"input" : " \\ k"
362
+ },
363
+ "(?<=.){2,3}" : {
364
+ "type" : " error" ,
365
+ "name" : " SyntaxError" ,
366
+ "message" : " Invalid quantifier at position 6\n (?<=.){2,3}\n ^" ,
367
+ "input" : " (?<=.){2,3}"
368
+ },
369
+ "(?<!.){2,3}" : {
370
+ "type" : " error" ,
371
+ "name" : " SyntaxError" ,
372
+ "message" : " Invalid quantifier at position 6\n (?<!.){2,3}\n ^" ,
373
+ "input" : " (?<!.){2,3}"
362
374
}
363
375
}
Original file line number Diff line number Diff line change 1561
1561
21
1562
1562
],
1563
1563
"raw" : " [\\ u{14630}-\\ u{14633}]"
1564
+ },
1565
+ ".(?=.){2,3}" : {
1566
+ "type" : " error" ,
1567
+ "name" : " SyntaxError" ,
1568
+ "message" : " Invalid quantifier at position 6\n .(?=.){2,3}\n ^" ,
1569
+ "input" : " .(?=.){2,3}"
1570
+ },
1571
+ ".(?!.){2,3}" : {
1572
+ "type" : " error" ,
1573
+ "name" : " SyntaxError" ,
1574
+ "message" : " Invalid quantifier at position 6\n .(?!.){2,3}\n ^" ,
1575
+ "input" : " .(?!.){2,3}"
1564
1576
}
1565
1577
}
Original file line number Diff line number Diff line change 1228
1228
"name" : " SyntaxError" ,
1229
1229
"message" : " Invalid decimal escape in unicode mode at position 1\n \\ 2(.)\n ^" ,
1230
1230
"input" : " \\ 2(.)"
1231
+ },
1232
+ ".(?=.){2,3}" : {
1233
+ "type" : " error" ,
1234
+ "name" : " SyntaxError" ,
1235
+ "message" : " Invalid quantifier at position 6\n .(?=.){2,3}\n ^" ,
1236
+ "input" : " .(?=.){2,3}"
1237
+ },
1238
+ ".(?!.){2,3}" : {
1239
+ "type" : " error" ,
1240
+ "name" : " SyntaxError" ,
1241
+ "message" : " Invalid quantifier at position 6\n .(?!.){2,3}\n ^" ,
1242
+ "input" : " .(?!.){2,3}"
1231
1243
}
1232
1244
}
Original file line number Diff line number Diff line change @@ -38524,5 +38524,107 @@
38524
38524
6
38525
38525
],
38526
38526
"raw": "(?=a)?"
38527
+ },
38528
+ ".(?=.){2,3}": {
38529
+ "type": "alternative",
38530
+ "body": [
38531
+ {
38532
+ "type": "dot",
38533
+ "range": [
38534
+ 0,
38535
+ 1
38536
+ ],
38537
+ "raw": "."
38538
+ },
38539
+ {
38540
+ "type": "quantifier",
38541
+ "min": 2,
38542
+ "max": 3,
38543
+ "greedy": true,
38544
+ "body": [
38545
+ {
38546
+ "type": "group",
38547
+ "behavior": "lookahead",
38548
+ "body": [
38549
+ {
38550
+ "type": "dot",
38551
+ "range": [
38552
+ 4,
38553
+ 5
38554
+ ],
38555
+ "raw": "."
38556
+ }
38557
+ ],
38558
+ "range": [
38559
+ 1,
38560
+ 6
38561
+ ],
38562
+ "raw": "(?=.)"
38563
+ }
38564
+ ],
38565
+ "symbol": null,
38566
+ "range": [
38567
+ 1,
38568
+ 11
38569
+ ],
38570
+ "raw": "(?=.){2,3}"
38571
+ }
38572
+ ],
38573
+ "range": [
38574
+ 0,
38575
+ 11
38576
+ ],
38577
+ "raw": ".(?=.){2,3}"
38578
+ },
38579
+ ".(?!.){2,3}": {
38580
+ "type": "alternative",
38581
+ "body": [
38582
+ {
38583
+ "type": "dot",
38584
+ "range": [
38585
+ 0,
38586
+ 1
38587
+ ],
38588
+ "raw": "."
38589
+ },
38590
+ {
38591
+ "type": "quantifier",
38592
+ "min": 2,
38593
+ "max": 3,
38594
+ "greedy": true,
38595
+ "body": [
38596
+ {
38597
+ "type": "group",
38598
+ "behavior": "negativeLookahead",
38599
+ "body": [
38600
+ {
38601
+ "type": "dot",
38602
+ "range": [
38603
+ 4,
38604
+ 5
38605
+ ],
38606
+ "raw": "."
38607
+ }
38608
+ ],
38609
+ "range": [
38610
+ 1,
38611
+ 6
38612
+ ],
38613
+ "raw": "(?!.)"
38614
+ }
38615
+ ],
38616
+ "symbol": null,
38617
+ "range": [
38618
+ 1,
38619
+ 11
38620
+ ],
38621
+ "raw": "(?!.){2,3}"
38622
+ }
38623
+ ],
38624
+ "range": [
38625
+ 0,
38626
+ 11
38627
+ ],
38628
+ "raw": ".(?!.){2,3}"
38527
38629
}
38528
38630
}
You can’t perform that action at this time.
0 commit comments