mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-22 17:42:51 -06:00
print the search path when we can't find a module
This commit is contained in:
@@ -38,6 +38,7 @@ import System.FilePath
|
|||||||
import System.Time
|
import System.Time
|
||||||
import qualified Data.Map as Map
|
import qualified Data.Map as Map
|
||||||
import qualified Data.Set as Set
|
import qualified Data.Set as Set
|
||||||
|
import Data.List(nub)
|
||||||
|
|
||||||
import PGF.Check
|
import PGF.Check
|
||||||
import PGF.Data
|
import PGF.Data
|
||||||
@@ -108,8 +109,9 @@ compileModule opts1 env file = do
|
|||||||
let opts = addOptions opts0 opts1
|
let opts = addOptions opts0 opts1
|
||||||
let fdir = dropFileName file
|
let fdir = dropFileName file
|
||||||
let ps0 = moduleFlag optLibraryPath opts
|
let ps0 = moduleFlag optLibraryPath opts
|
||||||
ps2 <- ioeIO $ extendPathEnv $ fdir : ps0
|
ps1 <- ioeIO $ extendPathEnv $ fdir : ps0
|
||||||
let ps = ps2 ++ map (fdir </>) ps0
|
let ps2 = ps1 ++ map (fdir </>) ps0
|
||||||
|
ps <- ioeIO $ fmap nub $ mapM canonicalizePath ps2
|
||||||
ioeIO $ putIfVerb opts $ "module search path:" +++ show ps ----
|
ioeIO $ putIfVerb opts $ "module search path:" +++ show ps ----
|
||||||
let (_,sgr,rfs) = env
|
let (_,sgr,rfs) = env
|
||||||
files <- getAllFiles opts ps rfs file
|
files <- getAllFiles opts ps rfs file
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ import qualified Data.Map as Map
|
|||||||
import System.Time
|
import System.Time
|
||||||
import System.Directory
|
import System.Directory
|
||||||
import System.FilePath
|
import System.FilePath
|
||||||
|
import Text.PrettyPrint
|
||||||
|
|
||||||
type ModName = String
|
type ModName = String
|
||||||
type ModEnv = Map.Map ModName (ClockTime,[ModName])
|
type ModEnv = Map.Map ModName (ClockTime,[ModName])
|
||||||
@@ -92,7 +93,8 @@ getAllFiles opts ps env file = do
|
|||||||
case mb_gfoFile of
|
case mb_gfoFile of
|
||||||
Just gfoFile -> do gfoTime <- ioeIO $ getModificationTime gfoFile
|
Just gfoFile -> do gfoTime <- ioeIO $ getModificationTime gfoFile
|
||||||
return (gfoFile, Nothing, Just gfoTime)
|
return (gfoFile, Nothing, Just gfoTime)
|
||||||
Nothing -> ioeErr $ Bad ("File " ++ gfFile name ++ " does not exist.")
|
Nothing -> ioeErr $ Bad (render (text "File" <+> text (gfFile name) <+> text "does not exist." $$
|
||||||
|
text "searched in:" <+> vcat (map text ps)))
|
||||||
|
|
||||||
|
|
||||||
let mb_envmod = Map.lookup name env
|
let mb_envmod = Map.lookup name env
|
||||||
|
|||||||
Reference in New Issue
Block a user