The compiler now also runs the outputed program.
This commit is contained in:
parent
b08ae7aef1
commit
3e31fe0ea5
1 changed files with 8 additions and 4 deletions
12
src/Main.hs
12
src/Main.hs
|
|
@ -21,9 +21,11 @@ import System.Directory (createDirectory, doesPathExist,
|
|||
removeDirectoryRecursive,
|
||||
setCurrentDirectory)
|
||||
import System.Environment (getArgs)
|
||||
import System.Exit (exitFailure, exitSuccess)
|
||||
import System.Exit (ExitCode, exitFailure,
|
||||
exitSuccess)
|
||||
import System.IO (stderr)
|
||||
import System.Process.Extra (spawnCommand, waitForProcess)
|
||||
import System.Process.Extra (readCreateProcess, shell,
|
||||
spawnCommand, waitForProcess)
|
||||
import TypeChecker.TypeChecker (typecheck)
|
||||
|
||||
main :: IO ()
|
||||
|
|
@ -65,6 +67,7 @@ main' debug s = do
|
|||
debugDotViz
|
||||
|
||||
compile generatedCode
|
||||
spawnWait "./hello_world"
|
||||
-- interpred <- fromInterpreterErr $ interpret lifted
|
||||
-- putStrLn "\n-- interpret"
|
||||
-- print interpred
|
||||
|
|
@ -80,8 +83,9 @@ debugDotViz = do
|
|||
mapM_ spawnWait commands
|
||||
setCurrentDirectory ".."
|
||||
return ()
|
||||
where
|
||||
spawnWait s = spawnCommand s >>= waitForProcess
|
||||
|
||||
spawnWait :: String -> IO ExitCode
|
||||
spawnWait s = spawnCommand s >>= waitForProcess
|
||||
printToErr :: String -> IO ()
|
||||
printToErr = hPutStrLn stderr
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue