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

Added dump of pretty-printed FlatCurry code

parent 7c3a2f39
Name: curry-frontend
Version: 0.4.0
Version: 0.4.1
Cabal-Version: >= 1.6
Synopsis: Compile the functional logic language Curry to several
intermediate formats
......@@ -36,7 +36,7 @@ Flag network-uri
Executable cymake
hs-source-dirs: src
Main-is: cymake.hs
Build-Depends: base == 4.*, curry-base == 0.4.0
Build-Depends: base == 4.*, curry-base == 0.4.1
, containers, directory, mtl, process, transformers, syb
if flag(network-uri)
build-depends: network-uri >= 2.6
......
......@@ -202,6 +202,7 @@ data DumpLevel
| DumpLifted -- ^ dump source after lambda-lifting
| DumpTranslated -- ^ dump IL code after translation
| DumpCaseCompleted -- ^ dump IL code after case completion
| DumpFlatCurry -- ^ dump FlatCurry code (pretty-printed)
deriving (Eq, Bounded, Enum, Show)
-- |Description and flag of dump levels
......@@ -218,6 +219,7 @@ dumpLevel = [ (DumpParsed , "dump-parse", "parse tree" )
, (DumpLifted , "dump-lift" , "lifting output" )
, (DumpTranslated , "dump-trans", "translated output" )
, (DumpCaseCompleted, "dump-cc" , "case completed output" )
, (DumpFlatCurry , "dump-flat" , "FlatCurry code" )
]
-- |Description and flag of language extensions
......
......@@ -4,7 +4,7 @@
Copyright : (c) 1999 - 2004 Wolfgang Lux
2005 Martin Engelke
2007 Sebastian Fischer
2011 - 2014 Björn Peemöller
2011 - 2015 Björn Peemöller
License : OtherLicense
Maintainer : bjp@informatik.uni-kiel.de
......@@ -45,9 +45,9 @@ import Env.Interface
-- source representations
import qualified Curry.AbstractCurry as AC
import qualified Curry.ExtendedFlat.Type as EF
import qualified Curry.Syntax as CS
import qualified IL as IL
import qualified Curry.ExtendedFlat as EF
import qualified Curry.Syntax as CS
import qualified IL as IL
import Checks
import CompilerEnv
......@@ -301,8 +301,9 @@ writeFlat opts fn env modSum il = do
writeFlatCurry :: Options -> FilePath -> CompilerEnv -> ModuleSummary
-> IL.Module -> IO ()
writeFlatCurry opts fn env modSum il = do
when extTarget $ EF.writeExtendedFlat (useSubDir $ extFlatName fn) prog
when fcyTarget $ EF.writeFlatCurry (useSubDir $ flatName fn) prog
(_, fc) <- dumpWith opts EF.ppProg DumpFlatCurry (env, prog)
when extTarget $ EF.writeExtendedFlat (useSubDir $ extFlatName fn) fc
when fcyTarget $ EF.writeFlatCurry (useSubDir $ flatName fn) fc
where
extTarget = ExtendedFlatCurry `elem` optTargetTypes opts
fcyTarget = FlatCurry `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