From 429092ac6aa1374a468b36904b4c2c668d892c54 Mon Sep 17 00:00:00 2001 From: aarne Date: Wed, 1 Oct 2008 16:01:51 +0000 Subject: added mode 'gf --run' for running silently a script ; made quizzes handle character encoding correctly ; for this end, collected coding functions in GF.Text.Coding --- src/GF/Compile.hs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/GF/Compile.hs') diff --git a/src/GF/Compile.hs b/src/GF/Compile.hs index 5d5081541..289bdd92b 100644 --- a/src/GF/Compile.hs +++ b/src/GF/Compile.hs @@ -52,12 +52,16 @@ compileToPGF opts fs = link opts name gr link :: Options -> String -> SourceGrammar -> IOE PGF -link opts cnc gr = - do gc1 <- putPointE Normal opts "linking ... " $ +link opts cnc gr = do + let isv = (verbAtLeast opts Normal) + gc1 <- putPointE Normal opts "linking ... " $ let (abs,gc0) = mkCanon2gfcc opts cnc gr in case checkPGF gc0 of Ok (gc,b) -> do - ioeIO $ putStrLn $ if b then "OK" else "Corrupted PGF" + case (isv,b) of + (True, True) -> ioeIO $ putStrLn "OK" + (False,True) -> return () + _ -> ioeIO $ putStrLn $ "Corrupted PGF" return gc Bad s -> fail s return $ buildParser opts $ optimize opts gc1 -- cgit v1.2.3