Commit 2f18d703 authored by Finn Teegen's avatar Finn Teegen
Browse files

Move conditional compilation into separate module

parent 4605366b
......@@ -93,6 +93,7 @@ Library
, Checks.WarnCheck
, CompilerEnv
, CompilerOpts
, CondCompile
, CurryBuilder
, CurryDeps
, Env.Class
......
{- |
Module : $Header$
Description : Conditional compilation
Copyright : (c) 2017 Finn Teegen
License : BSD-3-clause
Maintainer : fte@informatik.uni-kiel.de
Stability : experimental
Portability : portable
TODO
-}
module CondCompile (condCompile) where
import Curry.Base.Monad
import Curry.CondCompile.Transform (condTransform)
import CompilerOpts (CppOpts (..))
condCompile :: CppOpts -> FilePath -> String -> CYIO String
condCompile opts fn p
| not (cppRun opts) = return p
| otherwise = either (failMessages . (: []))
ok
(condTransform (cppDefinitions opts) fn p)
......@@ -39,7 +39,6 @@ import Curry.Base.Monad
import Curry.Base.Position
import Curry.Base.Pretty
import Curry.Base.Span
import Curry.CondCompile.Transform
import Curry.FlatCurry.InterfaceEquivalence (eqInterface)
import Curry.Files.Filenames
import Curry.Files.PathUtils
......@@ -59,6 +58,7 @@ import qualified IL as IL
import Checks
import CompilerEnv
import CompilerOpts
import CondCompile (condCompile)
import Exports
import Generators
import Html.CurryHtml (source2html)
......@@ -172,13 +172,6 @@ withTempFile act = do
removeFile fn
return res
condCompile :: CppOpts -> FilePath -> String -> CYIO String
condCompile opts fn p
| not (cppRun opts) = return p
| otherwise = either (failMessages . (: []))
ok
(condTransform (cppDefinitions opts) fn p)
checkModuleHeader :: Monad m => Options -> ModuleIdent -> FilePath
-> CS.Module () -> CYT m (CS.Module ())
checkModuleHeader opts m fn = checkModuleId m
......
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