Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC

Commits:

15 changed files:

Changes:

  • compiler/GHC/Hs/Decls.hs
    ... ... @@ -446,13 +446,12 @@ data AnnDataDefn
    446 446
           andd_instance :: EpToken "instance",
    
    447 447
           andd_dcolon   :: TokDcolon,
    
    448 448
           andd_where    :: EpToken "where",
    
    449
    -      andd_openc    :: EpToken "{",
    
    450
    -      andd_closec   :: EpToken "}",
    
    449
    +      andd_list     :: AnnList,
    
    451 450
           andd_equal    :: EpToken "="
    
    452 451
       } deriving Data
    
    453 452
     
    
    454 453
     instance NoAnn AnnDataDefn where
    
    455
    -  noAnn = AnnDataDefn noAnn noAnn noAnn noAnn noAnn noAnn noAnn noAnn noAnn noAnn noAnn
    
    454
    +  noAnn = AnnDataDefn noAnn noAnn noAnn noAnn noAnn noAnn noAnn noAnn noAnn noAnn
    
    456 455
     
    
    457 456
     data AnnClassDecl
    
    458 457
       = AnnClassDecl {
    

  • compiler/GHC/Hs/Dump.hs
    ... ... @@ -248,14 +248,14 @@ showAstData bs ba a0 = blankLine $$ showAstData' a0
    248 248
                                      showAstData' t, showAstData' e]
    
    249 249
     
    
    250 250
                 annDataDefn :: AnnDataDefn -> SDoc
    
    251
    -            annDataDefn (AnnDataDefn a b c d e f g h i j k) = case ba of
    
    251
    +            annDataDefn (AnnDataDefn a b c d e f g h i j) = case ba of
    
    252 252
                  BlankEpAnnotations -> parens $ text "blanked:" <+> text "AnnDataDefn"
    
    253 253
                  NoBlankEpAnnotations ->
    
    254 254
                   parens $ text "AnnDataDefn"
    
    255 255
                             $$ vcat [showAstData' a, showAstData' b, showAstData' c,
    
    256 256
                                      showAstData' d, showAstData' e, showAstData' f,
    
    257 257
                                      showAstData' g, showAstData' h, showAstData' i,
    
    258
    -                                 showAstData' j, showAstData' k]
    
    258
    +                                 showAstData' j]
    
    259 259
     
    
    260 260
                 annFamilyDecl :: AnnFamilyDecl -> SDoc
    
    261 261
                 annFamilyDecl (AnnFamilyDecl a b c d e f g h i j) = case ba of
    

  • compiler/GHC/Parser.y
    ... ... @@ -1367,7 +1367,7 @@ ty_decl :: { LTyClDecl GhcPs }
    1367 1367
                       ; mkTyData (comb4 $1 $3 $4 $5) (sndOf3 $ unLoc $1) (thdOf3 $ unLoc $1) $2 $3
    
    1368 1368
                                Nothing (reverse (snd $ unLoc $4))
    
    1369 1369
                                        (fmap reverse $5)
    
    1370
    -                           (AnnDataDefn [] [] ttype tnewtype tdata noEpTok noEpUniTok noEpTok noEpTok noEpTok tequal)
    
    1370
    +                           (AnnDataDefn [] [] ttype tnewtype tdata noEpTok noEpUniTok noEpTok noAnn tequal)
    
    1371 1371
                                  }}
    
    1372 1372
                                        -- We need the location on tycl_hdr in case
    
    1373 1373
                                        -- constrs and deriving are both empty
    
    ... ... @@ -1378,11 +1378,11 @@ ty_decl :: { LTyClDecl GhcPs }
    1378 1378
                      maybe_derivings
    
    1379 1379
                 {% do { let { (tdata, tnewtype, ttype) = fstOf3 $ unLoc $1}
    
    1380 1380
                       ; let { tdcolon = fst $ unLoc $4 }
    
    1381
    -                  ; let { (twhere, oc, cc) = fst $ unLoc $5 }
    
    1381
    +                  ; let { (twhere, al) = fst $ unLoc $5 }
    
    1382 1382
                       ; mkTyData (comb5 $1 $3 $4 $5 $6) (sndOf3 $ unLoc $1) (thdOf3 $ unLoc $1) $2 $3
    
    1383 1383
                                 (snd $ unLoc $4) (snd $ unLoc $5)
    
    1384 1384
                                 (fmap reverse $6)
    
    1385
    -                            (AnnDataDefn [] [] ttype tnewtype tdata noEpTok tdcolon twhere oc cc noEpTok)}}
    
    1385
    +                            (AnnDataDefn [] [] ttype tnewtype tdata noEpTok tdcolon twhere al noEpTok)}}
    
    1386 1386
                                        -- We need the location on tycl_hdr in case
    
    1387 1387
                                        -- constrs and deriving are both empty
    
    1388 1388
     
    
    ... ... @@ -1460,7 +1460,7 @@ inst_decl :: { LInstDecl GhcPs }
    1460 1460
                       ; mkDataFamInst (comb4 $1 $4 $5 $6) (snd $ unLoc $1) $3 (unLoc $4)
    
    1461 1461
                                           Nothing (reverse (snd  $ unLoc $5))
    
    1462 1462
                                                   (fmap reverse $6)
    
    1463
    -                            (AnnDataDefn [] [] noEpTok tnewtype tdata (epTok $2) noEpUniTok noEpTok noEpTok noEpTok tequal)}}
    
    1463
    +                            (AnnDataDefn [] [] noEpTok tnewtype tdata (epTok $2) noEpUniTok noEpTok noAnn tequal)}}
    
    1464 1464
     
    
    1465 1465
               -- GADT instance declaration
    
    1466 1466
             | data_or_newtype 'instance' capi_ctype datafam_inst_hdr opt_kind_sig
    
    ... ... @@ -1468,11 +1468,11 @@ inst_decl :: { LInstDecl GhcPs }
    1468 1468
                      maybe_derivings
    
    1469 1469
                 {% do { let { (tdata, tnewtype) = fst $ unLoc $1 }
    
    1470 1470
                       ; let { dcolon = fst $ unLoc $5 }
    
    1471
    -                  ; let { (twhere, oc, cc) = fst $ unLoc $6 }
    
    1471
    +                  ; let { (twhere, al) = fst $ unLoc $6 }
    
    1472 1472
                       ; mkDataFamInst (comb4 $1 $4 $6 $7) (snd $ unLoc $1) $3 (unLoc $4)
    
    1473 1473
                                        (snd $ unLoc $5) (snd $ unLoc $6)
    
    1474 1474
                                        (fmap reverse $7)
    
    1475
    -                            (AnnDataDefn [] [] noEpTok tnewtype tdata (epTok $2) dcolon twhere oc cc noEpTok)}}
    
    1475
    +                            (AnnDataDefn [] [] noEpTok tnewtype tdata (epTok $2) dcolon twhere al noEpTok)}}
    
    1476 1476
     
    
    1477 1477
     overlap_pragma :: { Maybe (LocatedA (OverlapMode GhcPs)) }
    
    1478 1478
       : '{-# OVERLAPPABLE'    '#-}' {% fmap Just $ amsA' (sLL $1 $> (Overlappable (getOVERLAPPABLE_PRAGs $1,
    
    ... ... @@ -1631,7 +1631,7 @@ at_decl_inst :: { LInstDecl GhcPs }
    1631 1631
                       ; mkDataFamInst (comb4 $1 $4 $5 $6) (snd $ unLoc $1) $3 (unLoc $4)
    
    1632 1632
                                         Nothing (reverse (snd $ unLoc $5))
    
    1633 1633
                                                  (fmap reverse $6)
    
    1634
    -                            (AnnDataDefn [] [] noEpTok tnewtype tdata $2 noEpUniTok noEpTok noEpTok noEpTok tequal)}}
    
    1634
    +                            (AnnDataDefn [] [] noEpTok tnewtype tdata $2 noEpUniTok noEpTok noAnn tequal)}}
    
    1635 1635
     
    
    1636 1636
             -- GADT instance declaration, with optional 'instance' keyword
    
    1637 1637
             | data_or_newtype opt_instance capi_ctype datafam_inst_hdr opt_kind_sig
    
    ... ... @@ -1639,11 +1639,11 @@ at_decl_inst :: { LInstDecl GhcPs }
    1639 1639
                      maybe_derivings
    
    1640 1640
                  {% do { let { (tdata, tnewtype) = fst $ unLoc $1 }
    
    1641 1641
                        ; let { dcolon = fst $ unLoc $5 }
    
    1642
    -                   ; let { (twhere, oc, cc) = fst $ unLoc $6 }
    
    1642
    +                   ; let { (twhere, al) = fst $ unLoc $6 }
    
    1643 1643
                        ; mkDataFamInst (comb4 $1 $4 $6 $7) (snd $ unLoc $1) $3
    
    1644 1644
                                     (unLoc $4) (snd $ unLoc $5) (snd $ unLoc $6)
    
    1645 1645
                                     (fmap reverse $7)
    
    1646
    -                            (AnnDataDefn [] [] noEpTok tnewtype tdata $2 dcolon twhere oc cc noEpTok)}}
    
    1646
    +                            (AnnDataDefn [] [] noEpTok tnewtype tdata $2 dcolon twhere al noEpTok)}}
    
    1647 1647
     
    
    1648 1648
     type_data_or_newtype :: { Located ((EpToken "data", EpToken "newtype", EpToken "type")
    
    1649 1649
                                        , Bool, NewOrData) }
    
    ... ... @@ -2552,18 +2552,16 @@ constructors.
    2552 2552
     -----------------------------------------------------------------------------
    
    2553 2553
     -- Datatype declarations
    
    2554 2554
     
    
    2555
    -gadt_constrlist :: { Located ((EpToken "where", EpToken "{", EpToken "}")
    
    2556
    -                          ,[LConDecl GhcPs]) } -- Returned in order
    
    2555
    +gadt_constrlist :: { Located ((EpToken "where", AnnList)
    
    2556
    +                             , [LConDecl GhcPs]) } -- Returned in order
    
    2557 2557
     
    
    2558 2558
             : 'where' '{'        gadt_constrs '}'    {% checkEmptyGADTs $
    
    2559 2559
                                                           L (comb2 $1 $4)
    
    2560
    -                                                        ((epTok $1
    
    2561
    -                                                         ,epTok $2
    
    2562
    -                                                         ,epTok $4)
    
    2560
    +                                                        ((epTok $1, AnnList AnnListBraces (ListBraces (epTok $2) (epTok $4)) [])
    
    2563 2561
                                                             , unLoc $3) }
    
    2564 2562
             | 'where' vocurly    gadt_constrs close  {% checkEmptyGADTs $
    
    2565 2563
                                                           L (comb2 $1 $3)
    
    2566
    -                                                        ((epTok $1, noEpTok, noEpTok)
    
    2564
    +                                                        ((epTok $1,  AnnList (AnnListLayout $ glR $2) ListNone [])
    
    2567 2565
                                                             , unLoc $3) }
    
    2568 2566
             | {- empty -}                            { noLoc (noAnn,[]) }
    
    2569 2567
     
    

  • compiler/GHC/Parser/PostProcess.hs
    ... ... @@ -1116,8 +1116,8 @@ checkRecordSyntax lr@(L loc r)
    1116 1116
     
    
    1117 1117
     -- | Check if the gadt_constrlist is empty. Only raise parse error for
    
    1118 1118
     -- `data T where` to avoid affecting existing error message, see #8258.
    
    1119
    -checkEmptyGADTs :: Located ((EpToken "where", EpToken "{", EpToken "}"), [LConDecl GhcPs])
    
    1120
    -                -> P (Located ((EpToken "where", EpToken "{", EpToken "}"), [LConDecl GhcPs]))
    
    1119
    +checkEmptyGADTs :: Located ((EpToken "where", AnnList), [LConDecl GhcPs])
    
    1120
    +                -> P (Located ((EpToken "where", AnnList), [LConDecl GhcPs]))
    
    1121 1121
     checkEmptyGADTs gadts@(L span (_, []))           -- Empty GADT declaration.
    
    1122 1122
         = do gadtSyntax <- getBit GadtSyntaxBit   -- GADTs implies GADTSyntax
    
    1123 1123
              unless gadtSyntax $ addError $ mkPlainErrorMsgEnvelope span $
    

  • testsuite/tests/ghc-api/exactprint/Test20239.stderr
    ... ... @@ -133,8 +133,10 @@
    133 133
                (NormalSyntax))
    
    134 134
               (EpTok
    
    135 135
                (EpaSpan { <no location info> }))
    
    136
    -          (EpTok (EpaSpan { <no location info> }))
    
    137
    -          (EpTok (EpaSpan { <no location info> }))
    
    136
    +          (AnnList
    
    137
    +           (AnnListNoLayout)
    
    138
    +           (ListNone)
    
    139
    +           [])
    
    138 140
               (EpTok
    
    139 141
                (EpaSpan { Test20239.hs:5:34 })))
    
    140 142
              (Nothing)
    

  • testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr
    ... ... @@ -1127,8 +1127,11 @@
    1127 1127
                     (NormalSyntax))
    
    1128 1128
                    (EpTok
    
    1129 1129
                     (EpaSpan { T17544.hs:24:15-19 }))
    
    1130
    -               (EpTok (EpaSpan { <no location info> }))
    
    1131
    -               (EpTok (EpaSpan { <no location info> }))
    
    1130
    +               (AnnList
    
    1131
    +                (AnnListLayout
    
    1132
    +                 (EpaSpan { T17544.hs:25:5 }))
    
    1133
    +                (ListNone)
    
    1134
    +                [])
    
    1132 1135
                    (EpTok
    
    1133 1136
                     (EpaSpan { <no location info> })))
    
    1134 1137
                   (Nothing)
    
    ... ... @@ -1523,8 +1526,11 @@
    1523 1526
                     (NormalSyntax))
    
    1524 1527
                    (EpTok
    
    1525 1528
                     (EpaSpan { T17544.hs:30:15-19 }))
    
    1526
    -               (EpTok (EpaSpan { <no location info> }))
    
    1527
    -               (EpTok (EpaSpan { <no location info> }))
    
    1529
    +               (AnnList
    
    1530
    +                (AnnListLayout
    
    1531
    +                 (EpaSpan { T17544.hs:31:5 }))
    
    1532
    +                (ListNone)
    
    1533
    +                [])
    
    1528 1534
                    (EpTok
    
    1529 1535
                     (EpaSpan { <no location info> })))
    
    1530 1536
                   (Nothing)
    
    ... ... @@ -1919,8 +1925,11 @@
    1919 1925
                     (NormalSyntax))
    
    1920 1926
                    (EpTok
    
    1921 1927
                     (EpaSpan { T17544.hs:36:15-19 }))
    
    1922
    -               (EpTok (EpaSpan { <no location info> }))
    
    1923
    -               (EpTok (EpaSpan { <no location info> }))
    
    1928
    +               (AnnList
    
    1929
    +                (AnnListLayout
    
    1930
    +                 (EpaSpan { T17544.hs:37:5 }))
    
    1931
    +                (ListNone)
    
    1932
    +                [])
    
    1924 1933
                    (EpTok
    
    1925 1934
                     (EpaSpan { <no location info> })))
    
    1926 1935
                   (Nothing)
    
    ... ... @@ -2315,8 +2324,11 @@
    2315 2324
                     (NormalSyntax))
    
    2316 2325
                    (EpTok
    
    2317 2326
                     (EpaSpan { T17544.hs:42:15-19 }))
    
    2318
    -               (EpTok (EpaSpan { <no location info> }))
    
    2319
    -               (EpTok (EpaSpan { <no location info> }))
    
    2327
    +               (AnnList
    
    2328
    +                (AnnListLayout
    
    2329
    +                 (EpaSpan { T17544.hs:43:5 }))
    
    2330
    +                (ListNone)
    
    2331
    +                [])
    
    2320 2332
                    (EpTok
    
    2321 2333
                     (EpaSpan { <no location info> })))
    
    2322 2334
                   (Nothing)
    
    ... ... @@ -2711,8 +2723,11 @@
    2711 2723
                     (NormalSyntax))
    
    2712 2724
                    (EpTok
    
    2713 2725
                     (EpaSpan { T17544.hs:48:15-19 }))
    
    2714
    -               (EpTok (EpaSpan { <no location info> }))
    
    2715
    -               (EpTok (EpaSpan { <no location info> }))
    
    2726
    +               (AnnList
    
    2727
    +                (AnnListLayout
    
    2728
    +                 (EpaSpan { T17544.hs:49:5 }))
    
    2729
    +                (ListNone)
    
    2730
    +                [])
    
    2716 2731
                    (EpTok
    
    2717 2732
                     (EpaSpan { <no location info> })))
    
    2718 2733
                   (Nothing)
    
    ... ... @@ -3107,8 +3122,11 @@
    3107 3122
                     (NormalSyntax))
    
    3108 3123
                    (EpTok
    
    3109 3124
                     (EpaSpan { T17544.hs:54:16-20 }))
    
    3110
    -               (EpTok (EpaSpan { <no location info> }))
    
    3111
    -               (EpTok (EpaSpan { <no location info> }))
    
    3125
    +               (AnnList
    
    3126
    +                (AnnListLayout
    
    3127
    +                 (EpaSpan { T17544.hs:55:5 }))
    
    3128
    +                (ListNone)
    
    3129
    +                [])
    
    3112 3130
                    (EpTok
    
    3113 3131
                     (EpaSpan { <no location info> })))
    
    3114 3132
                   (Nothing)
    

  • testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
    ... ... @@ -184,8 +184,11 @@
    184 184
              (NormalSyntax))
    
    185 185
             (EpTok
    
    186 186
              (EpaSpan { T17544_kw.hs:14:3-7 }))
    
    187
    -        (EpTok (EpaSpan { <no location info> }))
    
    188
    -        (EpTok (EpaSpan { <no location info> }))
    
    187
    +        (AnnList
    
    188
    +         (AnnListLayout
    
    189
    +          (EpaSpan { T17544_kw.hs:14:9 }))
    
    190
    +         (ListNone)
    
    191
    +         [])
    
    189 192
             (EpTok
    
    190 193
              (EpaSpan { <no location info> })))
    
    191 194
            (Nothing)
    
    ... ... @@ -292,8 +295,11 @@
    292 295
              (NormalSyntax))
    
    293 296
             (EpTok
    
    294 297
              (EpaSpan { T17544_kw.hs:17:3-7 }))
    
    295
    -        (EpTok (EpaSpan { <no location info> }))
    
    296
    -        (EpTok (EpaSpan { <no location info> }))
    
    298
    +        (AnnList
    
    299
    +         (AnnListLayout
    
    300
    +          (EpaSpan { T17544_kw.hs:17:9 }))
    
    301
    +         (ListNone)
    
    302
    +         [])
    
    297 303
             (EpTok
    
    298 304
              (EpaSpan { <no location info> })))
    
    299 305
            (Nothing)
    

  • testsuite/tests/haddock/should_compile_flag_haddock/T24221.stderr
    ... ... @@ -81,8 +81,10 @@
    81 81
              (NormalSyntax))
    
    82 82
             (EpTok
    
    83 83
              (EpaSpan { <no location info> }))
    
    84
    -        (EpTok (EpaSpan { <no location info> }))
    
    85
    -        (EpTok (EpaSpan { <no location info> }))
    
    84
    +        (AnnList
    
    85
    +         (AnnListNoLayout)
    
    86
    +         (ListNone)
    
    87
    +         [])
    
    86 88
             (EpTok
    
    87 89
              (EpaSpan { T24221.hs:5:3 })))
    
    88 90
            (Nothing)
    
    ... ... @@ -416,8 +418,10 @@
    416 418
              (NormalSyntax))
    
    417 419
             (EpTok
    
    418 420
              (EpaSpan { <no location info> }))
    
    419
    -        (EpTok (EpaSpan { <no location info> }))
    
    420
    -        (EpTok (EpaSpan { <no location info> }))
    
    421
    +        (AnnList
    
    422
    +         (AnnListNoLayout)
    
    423
    +         (ListNone)
    
    424
    +         [])
    
    421 425
             (EpTok
    
    422 426
              (EpaSpan { T24221.hs:11:11 })))
    
    423 427
            (Nothing)
    
    ... ... @@ -585,8 +589,10 @@
    585 589
              (NormalSyntax))
    
    586 590
             (EpTok
    
    587 591
              (EpaSpan { <no location info> }))
    
    588
    -        (EpTok (EpaSpan { <no location info> }))
    
    589
    -        (EpTok (EpaSpan { <no location info> }))
    
    592
    +        (AnnList
    
    593
    +         (AnnListNoLayout)
    
    594
    +         (ListNone)
    
    595
    +         [])
    
    590 596
             (EpTok
    
    591 597
              (EpaSpan { T24221.hs:14:11 })))
    
    592 598
            (Nothing)
    
    ... ... @@ -780,8 +786,10 @@
    780 786
              (NormalSyntax))
    
    781 787
             (EpTok
    
    782 788
              (EpaSpan { <no location info> }))
    
    783
    -        (EpTok (EpaSpan { <no location info> }))
    
    784
    -        (EpTok (EpaSpan { <no location info> }))
    
    789
    +        (AnnList
    
    790
    +         (AnnListNoLayout)
    
    791
    +         (ListNone)
    
    792
    +         [])
    
    785 793
             (EpTok
    
    786 794
              (EpaSpan { T24221.hs:19:11 })))
    
    787 795
            (Nothing)
    
    ... ... @@ -975,8 +983,10 @@
    975 983
              (NormalSyntax))
    
    976 984
             (EpTok
    
    977 985
              (EpaSpan { <no location info> }))
    
    978
    -        (EpTok (EpaSpan { <no location info> }))
    
    979
    -        (EpTok (EpaSpan { <no location info> }))
    
    986
    +        (AnnList
    
    987
    +         (AnnListNoLayout)
    
    988
    +         (ListNone)
    
    989
    +         [])
    
    980 990
             (EpTok
    
    981 991
              (EpaSpan { T24221.hs:27:11 })))
    
    982 992
            (Nothing)
    
    ... ... @@ -1217,8 +1227,10 @@
    1217 1227
              (NormalSyntax))
    
    1218 1228
             (EpTok
    
    1219 1229
              (EpaSpan { <no location info> }))
    
    1220
    -        (EpTok (EpaSpan { <no location info> }))
    
    1221
    -        (EpTok (EpaSpan { <no location info> }))
    
    1230
    +        (AnnList
    
    1231
    +         (AnnListNoLayout)
    
    1232
    +         (ListNone)
    
    1233
    +         [])
    
    1222 1234
             (EpTok
    
    1223 1235
              (EpaSpan { T24221.hs:31:11 })))
    
    1224 1236
            (Nothing)
    
    ... ... @@ -1472,8 +1484,10 @@
    1472 1484
              (NormalSyntax))
    
    1473 1485
             (EpTok
    
    1474 1486
              (EpaSpan { <no location info> }))
    
    1475
    -        (EpTok (EpaSpan { <no location info> }))
    
    1476
    -        (EpTok (EpaSpan { <no location info> }))
    
    1487
    +        (AnnList
    
    1488
    +         (AnnListNoLayout)
    
    1489
    +         (ListNone)
    
    1490
    +         [])
    
    1477 1491
             (EpTok
    
    1478 1492
              (EpaSpan { T24221.hs:36:11 })))
    
    1479 1493
            (Nothing)
    

  • testsuite/tests/parser/should_compile/DumpParsedAst.stderr
    ... ... @@ -119,8 +119,10 @@
    119 119
              (NormalSyntax))
    
    120 120
             (EpTok
    
    121 121
              (EpaSpan { <no location info> }))
    
    122
    -        (EpTok (EpaSpan { <no location info> }))
    
    123
    -        (EpTok (EpaSpan { <no location info> }))
    
    122
    +        (AnnList
    
    123
    +         (AnnListNoLayout)
    
    124
    +         (ListNone)
    
    125
    +         [])
    
    124 126
             (EpTok
    
    125 127
              (EpaSpan { DumpParsedAst.hs:7:12 })))
    
    126 128
            (Nothing)
    
    ... ... @@ -834,8 +836,10 @@
    834 836
              (NormalSyntax))
    
    835 837
             (EpTok
    
    836 838
              (EpaSpan { <no location info> }))
    
    837
    -        (EpTok (EpaSpan { <no location info> }))
    
    838
    -        (EpTok (EpaSpan { <no location info> }))
    
    839
    +        (AnnList
    
    840
    +         (AnnListNoLayout)
    
    841
    +         (ListNone)
    
    842
    +         [])
    
    839 843
             (EpTok
    
    840 844
              (EpaSpan { DumpParsedAst.hs:15:19 })))
    
    841 845
            (Nothing)
    
    ... ... @@ -1803,8 +1807,11 @@
    1803 1807
                (NormalSyntax))
    
    1804 1808
               (EpTok
    
    1805 1809
                (EpaSpan { DumpParsedAst.hs:22:62-66 }))
    
    1806
    -          (EpTok (EpaSpan { <no location info> }))
    
    1807
    -          (EpTok (EpaSpan { <no location info> }))
    
    1810
    +          (AnnList
    
    1811
    +           (AnnListLayout
    
    1812
    +            (EpaSpan { DumpParsedAst.hs:23:3 }))
    
    1813
    +           (ListNone)
    
    1814
    +           [])
    
    1808 1815
               (EpTok
    
    1809 1816
                (EpaSpan { <no location info> })))
    
    1810 1817
              (Nothing)
    

  • testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
    ... ... @@ -177,8 +177,10 @@
    177 177
                (NormalSyntax))
    
    178 178
               (EpTok
    
    179 179
                (EpaSpan { <no location info> }))
    
    180
    -          (EpTok (EpaSpan { <no location info> }))
    
    181
    -          (EpTok (EpaSpan { <no location info> }))
    
    180
    +          (AnnList
    
    181
    +           (AnnListNoLayout)
    
    182
    +           (ListNone)
    
    183
    +           [])
    
    182 184
               (EpTok
    
    183 185
                (EpaSpan { <no location info> })))
    
    184 186
              (Nothing)
    
    ... ... @@ -1037,8 +1039,10 @@
    1037 1039
                (NormalSyntax))
    
    1038 1040
               (EpTok
    
    1039 1041
                (EpaSpan { <no location info> }))
    
    1040
    -          (EpTok (EpaSpan { <no location info> }))
    
    1041
    -          (EpTok (EpaSpan { <no location info> }))
    
    1042
    +          (AnnList
    
    1043
    +           (AnnListNoLayout)
    
    1044
    +           (ListNone)
    
    1045
    +           [])
    
    1042 1046
               (EpTok
    
    1043 1047
                (EpaSpan { <no location info> })))
    
    1044 1048
              (Nothing)
    
    ... ... @@ -2311,8 +2315,10 @@
    2311 2315
                  (NormalSyntax))
    
    2312 2316
                 (EpTok
    
    2313 2317
                  (EpaSpan { <no location info> }))
    
    2314
    -            (EpTok (EpaSpan { <no location info> }))
    
    2315
    -            (EpTok (EpaSpan { <no location info> }))
    
    2318
    +            (AnnList
    
    2319
    +             (AnnListNoLayout)
    
    2320
    +             (ListNone)
    
    2321
    +             [])
    
    2316 2322
                 (EpTok
    
    2317 2323
                  (EpaSpan { <no location info> })))
    
    2318 2324
                (Nothing)
    

  • testsuite/tests/parser/should_compile/T14189.stderr
    ... ... @@ -53,8 +53,10 @@
    53 53
                (NormalSyntax))
    
    54 54
               (EpTok
    
    55 55
                (EpaSpan { <no location info> }))
    
    56
    -          (EpTok (EpaSpan { <no location info> }))
    
    57
    -          (EpTok (EpaSpan { <no location info> }))
    
    56
    +          (AnnList
    
    57
    +           (AnnListNoLayout)
    
    58
    +           (ListNone)
    
    59
    +           [])
    
    58 60
               (EpTok
    
    59 61
                (EpaSpan { <no location info> })))
    
    60 62
              (Nothing)
    

  • testsuite/tests/parser/should_compile/T15323.stderr
    ... ... @@ -110,8 +110,11 @@
    110 110
              (NormalSyntax))
    
    111 111
             (EpTok
    
    112 112
              (EpaSpan { T15323.hs:5:21-25 }))
    
    113
    -        (EpTok (EpaSpan { <no location info> }))
    
    114
    -        (EpTok (EpaSpan { <no location info> }))
    
    113
    +        (AnnList
    
    114
    +         (AnnListLayout
    
    115
    +          (EpaSpan { T15323.hs:6:5 }))
    
    116
    +         (ListNone)
    
    117
    +         [])
    
    115 118
             (EpTok
    
    116 119
              (EpaSpan { <no location info> })))
    
    117 120
            (Nothing)
    

  • testsuite/tests/parser/should_compile/T20452.stderr
    ... ... @@ -129,8 +129,10 @@
    129 129
              (NormalSyntax))
    
    130 130
             (EpTok
    
    131 131
              (EpaSpan { <no location info> }))
    
    132
    -        (EpTok (EpaSpan { <no location info> }))
    
    133
    -        (EpTok (EpaSpan { <no location info> }))
    
    132
    +        (AnnList
    
    133
    +         (AnnListNoLayout)
    
    134
    +         (ListNone)
    
    135
    +         [])
    
    134 136
             (EpTok
    
    135 137
              (EpaSpan { T20452.hs:5:24 })))
    
    136 138
            (Nothing)
    
    ... ... @@ -260,8 +262,10 @@
    260 262
              (NormalSyntax))
    
    261 263
             (EpTok
    
    262 264
              (EpaSpan { <no location info> }))
    
    263
    -        (EpTok (EpaSpan { <no location info> }))
    
    264
    -        (EpTok (EpaSpan { <no location info> }))
    
    265
    +        (AnnList
    
    266
    +         (AnnListNoLayout)
    
    267
    +         (ListNone)
    
    268
    +         [])
    
    265 269
             (EpTok
    
    266 270
              (EpaSpan { T20452.hs:6:24 })))
    
    267 271
            (Nothing)
    

  • testsuite/tests/printer/T18791.stderr
    ... ... @@ -81,8 +81,11 @@
    81 81
              (NormalSyntax))
    
    82 82
             (EpTok
    
    83 83
              (EpaSpan { T18791.hs:4:8-12 }))
    
    84
    -        (EpTok (EpaSpan { <no location info> }))
    
    85
    -        (EpTok (EpaSpan { <no location info> }))
    
    84
    +        (AnnList
    
    85
    +         (AnnListLayout
    
    86
    +          (EpaSpan { T18791.hs:5:3 }))
    
    87
    +         (ListNone)
    
    88
    +         [])
    
    86 89
             (EpTok
    
    87 90
              (EpaSpan { <no location info> })))
    
    88 91
            (Nothing)
    

  • utils/check-exact/ExactPrint.hs
    ... ... @@ -3896,7 +3896,7 @@ exactDataDefn
    3896 3896
       -> EP w m ( r -- ^ from exactHdr
    
    3897 3897
                 , LocatedN RdrName, a, b, HsDataDefn GhcPs)
    
    3898 3898
     exactDataDefn exactHdr
    
    3899
    -                 (HsDataDefn { dd_ext = AnnDataDefn ops cps t nt d i dc w oc cc eq
    
    3899
    +                 (HsDataDefn { dd_ext = AnnDataDefn ops cps t nt d i dc w al eq
    
    3900 3900
                                  , dd_ctxt = context
    
    3901 3901
                                  , dd_cType = mb_ct
    
    3902 3902
                                  , dd_kindSig = mb_sig
    
    ... ... @@ -3929,17 +3929,15 @@ exactDataDefn exactHdr
    3929 3929
       w' <- if (needsWhere condecls)
    
    3930 3930
         then markEpToken w
    
    3931 3931
         else return w
    
    3932
    -  oc' <- markEpToken oc
    
    3933
    -  (eq', condecls') <- exact_condecls eq (toList condecls)
    
    3932
    +  (eq', al', condecls') <- exact_condecls eq al (toList condecls)
    
    3934 3933
       let condecls'' = case condecls of
    
    3935 3934
             DataTypeCons td _ -> DataTypeCons td condecls'
    
    3936 3935
             NewTypeCon _     -> case condecls' of
    
    3937 3936
               [decl] -> NewTypeCon decl
    
    3938 3937
               _ -> panic "exacprint NewTypeCon"
    
    3939
    -  cc' <- markEpToken cc
    
    3940 3938
       derivings' <- mapM markAnnotated derivings
    
    3941 3939
       return (anx, ln', tvs', b,
    
    3942
    -                 (HsDataDefn { dd_ext = AnnDataDefn [] [] t' nt' d' i' dc' w' oc' cc' eq'
    
    3940
    +                 (HsDataDefn { dd_ext = AnnDataDefn [] [] t' nt' d' i' dc' w' al' eq'
    
    3943 3941
                                  , dd_ctxt = mctxt'
    
    3944 3942
                                  , dd_cType = mb_ct'
    
    3945 3943
                                  , dd_kindSig = mb_sig'
    
    ... ... @@ -4380,17 +4378,19 @@ markTrailing ts = do
    4380 4378
     
    
    4381 4379
     -- based on pp_condecls in Decls.hs
    
    4382 4380
     exact_condecls :: (Monad m, Monoid w)
    
    4383
    -  => EpToken "=" -> [LConDecl GhcPs] -> EP w m (EpToken "=",[LConDecl GhcPs])
    
    4384
    -exact_condecls eq cs
    
    4381
    +  => EpToken "=" -> AnnList
    
    4382
    +  -> [LConDecl GhcPs]
    
    4383
    +  -> EP w m (EpToken "=", AnnList, [LConDecl GhcPs])
    
    4384
    +exact_condecls eq al cs
    
    4385 4385
       | gadt_syntax                  -- In GADT syntax
    
    4386 4386
       = do
    
    4387
    -      cs' <- mapM markAnnotated cs
    
    4388
    -      return (eq, cs')
    
    4387
    +      (al',cs') <- markAnnListA' al $ setLayoutBoth $ mapM markAnnotated cs
    
    4388
    +      return (eq, al', cs')
    
    4389 4389
       | otherwise                    -- In H98 syntax
    
    4390 4390
       = do
    
    4391 4391
           eq0 <- markEpToken eq
    
    4392 4392
           cs' <- mapM markAnnotated cs
    
    4393
    -      return (eq0, cs')
    
    4393
    +      return (eq0, al, cs')
    
    4394 4394
       where
    
    4395 4395
         gadt_syntax = case cs of
    
    4396 4396
           []                      -> False