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

Complete refactoring of AbstractCurry generator

parent d1f08bc6
......@@ -24,12 +24,8 @@ import IL (Module)
import ModuleSummary
-- |Generate AbstractCurry
genTypedAbstractCurry :: CompilerEnv -> CS.Module -> AC.CurryProg
genTypedAbstractCurry = GAC.genTypedAbstract
-- |Generate untyped AbstractCurry
genUntypedAbstractCurry :: CompilerEnv -> CS.Module -> AC.CurryProg
genUntypedAbstractCurry = GAC.genUntypedAbstract
genAbstractCurry :: CompilerEnv -> CS.Module -> AC.CurryProg
genAbstractCurry = GAC.genAbstractCurry
-- |Generate FlatCurry
genFlatCurry :: ModuleSummary -> CompilerEnv -> IL.Module -> EF.Prog
......
This diff is collapsed.
......@@ -199,8 +199,11 @@ checkModule opts mdl = do
pc <- precCheck opts sc >>= dumpCS DumpPrecChecked
tc <- typeCheck opts pc >>= dumpCS DumpTypeChecked
-- TODO: This is a workaround to avoid the expansion of the export
-- specification for generating the HTML listing.
-- It would be better if checking and expansion are separated.
-- specification for generating the HTML listing. If a module does not
-- contain an export specification, the check generates one which leads
-- to a mismatch between the identifiers from the lexer and those in the
-- resulting module.
-- Therefore, it would be better if checking and expansion are separated.
if null (optTargetTypes opts)
then return tc
else exportCheck opts tc >>= dumpCS DumpExportChecked
......@@ -327,9 +330,9 @@ writeFlatIntf opts fn env modSum il
writeAbstractCurry :: Options -> FilePath -> CompilerEnv -> CS.Module -> IO ()
writeAbstractCurry opts fname env modul = do
when acyTarget $ AC.writeCurry (useSubDir $ acyName fname)
$ genTypedAbstractCurry env modul
$ genAbstractCurry env modul
when uacyTarget $ AC.writeCurry (useSubDir $ uacyName fname)
$ genUntypedAbstractCurry env modul
$ genAbstractCurry env modul
where
acyTarget = AbstractCurry `elem` optTargetTypes opts
uacyTarget = UntypedAbstractCurry `elem` optTargetTypes opts
......
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