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,
|
removeDirectoryRecursive,
|
||||||
setCurrentDirectory)
|
setCurrentDirectory)
|
||||||
import System.Environment (getArgs)
|
import System.Environment (getArgs)
|
||||||
import System.Exit (exitFailure, exitSuccess)
|
import System.Exit (ExitCode, exitFailure,
|
||||||
|
exitSuccess)
|
||||||
import System.IO (stderr)
|
import System.IO (stderr)
|
||||||
import System.Process.Extra (spawnCommand, waitForProcess)
|
import System.Process.Extra (readCreateProcess, shell,
|
||||||
|
spawnCommand, waitForProcess)
|
||||||
import TypeChecker.TypeChecker (typecheck)
|
import TypeChecker.TypeChecker (typecheck)
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
|
|
@ -65,6 +67,7 @@ main' debug s = do
|
||||||
debugDotViz
|
debugDotViz
|
||||||
|
|
||||||
compile generatedCode
|
compile generatedCode
|
||||||
|
spawnWait "./hello_world"
|
||||||
-- interpred <- fromInterpreterErr $ interpret lifted
|
-- interpred <- fromInterpreterErr $ interpret lifted
|
||||||
-- putStrLn "\n-- interpret"
|
-- putStrLn "\n-- interpret"
|
||||||
-- print interpred
|
-- print interpred
|
||||||
|
|
@ -80,8 +83,9 @@ debugDotViz = do
|
||||||
mapM_ spawnWait commands
|
mapM_ spawnWait commands
|
||||||
setCurrentDirectory ".."
|
setCurrentDirectory ".."
|
||||||
return ()
|
return ()
|
||||||
where
|
|
||||||
spawnWait s = spawnCommand s >>= waitForProcess
|
spawnWait :: String -> IO ExitCode
|
||||||
|
spawnWait s = spawnCommand s >>= waitForProcess
|
||||||
printToErr :: String -> IO ()
|
printToErr :: String -> IO ()
|
||||||
printToErr = hPutStrLn stderr
|
printToErr = hPutStrLn stderr
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue