From d68b9e0496508212ba107d1ad1d4720189a8da84 Mon Sep 17 00:00:00 2001
From: sof <unknown>
Date: Tue, 3 Jun 1997 16:17:59 +0000
Subject: [PATCH] [project @ 1997-06-03 16:17:59 by sof] regexes for class
 fixed up

---
 ghc/driver/ghc-iface.lprl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ghc/driver/ghc-iface.lprl b/ghc/driver/ghc-iface.lprl
index aafcdafc2bc8..8144c8a66fa7 100644
--- a/ghc/driver/ghc-iface.lprl
+++ b/ghc/driver/ghc-iface.lprl
@@ -223,8 +223,10 @@ sub readHiFile {
 		$Decl{"$mod:$current_name"} = $_;
 	        if ($mod eq "old") { $OldVersion{$current_name} = $version; }
 
-	    } elsif ( /^class\s+(.*\s+=>\s+)?(\S+)\s+.*where\s+\{.*\}/ ) {
+	    } elsif ( /^class\s+(\{[^{}]*\}\s+=>\s+)?(\S+)\s+/ ) {
 		# must be wary of => bit matching after "where"...
+		# ..hence the [^{}] part
+		# NB: a class decl may not have a where part at all
 		$current_name = $2;
 		$Decl{"$mod:$current_name"} = $_;
 	        if ($mod eq "old") { $OldVersion{$current_name} = $version; }
-- 
GitLab