Fixed a broken path.
This commit is contained in:
parent
4809cad1cb
commit
92a2ff3235
1 changed files with 32 additions and 41 deletions
73
src/Main.hs
73
src/Main.hs
|
|
@ -2,43 +2,34 @@
|
||||||
|
|
||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import Codegen.Codegen (generateCode)
|
import Codegen.Codegen (generateCode)
|
||||||
import Compiler (compile)
|
import Compiler (compile)
|
||||||
import Control.Monad (when)
|
import Control.Monad (when)
|
||||||
import Data.Bool (bool)
|
import Data.Bool (bool)
|
||||||
import Data.List.Extra (isSuffixOf)
|
import Data.List.Extra (isSuffixOf)
|
||||||
import Data.Maybe (fromJust, isNothing)
|
import Data.Maybe (fromJust, isNothing)
|
||||||
import GHC.IO.Handle.Text (hPutStrLn)
|
import GHC.IO.Handle.Text (hPutStrLn)
|
||||||
import Grammar.ErrM (Err)
|
import Grammar.ErrM (Err)
|
||||||
import Grammar.Par (myLexer, pProgram)
|
import Grammar.Par (myLexer, pProgram)
|
||||||
import Grammar.Print (printTree)
|
import Grammar.Print (printTree)
|
||||||
import LambdaLifter (lambdaLift)
|
import LambdaLifter (lambdaLift)
|
||||||
import Monomorphizer.Monomorphizer (monomorphize)
|
import Monomorphizer.Monomorphizer (monomorphize)
|
||||||
import Renamer.Renamer (rename)
|
import Renamer.Renamer (rename)
|
||||||
import System.Console.GetOpt (
|
import System.Console.GetOpt (ArgDescr (NoArg, ReqArg),
|
||||||
ArgDescr (NoArg, ReqArg),
|
ArgOrder (RequireOrder),
|
||||||
ArgOrder (RequireOrder),
|
OptDescr (Option), getOpt,
|
||||||
OptDescr (Option),
|
usageInfo)
|
||||||
getOpt,
|
import System.Directory (createDirectory, doesPathExist,
|
||||||
usageInfo,
|
getDirectoryContents,
|
||||||
)
|
removeDirectoryRecursive,
|
||||||
import System.Directory (
|
setCurrentDirectory)
|
||||||
createDirectory,
|
import System.Environment (getArgs)
|
||||||
doesPathExist,
|
import System.Exit (ExitCode (ExitFailure),
|
||||||
getDirectoryContents,
|
exitFailure, exitSuccess,
|
||||||
removeDirectoryRecursive,
|
exitWith)
|
||||||
setCurrentDirectory,
|
import System.IO (stderr)
|
||||||
)
|
import System.Process (spawnCommand, waitForProcess)
|
||||||
import System.Environment (getArgs)
|
import TypeChecker.TypeChecker (TypeChecker (Bi, Hm), typecheck)
|
||||||
import System.Exit (
|
|
||||||
ExitCode (ExitFailure),
|
|
||||||
exitFailure,
|
|
||||||
exitSuccess,
|
|
||||||
exitWith,
|
|
||||||
)
|
|
||||||
import System.IO (stderr)
|
|
||||||
import System.Process (spawnCommand, waitForProcess)
|
|
||||||
import TypeChecker.TypeChecker (TypeChecker (Bi, Hm), typecheck)
|
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = getArgs >>= parseArgs >>= uncurry main'
|
main = getArgs >>= parseArgs >>= uncurry main'
|
||||||
|
|
@ -85,11 +76,11 @@ chooseTypechecker s options = options{typechecker = tc}
|
||||||
tc = case s of
|
tc = case s of
|
||||||
"hm" -> pure Hm
|
"hm" -> pure Hm
|
||||||
"bi" -> pure Bi
|
"bi" -> pure Bi
|
||||||
_ -> Nothing
|
_ -> Nothing
|
||||||
|
|
||||||
data Options = Options
|
data Options = Options
|
||||||
{ help :: Bool
|
{ help :: Bool
|
||||||
, debug :: Bool
|
, debug :: Bool
|
||||||
, typechecker :: Maybe TypeChecker
|
, typechecker :: Maybe TypeChecker
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -128,7 +119,7 @@ main' opts s = do
|
||||||
debugDotViz
|
debugDotViz
|
||||||
|
|
||||||
compile generatedCode
|
compile generatedCode
|
||||||
spawnWait "./hello_world"
|
spawnWait "./output/hello_world"
|
||||||
|
|
||||||
exitSuccess
|
exitSuccess
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue