on master help sign in
Merge pull request #314 from jsl/304_print_program_fix

Remove the --print-program option

commitb89694116f246162db27d40a71106125afbfcdec authorEvan Czaplicki <info@elm-lang.org> dateWed 30 Oct 2013, 13:43 (13 years ago) parent9235464006e086
1 file changed+4−11
compiler/Compiler.hs+4−11
compiler/Compiler.hs+4−11
@@ -37,7 +37,6 @@ data Flags =
3737 , runtime :: Maybe FilePath
3838 , only_js :: Bool
3939 , print_types :: Bool
40− , print_program :: Bool
4140 , scripts :: [FilePath]
4241 , no_prelude :: Bool
4342 , cache_dir :: FilePath
@@ -66,14 +65,12 @@ flags = Flags
6665 &= help "Additional source directories besides project root. Searched when using --make"
6766 , print_types = False
6867 &= help "Print out infered types of top-level definitions."
69− , print_program = False
70− &= help "Print out an internal representation of a program."
7168 } &= help "Compile Elm programs to HTML, CSS, and JavaScript."
7269 &= helpArg [explicit, name "help", name "h"]
7370 &= versionArg [explicit, name "version", name "v", summary (showVersion version)]
7471 &= summary ("The Elm Compiler " ++ showVersion version ++ ", (c) Evan Czaplicki 2011-2013")
7572
76−main :: IO ()
73+main :: IO ()
7774main = do setNumCapabilities =<< getNumProcessors
7875 compileArgs =<< cmdArgs flags
7976
@@ -82,7 +79,7 @@ compileArgs flags =
8279 case files flags of
8380 [] -> putStrLn "Usage: elm [OPTIONS] [FILES]\nFor more help: elm --help"
8481 fs -> mapM_ (build flags) fs
85−
82+
8683
8784buildPath :: Flags -> FilePath -> String -> FilePath
8885buildPath flags filePath ext = build_dir flags </> replaceExtension filePath ext
@@ -140,7 +137,7 @@ buildFile flags moduleNum numModules interfaces filePath =
140137 putStrLn $ concat [ number, " Compiling ", name
141138 , replicate (max 1 (20 - length name)) ' '
142139 , "( " ++ filePath ++ " )" ]
143−
140+
144141 createDirectoryIfMissing True (cache_dir flags)
145142 createDirectoryIfMissing True (build_dir flags)
146143 metaModule <-
@@ -148,11 +145,7 @@ buildFile flags moduleNum numModules interfaces filePath =
148145 Left errors -> do
149146 mapM print (List.intersperse (P.text " ") errors)
150147 exitFailure
151− Right modul -> do
152− case print_program flags of
153− False -> return ()
154− True -> print . pretty $ program modul
155− return modul
148+ Right modul -> return modul
156149
157150 when (print_types flags)
158151 (printTypes interfaces