From 8486d65e1c0f5fce799748eaf3d945baabfff5ed Mon Sep 17 00:00:00 2001 From: panne Date: Mon, 21 Feb 2000 19:06:11 +0000 Subject: [PATCH] [project @ 2000-02-21 19:06:11 by panne] Extended interface mangler with deprecations handling. NOTE: Whoever wrote this part of the driver without adding a HUGE warning in MkIface.lhs to keep both files in synch deserves the most severe punishment imaginable (huge stick, etc.)! >:-( The seemingly magical random rearrangement of the interface file outside Haskell's realm can drive you mad if you forget this... --- ghc/driver/ghc-iface.lprl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ghc/driver/ghc-iface.lprl b/ghc/driver/ghc-iface.lprl index a208af5..80ce281 100644 --- a/ghc/driver/ghc-iface.lprl +++ b/ghc/driver/ghc-iface.lprl @@ -163,6 +163,7 @@ sub constructNewHiFile { print NEWHI $Decl{"new:$v"}; # Print the new decl itself } print NEWHI $Stuff{'new:rules'} unless $Stuff{'new:rules'} eq ''; + print NEWHI $Stuff{'new:deprecations'} unless $Stuff{'new:deprecations'} eq ''; close(NEWHI) || &tidy_up_and_die(1,"Failed writing to $new_hi\n"); } @@ -198,6 +199,7 @@ sub readHiFile { $Stuff{"$mod:instances"} = ''; $Stuff{"$mod:declarations"} = ''; $Stuff{"$mod:rules"} = ''; + $Stuff{"$mod:deprecations"} = ''; if (! -f $hifile) { # no pre-existing .hi file $HiExists{$mod} = 0; @@ -232,6 +234,9 @@ sub readHiFile { } elsif ( /^{-## __R / ) { $Stuff{"$mod:rules"} .= $_; + } elsif ( /^{-## __D / ) { + $Stuff{"$mod:deprecations"} .= $_; + } elsif ( /^-[-]+ .*/ ) { # silently ignore comment lines. ; } else { # We're in a declaration @@ -314,7 +319,7 @@ sub calcNewModuleVersion { return(&mv_change($changed_version, "orphan-hood changed")); } - foreach $t ( 'usages' , 'exports', 'instances', 'fixities', 'rules' ) { + foreach $t ( 'usages' , 'exports', 'instances', 'fixities', 'rules', 'deprecations' ) { return(&mv_change($changed_version,"$t changed")) if $Stuff{"old:$t"} ne $Stuff{"new:$t"}; } -- 1.7.10.4