Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

GHC API CPP should be isolated to one module #1180

Open
@mpickering

Description

@mpickering

There is some undisciplined CPP which makes modifying code harder than it should be. This should all be placed into a compatibility module so it is isolated into one place.

For example

508         processSig :: LSig GhcPs -> [Decl]                                      
509 #if __GLASGOW_HASKELL__ >= 806                                                                        
510         processSig (L l (ClassOpSig _ False names _)) =                         
511 #else                                                                            
512         processSig (L l (ClassOpSig False names _)) =                                           
513 #endif                                                                          
514           map (\n -> Decl LSP.SkMethod n [] l) names                               
515         processSig _ = []                                                       
516                                                                                 
517         processCon :: LConDecl GhcPs -> [Decl]                                  
518         processCon (L l ConDeclGADT { con_names = names }) =                       
519           map (\n -> Decl LSP.SkConstructor n [] l) names                       
520 #if __GLASGOW_HASKELL__ >= 806                                                  
521         processCon (L l ConDeclH98 { con_name = name, con_args    = dets }) =   
522 #else                                                                           
523         processCon (L l ConDeclH98 { con_name = name, con_details = dets }) =   
524 #endif  

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: refactorRefactor and tidy up internals.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions