Ticket #43: haddock-gadt.diff

File haddock-gadt.diff, 2.8 kB (added by nwf, 2 years ago)
  • compiler/hsSyn/HsDecls.lhs

    diff --git a/compiler/hsSyn/HsDecls.lhs b/compiler/hsSyn/HsDecls.lhs
    index bac9ec6..aaf627c 100644
    a b  
    789789 
    790790pprConDecl (ConDecl { con_name = con, con_explicit = expl, con_qvars = tvs 
    791791                    , con_cxt = cxt, con_details = PrefixCon arg_tys 
    792                     , con_res = ResTyGADT res_ty }) 
    793   = ppr con <+> dcolon <+>  
     792                    , con_res = ResTyGADT res_ty, con_doc = doc }) 
     793  = maybe empty ppr doc <+> ppr con <+> dcolon <+>  
    794794    sep [pprHsForAll expl tvs cxt, ppr (foldr mk_fun_ty res_ty arg_tys)] 
    795795  where 
    796796    mk_fun_ty a b = noLoc (HsFunTy a b) 
  • compiler/parser/Parser.y.pp

    diff --git a/compiler/parser/Parser.y.pp b/compiler/parser/Parser.y.pp
    index a4c08c1..937863c 100644
    a b  
    11911191-- Datatype declarations 
    11921192 
    11931193gadt_constrlist :: { Located [LConDecl RdrName] }       -- Returned in order 
    1194         : 'where' '{'        gadt_constrs '}'      { L (comb2 $1 $3) (unLoc $3) } 
    1195         | 'where' vocurly    gadt_constrs close    { L (comb2 $1 $3) (unLoc $3) } 
     1194        : 'where' '{'        maybe_docnext gadt_constrs '}' 
     1195          { L (comb2 $1 $5) (addConDocFirst (unLoc $4) $3) } 
     1196        | 'where' vocurly    maybe_docnext optSemi gadt_constrs close 
     1197          { L (comb2 $1 $5) (addConDocFirst (unLoc $5) $3) } 
    11961198        | {- empty -}                              { noLoc [] } 
    11971199 
    11981200gadt_constrs :: { Located [LConDecl RdrName] } 
    1199         : gadt_constr ';' gadt_constrs  { L (comb2 (head $1) $3) ($1 ++ unLoc $3) } 
    1200         | gadt_constr                   { L (getLoc (head $1)) $1 } 
     1201        : gadt_constr ';' maybe_docprev optSemi maybe_docnext optSemi gadt_constrs  
     1202             { L (comb2 (head $1) $7) (addConDocs $1 $3 ++ addConDocFirst (unLoc $7) $5) } 
     1203        | gadt_constr maybe_docprev     { L (getLoc (head $1)) $ addConDocFirst $1 $2 } 
    12011204        | {- empty -}                   { noLoc [] } 
    12021205 
    12031206-- We allow the following forms: 
  • rules/hs-suffix-rules-srcdir.mk

    diff --git a/rules/hs-suffix-rules-srcdir.mk b/rules/hs-suffix-rules-srcdir.mk
    index b39b41a..50558f4 100644
    a b  
    2121ifneq "$$(BootingFromHc)" "YES" 
    2222 
    2323$1/$2/build/%.hs : $1/$4/%.ly | $$$$(dir $$$$@)/. 
    24         $$(call cmd,HAPPY) $$($1_$2_$3_ALL_HAPPY_OPTS) $$< -o $$@ 
     24        $$(call cmd,HAPPY) $$($1_$2_$3_ALL_HAPPY_OPTS) $$< -o $$@ --info=$$@.i 
    2525 
    2626$1/$2/build/%.hs : $1/$4/%.y | $$$$(dir $$$$@)/. 
    27         $$(call cmd,HAPPY) $$($1_$2_$3_ALL_HAPPY_OPTS) $$< -o $$@ 
     27        $$(call cmd,HAPPY) $$($1_$2_$3_ALL_HAPPY_OPTS) $$< -o $$@ --info=$$@.i 
    2828 
    2929$1/$2/build/%.hs : $1/$4/%.x | $$$$(dir $$$$@)/. 
    3030        $$(call cmd,ALEX) $$($1_$2_$3_ALL_ALEX_OPTS) $$< -o $$@