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

libs and tools updated

parent bbb2814d
......@@ -13,6 +13,12 @@ Changes to version 1.13.0:
It still suspends when comparing two variables or
one variable with a number or character.
* Prelude: operations `(===)` and `(&&>)` removed
* Library Distribution: some load path handling operations
(`findFileInLoadPath`, `lookupFileInLoadPath`, `readFirstFileInLoadPath`,
`getLoadPath`, `getLoadPathForFile`) removed since they are deprecated
(use operations like `getLoadPathForModule` and
`lookupModuleSourceInLoadPath` instead of the deprecated operations
since they handle hierarchical module names better)
* Libraries `meta/*` removed (since they have been replaced
by libraries with hierachical names, see below)
* Hierarchical libraries for FlatCurry added and extended:
......
currytools @ 04db7557
Subproject commit 2f5e656b79d251bc0cdb47eb5d5b7a398bf8204e
Subproject commit 04db7557195f939e09faa1a0d086b5074b951038
lib-trunk @ 7df0a642
Subproject commit 152ef978a953dd935effa576fdce87af1c231acd
Subproject commit 7df0a64212f75b0f2391e34cbb85acd4fcf08888
......@@ -14,7 +14,8 @@ module Flat where
import Char
import Directory
import Distribution
import FilePath ((<.>))
import FileGoodies (getFileInPath)
import FilePath (takeFileName, (</>), (<.>))
import Maybe (isNothing)
------------------------------------------------------------------------------
......@@ -262,12 +263,16 @@ readFlatCurry progfile =
readFlatCurryWithParseOptions :: String -> FrontendParams -> IO Prog
readFlatCurryWithParseOptions progname options = do
mbmoddir <- lookupModuleSourceInLoadPath progname
>>= return . maybe Nothing (Just . fst)
unless (isNothing mbmoddir) $
callFrontendWithParams FCY options progname
filename <- findFileInLoadPath (flatCurryFileName progname)
mbsrc <- lookupModuleSourceInLoadPath progname
case mbsrc of
Nothing -> do -- no source file, try to find FlatCurry file in load path:
loadpath <- getLoadPathForModule progname
filename <- getFileInPath (flatCurryFileName (takeFileName progname)) [""]
loadpath
readFlatCurryFile filename
Just (dir,_) -> do
callFrontendWithParams FCY options progname
readFlatCurryFile (flatCurryFileName (dir </> takeFileName progname))
--- Transforms a name of a Curry program (with or without suffix ".curry"
--- or ".lcurry") into the name of the file containing the
......
......@@ -14,7 +14,8 @@ module Flat where
import Char
import Directory
import Distribution
import FilePath ((<.>))
import FileGoodies (getFileInPath)
import FilePath (takeFileName, (</>), (<.>))
import Maybe (isNothing)
------------------------------------------------------------------------------
......@@ -261,12 +262,16 @@ readFlatCurry progfile =
readFlatCurryWithParseOptions :: String -> FrontendParams -> IO Prog
readFlatCurryWithParseOptions progname options = do
mbmoddir <- lookupModuleSourceInLoadPath progname
>>= return . maybe Nothing (Just . fst)
unless (isNothing mbmoddir) $
callFrontendWithParams FCY options progname
filename <- findFileInLoadPath (flatCurryFileName progname)
mbsrc <- lookupModuleSourceInLoadPath progname
case mbsrc of
Nothing -> do -- no source file, try to find FlatCurry file in load path:
loadpath <- getLoadPathForModule progname
filename <- getFileInPath (flatCurryFileName (takeFileName progname)) [""]
loadpath
readFlatCurryFile filename
Just (dir,_) -> do
callFrontendWithParams FCY options progname
readFlatCurryFile (flatCurryFileName (dir </> takeFileName progname))
--- Transforms a name of a Curry program (with or without suffix ".curry"
--- or ".lcurry") into the name of the file containing the
......
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