Commit f8bd9340 authored by Björn Peemöller 's avatar Björn Peemöller
Browse files

Refactoring in modules

parent 314018cd
...@@ -235,15 +235,15 @@ transModule opts mdl = do ...@@ -235,15 +235,15 @@ transModule opts mdl = do
writeOutput :: Options -> FilePath -> CompEnv CS.Module -> IO () writeOutput :: Options -> FilePath -> CompEnv CS.Module -> IO ()
writeOutput opts fn mdl@(_, modul) = do writeOutput opts fn mdl@(_, modul) = do
writeParsed opts fn modul writeParsed opts fn modul
qmdl@(env1, qlfd) <- dumpWith opts CS.ppModule DumpQualified $ qual mdl qmdl <- dumpWith opts CS.ppModule DumpQualified $ qual mdl
writeAbstractCurry opts fn qmdl writeAbstractCurry opts fn qmdl
-- generate interface file -- generate interface file
let intf = uncurry exportInterface qmdl let intf = uncurry exportInterface qmdl
writeInterface opts fn intf writeInterface opts fn intf
when withFlat $ do when withFlat $ do
(env2, il) <- transModule opts (env1, qlfd) (env2, il) <- transModule opts qmdl
-- generate target code -- generate target code
let modSum = summarizeModule (tyConsEnv env2) intf qlfd let modSum = summarizeModule (tyConsEnv env2) intf (snd qmdl)
writeFlat opts fn env2 modSum il writeFlat opts fn env2 modSum il
where where
withFlat = any (`elem` optTargetTypes opts) [FlatCurry, ExtendedFlatCurry] withFlat = any (`elem` optTargetTypes opts) [FlatCurry, ExtendedFlatCurry]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment