This repository was archived by the owner on Jun 15, 2023. It is now read-only.
  
  
  
  
    
    
    
      
    
  
  
    
File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -55,10 +55,16 @@ let processUncurriedAttribute attrs =
5555  in 
5656  process false  []  attrs
5757
58+ type  functionAttributesInfo  = {
59+   async : bool ; 
60+   uncurried : bool ; 
61+   attributes : Parsetree .attributes ; 
62+ }
63+ 
5864let  processFunctionAttributes  attrs  = 
5965  let  rec  process  async  uncurried  acc  attrs  = 
6066    match  attrs with 
61-     |  []  -> ( async,  uncurried,  List. rev acc) 
67+     |  []  -> { async;  uncurried; attributes  =   List. rev acc} 
6268    |  ({Location. txt  = "bs" } , _ ) :: rest  -> process async true  acc rest
6369    |  ({Location. txt  = "async" } , _ ) :: rest  -> process true  uncurried acc rest
6470    |  attr  :: rest  -> process async uncurried (attr :: acc) rest
Original file line number Diff line number Diff line change @@ -17,10 +17,14 @@ val functorType :
1717val  processUncurriedAttribute  :
1818  Parsetree .attributes  -> bool  *  Parsetree .attributes 
1919
20+ type  functionAttributesInfo  = {
21+   async : bool ; 
22+   uncurried : bool ; 
23+   attributes : Parsetree .attributes ; 
24+ }
25+ 
2026(*  determines whether a function is async and/or uncurried based on the given attributes *) 
21- val  processFunctionAttributes  :
22-   Parsetree .attributes  ->
23-   bool  (*  async *) *  bool  (*  uncurried *) *  Parsetree .attributes 
27+ val  processFunctionAttributes  : Parsetree .attributes  -> functionAttributesInfo 
2428
2529val  hasAwaitAttribute  : Parsetree .attributes  -> bool 
2630
Original file line number Diff line number Diff line change @@ -3135,7 +3135,7 @@ and printExpression ~customLayout (e : Parsetree.expression) cmtTbl =
31353135        cmtTbl
31363136    |  Pexp_fun  _  |  Pexp_newtype  _  ->
31373137      let  attrsOnArrow, parameters, returnExpr =  ParsetreeViewer. funExpr e in 
3138-       let  async,  uncurried,  attrs = 
3138+       let  ParsetreeViewer. { async;  uncurried; attributes  =   attrs}  = 
31393139        ParsetreeViewer. processFunctionAttributes attrsOnArrow
31403140      in 
31413141      let  returnExpr, typConstraint = 
@@ -3302,7 +3302,7 @@ and printExpression ~customLayout (e : Parsetree.expression) cmtTbl =
33023302
33033303and  printPexpFun  ~customLayout   ~inCallback   e  cmtTbl  = 
33043304  let  attrsOnArrow, parameters, returnExpr =  ParsetreeViewer. funExpr e in 
3305-   let  async,  uncurried,  attrs = 
3305+   let  ParsetreeViewer. { async;  uncurried; attributes  =   attrs}  = 
33063306    ParsetreeViewer. processFunctionAttributes attrsOnArrow
33073307  in 
33083308  let  returnExpr, typConstraint = 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments