1
0
forked from GitHub/gf-core

force the interpreter to flush the output. usefull for the testsuite

This commit is contained in:
krasimir
2008-06-08 10:35:19 +00:00
parent fd6f37032c
commit a9ad4dbba6
2 changed files with 6 additions and 5 deletions

View File

@@ -41,7 +41,7 @@ loop opts gfenv0 = do
s <- fetchCommand (prompt env)
let gfenv = gfenv0 {history = s : history gfenv0}
let loopNewCPU gfenv' = do cpu' <- getCPUTime
putStrLn (show ((cpu' - cputime gfenv') `div` 1000000000) ++ " msec")
putStrLnFlush (show ((cpu' - cputime gfenv') `div` 1000000000) ++ " msec")
loop opts $ gfenv' {cputime = cpu'}
case words s of
-- special commands, requiring source grammar in env
@@ -78,7 +78,7 @@ importInEnv gfenv opts files
do let opts' = addOptions (setOptimization OptCSE False) opts
pgf0 = multigrammar (commandenv gfenv)
pgf1 <- importGrammar pgf0 opts' files
putStrLn $ unwords $ "\nLanguages:" : languages pgf1
putStrLnFlush $ unwords $ "\nLanguages:" : languages pgf1
return $ gfenv { commandenv = mkCommandEnv pgf1 }
welcome = unlines [