1
0
forked from GitHub/gf-core

exitFailure with gf -make

This commit is contained in:
aarne
2006-03-16 20:33:35 +00:00
parent 1502283f1d
commit 06ea7fea46
7 changed files with 14 additions and 5 deletions

View File

@@ -7,6 +7,7 @@ test:
pretest:
echo "gr -cat=Cl -number=11 -prob | tb" | gf -probs=lang.gfprob -path=present:prelude -nocf ../present/Lang???.gfc
langs:
echo "s ;; pm | wf langs.gfcm" | gf -nocf -src */Lang??*.gf english/LangEng.gf +RTS -M800M -K100M
cp -p */*.gfc */*.gfr ../alltenses

View File

@@ -15,3 +15,4 @@
--# prob yes_Phr 0.02
--# prob no_Phr 0.02
--# prob TEmpty 0.05

View File

@@ -27,7 +27,7 @@ interface DiffRomance = open CommonRomance, Prelude in {
oper partAgr : VType -> VPAgr ;
-- Whether participle agrees to foregoing clitic.
-- (Fre "je l'ai vue", Ita "io la ho visto")
-- (Fre "je l'ai vue", Spa "yo la he visto")
oper vpAgrClit : Agr -> VPAgr ;

View File

@@ -314,7 +314,7 @@ oper
{s = table {Posit => a.s ! Posit ; _ => b.s ! Posit} ;
isPre = a.isPre ; lock_A = <>} ;
compADeg a =
{s = table {Posit => a.s ! Posit ; _ => \\f => "più" ++ a.s ! Posit ! f} ;
{s = table {Posit => a.s ! Posit ; _ => \\f => "más" ++ a.s ! Posit ! f} ;
isPre = a.isPre ;
lock_A = <>} ;
regADeg a = compADeg (regA a) ;

View File

@@ -20,7 +20,7 @@ lin
behind_Prep = {s = "detrás" ; c = MorphoSpa.genitive ; isDir = False} ;
between_Prep = mkPreposition "entre" ;
both7and_DConj = {s1,s2 = etConj.s ; n = Pl} ;
but_PConj = ss "mas" ;
but_PConj = ss "pero" ;
by8agent_Prep = mkPreposition "por" ;
by8means_Prep = mkPreposition "por" ;
can8know_VV = mkVV (verboV (saber_71 "saber")) ;

View File

@@ -90,7 +90,7 @@ putVerb st@(sh,_) s = if (oElem beSilent (globalOptions sh))
batchCompile :: Options -> FilePath -> IO ()
batchCompile os file = do
let file' = mkGFC file
let st = initHState emptyShellState
let st = initHState $ addGlobalOptions (options [iOpt "make"]) emptyShellState
let s = "i -o" +++ (unwords $ map ('-':) $ words $ prOpts os) +++ file
let cs = pCommandLines st s
execLines True cs st

View File

@@ -65,6 +65,7 @@ import Data.Char (isDigit)
import Data.Maybe (fromMaybe)
import GF.System.Signal (runInterruptibly)
import System.Exit (exitFailure)
---- import qualified GrammarToGramlet as Gr
---- import qualified GrammarToCanonXML2 as Canon
@@ -169,10 +170,16 @@ execLine :: Bool -> CommandLine -> ([String],HState) -> IO ([String],HState)
execLine put (c@(co, os), arg, cs) (outps,st) = do
(st',val) <- execC c (st, arg)
let tr = oElem doTrace os || null cs -- option -tr leaves trace in pipe
make = oElem (iOpt "make") os
isErr = case arg of
AError _ -> True
_ -> False
utf = if (oElem useUTF8 os) then encodeUTF8 else id
outp = if tr then [utf (prCommandArg val)] else []
if put then mapM_ putStrLnFlush outp else return ()
execs cs val (if put then [] else outps ++ outp, st')
if make && isErr
then exitFailure
else execs cs val (if put then [] else outps ++ outp, st')
where
execs [] arg st = return st
execs (c:cs) arg st = execLine put (c, arg, cs) st