X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Frename%2FRnIfaces.lhs;h=deff6b7ea554155a30bc33d024e9ad9b4f989bb5;hb=904f158f9fe208b8154029dff655a6eab4b2828e;hp=ddf4e4ef242d1341d66ff87b2f30bbc8f92bc930;hpb=6ee2f67e582427f931c21c1fc58f62f8619d40b7;p=ghc-hetmet.git diff --git a/ghc/compiler/rename/RnIfaces.lhs b/ghc/compiler/rename/RnIfaces.lhs index ddf4e4e..deff6b7 100644 --- a/ghc/compiler/rename/RnIfaces.lhs +++ b/ghc/compiler/rename/RnIfaces.lhs @@ -64,6 +64,7 @@ import Outputable import Unique ( Unique ) import StringBuffer ( StringBuffer, hGetStringBuffer ) import FastString ( mkFastString ) +import Lex import Outputable import IO ( isDoesNotExistError ) @@ -868,12 +869,16 @@ readIface :: Module -> String -> RnM d (Maybe (Module, ParsedIface)) -- Nothing <=> file not found, or unreadable, or illegible -- Just x <=> successfully found and parsed readIface the_mod file_path - = ioToRnM (hGetStringBuffer file_path) `thenRn` \ read_result -> + = ioToRnM (hGetStringBuffer False file_path) `thenRn` \ read_result -> case read_result of Right contents -> - case parseIface contents (mkSrcLoc (mkFastString file_path) 1) of - Failed err -> failWithRn Nothing err - Succeeded (PIface mod_nm iface) -> + case parseIface contents + PState{ bol = 0#, atbol = 1#, + context = [], + glasgow_exts = 1#, + loc = mkSrcLoc (mkFastString file_path) 1 } of + PFailed err -> failWithRn Nothing err + POk _ (PIface mod_nm iface) -> warnCheckRn (mod_nm == moduleName the_mod) (hsep [ ptext SLIT("Something is amiss; requested module name") , pprModule the_mod