summaryrefslogtreecommitdiff
path: root/compiler/main/HeaderInfo.hs
diff options
context:
space:
mode:
authorMax Bolingbroke <batterseapower@hotmail.com>2010-04-13 19:28:25 +0000
committerMax Bolingbroke <batterseapower@hotmail.com>2010-04-13 19:28:25 +0000
commit00022894bbb2dfa33fd213eedbac0f28b4c4b7b4 (patch)
tree849a53c55d4a0071059bd100b205bf5b558089b0 /compiler/main/HeaderInfo.hs
parent5e5018b65d98a090f069f3b861f30ffe3c196fd5 (diff)
downloadhaskell-00022894bbb2dfa33fd213eedbac0f28b4c4b7b4.tar.gz
Spelling correction for LANGUAGE pragmas
Diffstat (limited to 'compiler/main/HeaderInfo.hs')
-rw-r--r--compiler/main/HeaderInfo.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/main/HeaderInfo.hs b/compiler/main/HeaderInfo.hs
index e16c2ce562..b520098a28 100644
--- a/compiler/main/HeaderInfo.hs
+++ b/compiler/main/HeaderInfo.hs
@@ -264,7 +264,6 @@ checkExtension (L l ext)
-- its corresponding flag. Otherwise it throws an exception.
= let ext' = unpackFS ext in
if ext' `elem` supportedLanguages
- || ext' `elem` (map ("No"++) supportedLanguages)
then L l ("-X"++ext')
else unsupportedExtnError l ext'
@@ -281,7 +280,9 @@ unsupportedExtnError :: SrcSpan -> String -> a
unsupportedExtnError loc unsup =
throw $ mkSrcErr $ unitBag $
mkPlainErrMsg loc $
- text "Unsupported extension: " <> text unsup
+ text "Unsupported extension: " <> text unsup $$
+ if null suggestions then empty else text "Perhaps you meant" <+> quotedListWithOr (map text suggestions)
+ where suggestions = fuzzyMatch unsup supportedLanguages
optionsErrorMsgs :: [String] -> [Located String] -> FilePath -> Messages