on master help sign in
Make compiler filename warning use output commands
commite8aca59e9449375b986edafe1a68354ac1f2d5b9 authorDavid Raymond Christiansen <david@davidchristiansen.dk> dateWed 24 Sep 2014, 10:56 (12 years ago) parentf97784d
1 file changed+8−8
src/Idris/REPL.hs+8−8
src/Idris/REPL.hs+8−8
@@ -1049,14 +1049,14 @@ process fn Execute
10491049 (\e -> getIState >>= iRenderError . flip pprintErr e)
10501050 where fc = fileFC "main"
10511051process fn (Compile codegen f)
1052− = if map toLower (takeExtension f) `elem` [".idr", ".idc"]
1053− then runIO $ putStrLn ("Will not compile to " ++ f)
1054− else do (m, _) <- elabVal recinfo ERHS
1055− (PApp fc (PRef fc (sUN "run__IO"))
1056− [pexp $ PRef fc (sNS (sUN "main") ["Main"])])
1057− ir <- compile codegen f m
1058− i <- getIState
1059− runIO $ generate codegen (head (idris_imported i)) ir
1052+ | map toLower (takeExtension f) `elem` [".idr", ".lidr", ".idc"] =
1053+ iPrintError $ "Invalid filename for compiler output \"" ++ f ++"\""
1054+ | otherwise = do (m, _) <- elabVal recinfo ERHS
1055+ (PApp fc (PRef fc (sUN "run__IO"))
1056+ [pexp $ PRef fc (sNS (sUN "main") ["Main"])])
1057+ ir <- compile codegen f m
1058+ i <- getIState
1059+ runIO $ generate codegen (head (idris_imported i)) ir
10601060 where fc = fileFC "main"
10611061process fn (LogLvl i) = setLogLevel i
10621062-- Elaborate as if LHS of a pattern (debug command)