Commit 04db7557 authored by Michael Hanus 's avatar Michael Hanus
Browse files

Tools adapted to deprecated Distribution operations

parent 2f5e656b
......@@ -10,13 +10,14 @@ module CurryFiles(getImports,findModuleSourceInLoadPath,
getSourceFileTime,getFlatCurryFileTime,
readNewestFlatCurry) where
import Distribution (lookupModuleSourceInLoadPath)
import Directory (doesFileExist, getModificationTime)
import FlatCurry.Types
import FlatCurry.Files
import FlatCurry.Goodies(progImports)
import Directory(doesFileExist,getModificationTime)
import Distribution(lookupFileInLoadPath,lookupModuleSourceInLoadPath)
import Time(ClockTime)
import Configuration(debugMessage)
import FlatCurry.Goodies (progImports)
import Time (ClockTime)
import Configuration (debugMessage)
-- Get the imports of a module.
......@@ -46,7 +47,7 @@ getSourceFileTime moduleName = do
-- Get timestamp of FlatCurry file (together with the module name)
getFlatCurryFileTime :: String -> IO (String,Maybe ClockTime)
getFlatCurryFileTime modname =
lookupFileInLoadPath (flatCurryFileName modname) >>=
lookupFlatCurryFileInLoadPath modname >>=
maybe (return (modname, Nothing))
(\fcyFileName -> do
ftime <- getModificationTime fcyFileName
......@@ -58,7 +59,7 @@ flatCurryFileNewer :: String -> IO (Maybe String)
flatCurryFileNewer modname = do
(_,sourceFileName) <- findModuleSourceInLoadPath modname
stime <- getModificationTime sourceFileName
lookupFileInLoadPath (flatCurryFileName modname) >>=
lookupFlatCurryFileInLoadPath modname >>=
maybe (return Nothing)
(\fcyFileName -> do
itime <- getModificationTime fcyFileName
......
......@@ -5,6 +5,7 @@
--- @version January 16, 2007
------------------------------------------------------------------------------
import Distribution (installDir)
import JavaScript
import List
import FlatCurry.Types
......@@ -12,13 +13,12 @@ import FlatCurry.Files
import FlatCurry.Compact
import FlatCurry.Show
import Integer
import System(system,getArgs)
import System (system, getArgs)
import Directory
import Char(isAlphaNum)
import Char (isAlphaNum)
import Unsafe
import Distribution(installDir,findFileInLoadPath)
import Maybe
import ReadNumeric(readNat)
import ReadNumeric (readNat)
------------------------------------------------------------------------------
-- General definitions:
......@@ -772,7 +772,7 @@ transformWUI mainmodname imports target = do
getAndTransformWUIConditions :: String -> IO [(QName,Bool)]
getAndTransformWUIConditions modname = do
prog <- readFlatCurry modname
fcyname <- findFileInLoadPath (flatCurryFileName modname)
fcyname <- getFlatCurryFileInLoadPath modname
let jscfuns = jscOfProg prog
newflatprogname = fcyname++"_withjs"
if or (map snd jscfuns) -- is there some withConditionJS to be transformed?
......
......@@ -178,7 +178,7 @@ makeIndexPages docdir modnames = do
done
where
readTypesFuncs modname = do
fcyfile <- findFileInLoadPath (flatCurryFileName modname)
fcyfile <- getFlatCurryFileInLoadPath modname
(Prog _ _ types funs _) <- readFlatCurryFile fcyfile
return (types,funs)
......@@ -299,8 +299,7 @@ makeDocIfNecessary docparams recursive docdir modname = do
if not docexists
then copyOrMakeDoc docparams recursive docdir modname
else do
ctime <- findFileInLoadPath (flatCurryFileName modname)
>>= getModificationTime
ctime <- getFlatCurryFileInLoadPath modname >>= getModificationTime
dftime <- getModificationTime docfile
if compareClockTime ctime dftime == GT
then copyOrMakeDoc docparams recursive docdir modname
......@@ -311,11 +310,11 @@ makeDocIfNecessary docparams recursive docdir modname = do
-- get imports of a module by reading the interface, if possible:
getImports :: String -> IO [String]
getImports modname = do
let fintname = flatCurryIntName modname
fcyname = flatCurryFileName modname
mbfintfile <- lookupFileInLoadPath fintname
mbfintfile <- getLoadPathForModule modname >>=
lookupFileInPath (flatCurryIntName modname) [""]
(Prog _ imports _ _ _) <- maybe
(findFileInLoadPath fcyname >>= readFlatCurryFile)
(getFlatCurryFileInLoadPath modname >>=
readFlatCurryFile)
readFlatCurryFile
mbfintfile
return imports
......
......@@ -2,23 +2,23 @@
--- Functions to generate documentation in "CDoc" format.
---
--- @author Sandra Dylus
--- @version November 2015
----------------------------------------------------------------------
module CurryDocCDoc where
import CurryDocParams
import CurryDocRead
import Distribution(findFileInLoadPath)
import FlatCurry.Types
import FlatCurry.Files
import FlatCurry.FlexRigid
import ReadShowTerm
import List
import ReadShowTerm
generateCDoc :: String -> String -> [(SourceLine,String)] -> AnaInfo
-> IO String
generateCDoc modName modCmts progCmts anaInfo = do
fcyName <- findFileInLoadPath (flatCurryFileName modName)
fcyName <- getFlatCurryFileInLoadPath modName
Prog _ _ types functions _ <- readFlatCurryFile fcyName
let modInfo = ModuleInfo modName (author avCmts) mCmts
funcInfo (Func qName@(mName, fName) _ _ tExpr rule) =
......
......@@ -11,12 +11,13 @@ import CurryDocParams
import CurryDocRead
import CurryDocConfig
import TotallyDefined(Completeness(..))
import FilePath
import AbstractCurry.Types
import AbstractCurry.Files
import AbstractCurry.Select
import qualified FlatCurry.Types as FC
import qualified FlatCurry.Goodies as FCG
import FilePath
import FileGoodies (lookupFileInPath)
import HTML
import BootstrapStyle
import List
......@@ -26,6 +27,7 @@ import Time
import Distribution
import CategorizedHtmlList
import Markdown
import Maybe
infixl 0 `withTitle`
......@@ -35,7 +37,9 @@ infixl 0 `withTitle`
generateHtmlDocs :: DocParams -> AnaInfo -> String -> String
-> [(SourceLine,String)] -> IO String
generateHtmlDocs docparams anainfo modname modcmts progcmts = do
acyname <- findFileInLoadPath (abstractCurryFileName modname)
acyname <- getLoadPathForModule modname >>=
lookupFileInPath (abstractCurryFileName modname) [""] >>=
return . fromJust
putStrLn $ "Reading AbstractCurry program \""++acyname++"\"..."
(CurryProg _ imports types functions ops) <- readAbstractCurryFile acyname
let
......
......@@ -7,16 +7,18 @@
module CurryDocTeX where
import CurryDocParams
import CurryDocRead
import Char
import Distribution
import FlatCurry.Types
import FlatCurry.Files
import HTML
import HtmlParser
import List
import Char
import Markdown
import Maybe
import CurryDocParams
import CurryDocRead
--------------------------------------------------------------------------
-- Generates the documentation of a module in HTML format where the comments
......@@ -24,7 +26,7 @@ import Markdown
generateTexDocs :: DocParams -> AnaInfo -> String -> String
-> [(SourceLine,String)] -> IO String
generateTexDocs docparams anainfo modname modcmts progcmts = do
fcyname <- findFileInLoadPath (flatCurryFileName modname)
fcyname <- getFlatCurryFileInLoadPath modname
putStrLn $ "Reading FlatCurry program \""++fcyname++"\"..."
(Prog _ _ types functions _) <- readFlatCurryFile fcyname
let textypes = concatMap (genTexType docparams progcmts) types
......
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