mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 03:32:51 -06:00
phrasbook/Compile.hs: make it work with ghc>=7.2
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
import List
|
import Data.List(partition)
|
||||||
import System
|
import Control.Monad(when)
|
||||||
|
import System.Cmd(system)
|
||||||
|
import System.Environment(getArgs)
|
||||||
|
|
||||||
-- (c) Aarne Ranta 2010 under GNU LGPL
|
-- (c) Aarne Ranta 2010 under GNU LGPL
|
||||||
|
|
||||||
@@ -21,13 +23,11 @@ import System
|
|||||||
mainmodu = "Phrasebook"
|
mainmodu = "Phrasebook"
|
||||||
|
|
||||||
main = do
|
main = do
|
||||||
(opts,langs) <- getArgs >>= return . partition ((=='-') . head)
|
(opts,langs) <- partition ((=='-') . head) `fmap` getArgs
|
||||||
let modus = [mkFile la | la <- langs]
|
let modus = [mkFile la | la <- langs]
|
||||||
let opt = elem "-opt" opts
|
let opt = elem "-opt" opts
|
||||||
putStrLn $ unwords modus
|
putStrLn $ unwords modus
|
||||||
if notElem "-link" opts
|
when (notElem "-link" opts) $ mapM_ (compileOne opt) modus
|
||||||
then mapM_ (compileOne opt) modus >> return ()
|
|
||||||
else return ()
|
|
||||||
case opts of
|
case opts of
|
||||||
_ | elem "-make" opts || elem "-link" opts -> do
|
_ | elem "-make" opts || elem "-link" opts -> do
|
||||||
let comm = "gf -make -s " ++ unwords (map (++ ".pgf") modus)
|
let comm = "gf -make -s " ++ unwords (map (++ ".pgf") modus)
|
||||||
|
|||||||
Reference in New Issue
Block a user