forked from GitHub/gf-core
strict reading of files; bug fix in readFiles in ShellState
This commit is contained in:
@@ -38,9 +38,11 @@ getNoparseFromFile :: Options -> FilePath -> IO NoParse
|
||||
getNoparseFromFile opts file = do
|
||||
let f = maybe file id $ getOptVal opts noparseFile
|
||||
s <- readFile f
|
||||
return $ igns s
|
||||
let tree = buildTree $ flip zip (repeat ()) $ concat $ map getIgnores $ lines s
|
||||
tree `seq` return $ igns tree
|
||||
where
|
||||
igns s i = isInBinTree i $ buildTree $ flip zip (repeat ()) $ concat $ map getIgnores $ lines s
|
||||
igns tree i = isInBinTree i tree
|
||||
|
||||
-- where
|
||||
getIgnores s = case dropWhile (/="--#") (words s) of
|
||||
_:"noparse":fs -> map identC fs
|
||||
|
||||
@@ -282,7 +282,7 @@ updateShellState opts ign mcnc sh ((_,sgr,gr,eenv),rts) = do
|
||||
treebanks = treebanks sh,
|
||||
probss = zip concrs probss,
|
||||
gloptions = gloptions sh, --- opts, -- this would be command-line options
|
||||
readFiles = [ft | ft@(_,(f,_)) <- readFiles sh, notInrts f] ++ rts,
|
||||
readFiles = [ft | ft@(f,(_,_)) <- readFiles sh, notInrts f] ++ rts,
|
||||
absCats = csi,
|
||||
statistics = [StDepTypes deps,StBoundVars binds],
|
||||
transfers = transfers sh,
|
||||
|
||||
Reference in New Issue
Block a user