summaryrefslogtreecommitdiff
path: root/src/GF/Compile.hs
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-10-01 16:01:51 +0000
committeraarne <aarne@cs.chalmers.se>2008-10-01 16:01:51 +0000
commit429092ac6aa1374a468b36904b4c2c668d892c54 (patch)
tree73d56e3a233b80b8e25a80b5b518802590603718 /src/GF/Compile.hs
parent307042a6a1863854920da7eaae6fbc588457221c (diff)
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
Diffstat (limited to 'src/GF/Compile.hs')
-rw-r--r--src/GF/Compile.hs10
1 files changed, 7 insertions, 3 deletions
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