Created
May 25, 2015 23:19
-
-
Save joshcough/12893c23f437901cce4a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OLD: | |
-- native execution | |
compileAndRunNative :: | |
Language i o -> | |
CompilationOptions -> | |
FilePath -> --the original input file, also serves as the program name | |
i -> | |
IO (Val Output) | |
compileAndRunNative l@(Language _ _ _ _ subLang) opts inputFile input = do | |
code <- compileAndWriteResult l opts inputFile input | |
munge (recur subLang) code where | |
recur Nothing _ = return <$> runSFileNative sFile (sFile^.directory) where | |
sFile = inputFile & extension .~ (outputExtension l) & directory .~ (getOutputDirOrElse opts inputFile) | |
recur (Just sub) code = compileAndRunNative sub opts inputFile code | |
NEW: | |
compileAndRunNativeT :: | |
Compiler i X86 -> | |
CompilationOptions -> | |
FilePath -> --the original input file, also serves as the program name | |
i -> | |
IO (Val Output) | |
compileAndRunNativeT c opts inputFile input = do | |
x86 <- compileAndWriteResultT c opts inputFile input | |
return <$> runSFileNative sFile (sFile^.directory) where | |
sFile = inputFile & extension .~ (extT c) & directory .~ (getOutputDirOrElse opts inputFile) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment