• Vladislav Zavialov's avatar
    Factor out HsSCC/HsCoreAnn/HsTickPragma into HsPragE · 6985e0fc
    Vladislav Zavialov authored
    This is a refactoring with no user-visible changes (except for GHC API
    users). Consider the HsExpr constructors that correspond to user-written
    pragmas:
    
      HsSCC         representing  {-# SCC ... #-}
      HsCoreAnn     representing  {-# CORE ... #-}
      HsTickPragma  representing  {-# GENERATED ... #-}
    
    We can factor them out into a separate datatype, HsPragE. It makes the
    code a bit tidier, especially in the parser.
    
    Before this patch:
    
      hpc_annot :: { Located ( (([AddAnn],SourceText),(StringLiteral,(Int,Int),(Int,Int))),
                               ((SourceText,SourceText),(SourceText,SourceText))
                             ) }
    
    After this patch:
    
      prag_hpc :: { Located ([AddAnn], HsPragE GhcPs) }
    6985e0fc
DsMeta.hs 111 KB