From a5457a8da1118b2a6c48ba892f5b28c8c39b9265 Mon Sep 17 00:00:00 2001 From: sof Date: Fri, 25 Jul 1997 22:32:48 +0000 Subject: [PATCH] [project @ 1997-07-25 22:32:48 by sof] dump diffs into interface file if -keep-hi-diffs set --- ghc/driver/ghc-iface.lprl | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/ghc/driver/ghc-iface.lprl b/ghc/driver/ghc-iface.lprl index ffc15b9..fe61f69 100644 --- a/ghc/driver/ghc-iface.lprl +++ b/ghc/driver/ghc-iface.lprl @@ -194,6 +194,8 @@ sub readHiFile { } elsif ( $now_in =~ /^(exports|instance_modules|instances|fixities)$/ ) { $Stuff{"$mod:$1"} .= $_; # just save it up + } elsif ( /^--.*/ ) { # silently ignore comment lines. + ; } elsif ( $now_in eq 'declarations' ) { # relatively special treatment needed... # We're in a declaration @@ -235,8 +237,6 @@ sub readHiFile { $Decl{"$mod:$current_name"} .= $_ } - } elsif ( /^--.*/ ) { # silently ignore comment lines. - ; } else { print STDERR "$Pgm:junk old iface line?:section:$now_in:$_"; } @@ -290,20 +290,23 @@ sub mv_change { sub printNewItemVersion { local($hifile, $item, $mod_version, $show_hi_diffs) = @_; local($idecl) = $Decl{"new:$item"}; + if (! defined($Decl{"old:$item"})) { # Old decl doesn't exist if ($show_hi_diffs) {print STDERR "new: $item\n";} print $hifile "$mod_version "; # Use module version - } elsif ($idecl ne $Decl{"old:$item"}) { # Old decl differs from new decl - local($odecl) = $Decl{"old:$item"}; - if ($show_hi_diffs) {print STDERR "changed: $item\nOld: $odeclNew: $idecl";} - print $hifile "$mod_version "; # Use module version - } elsif (! defined($OldVersion{"$item"}) ) { if ($show_hi_diffs) {print STDERR "$item: no old version?!\n";} print $hifile "$mod_version "; # Use module version + } elsif ($idecl ne $Decl{"old:$item"}) { # Old decl differs from new decl + local($odecl) = $Decl{"old:$item"}; + if ($show_hi_diffs) {print STDERR "changed: $item\nOld: $odeclNew: $idecl";} + print $hifile "--old: ", $OldVersion{"$item"}, " $odecl" + if $Keep_HiDiffs; # show old in interface file + print $hifile "$mod_version "; # Use module version + } else { # Identical decls, so use old version number if ($show_hi_diffs) {print STDERR "$item: unchanged\n";} print $hifile $OldVersion{"$item"}, " "; -- 1.7.10.4