on master help sign in
Make compiler filename warning use output commands
e8aca59David Raymond Christiansen
src/Idris/REPL.hs+8−8
@@ -1049,14 +1049,14 @@ process fn Execute
1049 (\e -> getIState >>= iRenderError . flip pprintErr e)
1049 (\e -> getIState >>= iRenderError . flip pprintErr e)
1050 where fc = fileFC "main"
1050 where fc = fileFC "main"
1051process fn (Compile codegen f)
1051process fn (Compile codegen f)
1052− = if map toLower (takeExtension f) `elem` [".idr", ".idc"]
1052+ | map toLower (takeExtension f) `elem` [".idr", ".lidr", ".idc"] =
1053− then runIO $ putStrLn ("Will not compile to " ++ f)
1053+ iPrintError $ "Invalid filename for compiler output \"" ++ f ++"\""
1054− else do (m, _) <- elabVal recinfo ERHS
1054+ | otherwise = do (m, _) <- elabVal recinfo ERHS
1055− (PApp fc (PRef fc (sUN "run__IO"))
1055+ (PApp fc (PRef fc (sUN "run__IO"))
1056− [pexp $ PRef fc (sNS (sUN "main") ["Main"])])
1056+ [pexp $ PRef fc (sNS (sUN "main") ["Main"])])
1057− ir <- compile codegen f m
1057+ ir <- compile codegen f m
1058− i <- getIState
1058+ i <- getIState
1059− runIO $ generate codegen (head (idris_imported i)) ir
1059+ runIO $ generate codegen (head (idris_imported i)) ir
1060 where fc = fileFC "main"
1060 where fc = fileFC "main"
1061process fn (LogLvl i) = setLogLevel i
1061process fn (LogLvl i) = setLogLevel i
1062-- Elaborate as if LHS of a pattern (debug command)
1062-- Elaborate as if LHS of a pattern (debug command)