mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
bug fix in reading files
This commit is contained in:
@@ -88,8 +88,9 @@ compileModule opts1 st0 file = do
|
|||||||
opts0 <- ioeIO $ getOptionsFromFile file
|
opts0 <- ioeIO $ getOptionsFromFile file
|
||||||
let useFileOpt = maybe False (const True) $ getOptVal opts0 pathList
|
let useFileOpt = maybe False (const True) $ getOptVal opts0 pathList
|
||||||
let opts = addOptions opts1 opts0
|
let opts = addOptions opts1 opts0
|
||||||
let ps0 = pathListOpts opts
|
|
||||||
let fpath = justInitPath file
|
let fpath = justInitPath file
|
||||||
|
let ps0 = pathListOpts opts fpath
|
||||||
|
|
||||||
let ps1 = if useFileOpt
|
let ps1 = if useFileOpt
|
||||||
then (map (prefixPathName fpath) ps0)
|
then (map (prefixPathName fpath) ps0)
|
||||||
else ps0
|
else ps0
|
||||||
@@ -132,8 +133,8 @@ compileEnvShSt st fs = ((0,sgr,cgr),fts) where
|
|||||||
notIns i = notElem (prt i) $ map fileBody fs
|
notIns i = notElem (prt i) $ map fileBody fs
|
||||||
fts = readFiles st
|
fts = readFiles st
|
||||||
|
|
||||||
pathListOpts :: Options -> [InitPath]
|
pathListOpts :: Options -> FileName -> [InitPath]
|
||||||
pathListOpts opts = maybe [""] pFilePaths $ getOptVal opts pathList
|
pathListOpts opts file = maybe [file] pFilePaths $ getOptVal opts pathList
|
||||||
|
|
||||||
reverseModules (MGrammar ms) = MGrammar $ reverse ms
|
reverseModules (MGrammar ms) = MGrammar $ reverse ms
|
||||||
|
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ resModName = ('#':)
|
|||||||
getImports :: [InitPath] -> FileName -> IOE [(ModuleHeader,InitPath)]
|
getImports :: [InitPath] -> FileName -> IOE [(ModuleHeader,InitPath)]
|
||||||
getImports ps = get [] where
|
getImports ps = get [] where
|
||||||
get ds file0 = do
|
get ds file0 = do
|
||||||
let name = fileBody file0
|
let name = justModuleName file0 ---- fileBody file0
|
||||||
(p,s) <- tryRead name
|
(p,s) <- tryRead name
|
||||||
let ((typ,mname),imps) = importsOfFile s
|
let ((typ,mname),imps) = importsOfFile s
|
||||||
let namebody = justFileName name
|
let namebody = justFileName name
|
||||||
|
|||||||
Reference in New Issue
Block a user