Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fail with error on unrecognized language pragmas #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Refact/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ filterFilename = do
parseModuleWithArgs :: [String] -> FilePath -> IO (Either (SrcSpan, String) (Anns, GHC.ParsedSource))
parseModuleWithArgs ghcArgs fp = EP.ghcWrapper $ do
dflags1 <- EP.initDynFlags fp
(dflags2, _, _) <- GHC.parseDynamicFlagsCmdLine dflags1 (map GHC.noLoc ghcArgs)
(dflags2, unusedArgs, _) <- GHC.parseDynamicFlagsCmdLine dflags1 (map GHC.noLoc ghcArgs)
liftIO $ unless (null unusedArgs)
(fail ("Unrecognized GHC args: " ++ intercalate ", " (map GHC.unLoc unusedArgs)))
_ <- GHC.setSessionDynFlags dflags2
res <- EP.parseModuleApiAnnsWithCppInternal EP.defaultCppOptions dflags2 fp
return $ EP.postParseTransform res rigidLayout
Expand Down