File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -228,10 +228,10 @@ impl<W: fmt::Write> Visitor for Writer<W> {
228228                } 
229229            } , 
230230            HirKind :: Lookaround ( hir:: Lookaround :: PositiveLookBehind ( _) )  => { 
231-                 self . wtr . write_str ( r"(?<=) " ) ?; 
231+                 self . wtr . write_str ( r"(?<=" ) ?; 
232232            } 
233233            HirKind :: Lookaround ( hir:: Lookaround :: NegativeLookBehind ( _) )  => { 
234-                 self . wtr . write_str ( r"(?<!) " ) ?; 
234+                 self . wtr . write_str ( r"(?<!" ) ?; 
235235            } 
236236            HirKind :: Capture ( hir:: Capture  {  ref  name,  .. } )  => { 
237237                self . wtr . write_str ( "(" ) ?; 
@@ -484,6 +484,18 @@ mod tests {
484484        roundtrip ( "((((a))))" ,  "((((a))))" ) ; 
485485    } 
486486
487+     #[ test]  
488+     #[ ignore = "Missing parser support for lookaround" ]  
489+     fn  print_look_around ( )  { 
490+         roundtrip ( "(?<=)" ,  "(?<=(?:))" ) ; 
491+         roundtrip ( "(?<!)" ,  "(?<!(?:))" ) ; 
492+ 
493+         roundtrip ( "(?<=a)" ,  "(?<=a)" ) ; 
494+         roundtrip ( "(?<!a)" ,  "(?<!a)" ) ; 
495+ 
496+         roundtrip ( "(?<=(?<!(?<!(?<=a))))" ,  "(?<=(?<!(?<!(?<=a))))" ) ; 
497+     } 
498+ 
487499    #[ test]  
488500    fn  print_alternation ( )  { 
489501        roundtrip ( "|" ,  "(?:(?:)|(?:))" ) ; 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments