Commit be44cde4 authored by Michael Hanus's avatar Michael Hanus
Browse files

CASS extended to literate curry

parent 53d5771a
......@@ -6,12 +6,14 @@
--- @version March 2013
-----------------------------------------------------------------------
module CurryFiles(getImports,getSourceFileTime,readNewestFlatCurry) where
module CurryFiles(getImports,findSourceFileInLoadPath,
getSourceFileTime,readNewestFlatCurry) where
import FlatCurry
import FlatCurryGoodies(progImports)
import Directory(doesFileExist,getModificationTime)
import Distribution(findFileInLoadPath)
import Distribution(getLoadPathForFile)
import FileGoodies(getFileInPath,baseName)
import Time(ClockTime)
import Configuration(debugMessageLevel)
......@@ -22,10 +24,15 @@ getImports moduleName = do
debugMessageLevel 3 ("Reading interface of module "++moduleName)
readNewestFlatCurryInt moduleName >>= return . progImports
-- Find a source file for a module in the current load path.
findSourceFileInLoadPath modname = do
loadpath <- getLoadPathForFile modname
getFileInPath (baseName modname) [".lcurry",".curry"] loadpath
-- Get timestamp of a Curry source file (together with its name)
getSourceFileTime :: String -> IO (String,ClockTime)
getSourceFileTime moduleName = do
fileName <- findFileInLoadPath (moduleName++".curry")
fileName <- findSourceFileInLoadPath moduleName
time <- getModificationTime fileName
return (moduleName,time)
......@@ -33,7 +40,7 @@ getSourceFileTime moduleName = do
--- exists and is newer than the source file.
flatCurryFileNewer :: String -> IO (Maybe String)
flatCurryFileNewer modname = do
sourceFileName <- findFileInLoadPath (modname++".curry")
sourceFileName <- findSourceFileInLoadPath modname
stime <- getModificationTime sourceFileName
let fcyFileName = flatCurryFileName sourceFileName
fcyExists <- doesFileExist fcyFileName
......
......@@ -9,7 +9,6 @@
module LoadAnalysis where
import Directory
import Distribution(findFileInLoadPath)
import FileGoodies(separatorChar,splitDirectoryBaseName,stripSuffix)
import System(system,getArgs,getEnviron)
import GenericProgInfo
......@@ -18,6 +17,7 @@ import IO
import FiniteMap
import ReadShowTerm(readQTerm,showQTerm)
import FlatCurry(QName)
import CurryFiles(findSourceFileInLoadPath)
debugMessage n message = debugMessageLevel n ("LoadAnalysis: "++message)
......@@ -27,7 +27,7 @@ debugMessage n message = debugMessageLevel n ("LoadAnalysis: "++message)
getAnalysisBaseFile :: String -> String -> IO String
getAnalysisBaseFile moduleName anaName = do
analysisDirectory <- getAnalysisDirectory
fileName <- findFileInLoadPath (moduleName++".curry")
fileName <- findSourceFileInLoadPath moduleName
let (fileDir,_) = splitDirectoryBaseName fileName
if fileDir == "."
then do
......@@ -76,7 +76,7 @@ getInterfaceInfos anaName (mod:mods) =
--- and the second component is an analysis value.
loadDefaultAnalysisValues :: String -> String -> IO [(QName,a)]
loadDefaultAnalysisValues anaName moduleName = do
fileName <- findFileInLoadPath (moduleName++".curry")
fileName <- findSourceFileInLoadPath moduleName
let defaultFileName = stripSuffix fileName ++ ".defaults."++anaName
fileExists <- doesFileExist defaultFileName
if fileExists
......
Supports Markdown
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