@@ -52,8 +52,11 @@ describe('parseRegExp', () => {
5252 [ / [ a - ] / , AST . literal ( CharSet . fromArray ( [ 'a' , '-' ] ) ) ] ,
5353 // negative char class:
5454 [ / [ ^ a b c ] / , AST . literal ( CharSet . complement ( CharSet . fromArray ( [ 'a' , 'b' , 'c' ] ) ) ) ] ,
55+ // regular capturing groups:
56+ [ / ( ) / , group ( AST . epsilon ) ] ,
5557 // non-capturing groups
5658 [ / (?: a b ) / , str ( 'ab' ) ] ,
59+ [ / (?: ) / , AST . epsilon ] ,
5760 // named capturing groups
5861 [ / (?< abc_012_ABC > a b c ) / , group ( str ( 'abc' ) , 'abc_012_ABC' ) ] ,
5962 [ / (?< ABC > a b c ) / , group ( str ( 'abc' ) , 'ABC' ) ] ,
@@ -63,16 +66,19 @@ describe('parseRegExp', () => {
6366 [ / a ^ b / , AST . startMarker ( char ( 'a' ) , str ( 'b' ) ) ] ,
6467 [ / ^ a | ^ b / , AST . union ( AST . startMarker ( undefined , str ( 'a' ) ) , AST . startMarker ( undefined , char ( 'b' ) ) ) ] ,
6568 [ / ^ a b c $ / , AST . startMarker ( undefined , AST . endMarker ( str ( 'abc' ) , undefined ) ) ] ,
69+ [ / $ a ^ / , AST . startMarker ( AST . endMarker ( undefined , char ( 'a' ) ) , undefined ) ] ,
6670 // positive lookahead - now parsed as lookahead AST nodes, not intersections
6771 [ / (? = a ) b / , AST . positiveLookahead ( char ( 'a' ) , char ( 'b' ) ) ] ,
6872 [ / (? = a ) (?: b ) / , AST . positiveLookahead ( char ( 'a' ) , char ( 'b' ) ) ] ,
6973 [ / (? = a ) (? = b ) c / , AST . positiveLookahead ( char ( 'a' ) , AST . positiveLookahead ( char ( 'b' ) , char ( 'c' ) ) ) ] ,
7074 [ / a (? = b ) c / , AST . concat ( char ( 'a' ) , AST . positiveLookahead ( char ( 'b' ) , char ( 'c' ) ) ) ] ,
7175 [ / a (? = b ) / , AST . concat ( char ( 'a' ) , AST . positiveLookahead ( char ( 'b' ) , AST . epsilon ) ) ] ,
7276 [ / a (? = b ) c (? = d ) e / , AST . concat ( char ( 'a' ) , AST . positiveLookahead ( char ( 'b' ) , AST . concat ( char ( 'c' ) , AST . positiveLookahead ( char ( 'd' ) , char ( 'e' ) ) ) ) ) ] ,
77+ [ / (? = ) / , AST . positiveLookahead ( AST . epsilon , AST . epsilon ) ] ,
7378 // negative lookahead
7479 [ / (? ! a ) b / , AST . negativeLookahead ( char ( 'a' ) , char ( 'b' ) ) ] ,
7580 [ / (? ! a ) b | c / , AST . union ( AST . negativeLookahead ( char ( 'a' ) , char ( 'b' ) ) , char ( 'c' ) ) ] ,
81+ [ / (? ! ) / , AST . negativeLookahead ( AST . epsilon , AST . epsilon ) ] ,
7682 // TODO: positive lookbehind
7783 // [/(?<=a)/, AST.positiveLookbehind(char('a'))],
7884 // TODO: negative lookbehind
0 commit comments