Commit 1f03214c authored by sof's avatar sof
Browse files

[project @ 1999-09-16 17:09:54 by sof]

minor readIface tidyup
parent 5ea409b8
...@@ -66,6 +66,7 @@ import Outputable ...@@ -66,6 +66,7 @@ import Outputable
import Unique ( Unique ) import Unique ( Unique )
import StringBuffer ( StringBuffer, hGetStringBuffer ) import StringBuffer ( StringBuffer, hGetStringBuffer )
import FastString ( mkFastString ) import FastString ( mkFastString )
import ErrUtils ( Message )
import Lex import Lex
import Outputable import Outputable
...@@ -936,12 +937,8 @@ readIface the_mod file_path ...@@ -936,12 +937,8 @@ readIface the_mod file_path
PFailed err -> failWithRn Nothing err PFailed err -> failWithRn Nothing err
POk _ (PIface mod_nm iface) -> POk _ (PIface mod_nm iface) ->
warnCheckRn (mod_nm == moduleName the_mod) warnCheckRn (mod_nm == moduleName the_mod)
(hsep [ ptext SLIT("Something is amiss; requested module name") (hiModuleNameMismatchWarn the_mod mod_nm) `thenRn_`
, pprModule the_mod returnRn (Just (the_mod, iface))
, ptext SLIT("differs from name found in the interface file ")
, pprModuleName mod_nm
])
`thenRn_` returnRn (Just (the_mod, iface))
Left err Left err
| isDoesNotExistError err -> returnRn Nothing | isDoesNotExistError err -> returnRn Nothing
...@@ -986,4 +983,13 @@ importDeclWarn name ...@@ -986,4 +983,13 @@ importDeclWarn name
warnRedundantSourceImport mod_name warnRedundantSourceImport mod_name
= ptext SLIT("Unnecessary {- SOURCE -} in the import of module") = ptext SLIT("Unnecessary {- SOURCE -} in the import of module")
<+> quotes (pprModuleName mod_name) <+> quotes (pprModuleName mod_name)
hiModuleNameMismatchWarn :: Module -> ModuleName -> Message
hiModuleNameMismatchWarn requested_mod mod_nm =
hsep [ ptext SLIT("Something is amiss; requested module name")
, pprModule requested_mod
, ptext SLIT("differs from name found in the interface file ")
, pprModuleName mod_nm
]
\end{code} \end{code}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment