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

This commit is contained in:
aarne
2008-10-01 16:01:51 +00:00
parent 81a93979ad
commit d53f8e0644
8 changed files with 93 additions and 52 deletions

View File

@@ -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