diff options
author | Alan Zimmerman <alan.zimm@gmail.com> | 2023-01-15 15:26:39 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-01-16 20:52:39 -0500 |
commit | 97ac8230b0a645aae27b7ee42aa55b0c84735684 (patch) | |
tree | ad071fbbaa2bfdc044c4ed786369b38c64f034c7 /compiler | |
parent | 97bd4d8c03fe74a7642f617db12bbee2215e24e6 (diff) | |
download | haskell-97ac8230b0a645aae27b7ee42aa55b0c84735684.tar.gz |
EPA: Add annotation for 'type' in DataDecl
Closes #22765
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/GHC/Parser.y | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/GHC/Parser.y b/compiler/GHC/Parser.y index 2648552bee..16b6519788 100644 --- a/compiler/GHC/Parser.y +++ b/compiler/GHC/Parser.y @@ -1279,7 +1279,7 @@ ty_decl :: { LTyClDecl GhcPs } {% mkTyData (comb4 $1 $3 $4 $5) (sndOf3 $ unLoc $1) (thdOf3 $ unLoc $1) $2 $3 Nothing (reverse (snd $ unLoc $4)) (fmap reverse $5) - ((fstOf3 $ unLoc $1):(fst $ unLoc $4)) } + ((fstOf3 $ unLoc $1)++(fst $ unLoc $4)) } -- We need the location on tycl_hdr in case -- constrs and deriving are both empty @@ -1290,7 +1290,7 @@ ty_decl :: { LTyClDecl GhcPs } {% mkTyData (comb4 $1 $3 $5 $6) (sndOf3 $ unLoc $1) (thdOf3 $ unLoc $1) $2 $3 (snd $ unLoc $4) (snd $ unLoc $5) (fmap reverse $6) - ((fstOf3 $ unLoc $1):(fst $ unLoc $4)++(fst $ unLoc $5)) } + ((fstOf3 $ unLoc $1)++(fst $ unLoc $4)++(fst $ unLoc $5)) } -- We need the location on tycl_hdr in case -- constrs and deriving are both empty @@ -1514,10 +1514,10 @@ at_decl_inst :: { LInstDecl GhcPs } (fmap reverse $7) ((fst $ unLoc $1):$2++(fst $ unLoc $5)++(fst $ unLoc $6)) } -type_data_or_newtype :: { Located (AddEpAnn, Bool, NewOrData) } - : 'data' { sL1 $1 (mj AnnData $1,False,DataType) } - | 'newtype' { sL1 $1 (mj AnnNewtype $1,False,NewType) } - | 'type' 'data' { sL1 $1 (mj AnnData $1,True ,DataType) } +type_data_or_newtype :: { Located ([AddEpAnn], Bool, NewOrData) } + : 'data' { sL1 $1 ([mj AnnData $1], False,DataType) } + | 'newtype' { sL1 $1 ([mj AnnNewtype $1], False,NewType) } + | 'type' 'data' { sL1 $1 ([mj AnnType $1, mj AnnData $2],True ,DataType) } data_or_newtype :: { Located (AddEpAnn, NewOrData) } : 'data' { sL1 $1 (mj AnnData $1,DataType) } |