Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Fredrik Wieczerkowski
curry-tools
Commits
be44cde4
Commit
be44cde4
authored
May 29, 2013
by
Michael Hanus
Browse files
CASS extended to literate curry
parent
53d5771a
Changes
2
Hide whitespace changes
Inline
Side-by-side
CASS/CurryFiles.curry
View file @
be44cde4
...
...
@@ -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 <- find
Source
FileInLoadPath 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 <- find
Source
FileInLoadPath modname
stime <- getModificationTime sourceFileName
let fcyFileName = flatCurryFileName sourceFileName
fcyExists <- doesFileExist fcyFileName
...
...
CASS/LoadAnalysis.curry
View file @
be44cde4
...
...
@@ -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 <- find
Source
FileInLoadPath 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 <- find
Source
FileInLoadPath moduleName
let defaultFileName = stripSuffix fileName ++ ".defaults."++anaName
fileExists <- doesFileExist defaultFileName
if fileExists
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment