uuagc-cabal 1.0.5.0 → 1.0.6.0
raw patch · 3 files changed
+28/−19 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- src-options/Options.hs +21/−0
- src/Distribution/Simple/UUAGC/UUAGC.hs +6/−18
- uuagc-cabal.cabal +1/−1
src-options/Options.hs view
@@ -86,6 +86,8 @@ , MyOpt [] ["version"] (NoArg versionOpt) (boolOpt showVersion) "get version information" , MyOpt ['O'] ["optimize"] (NoArg optimizeOpt) noOpt "optimize generated code (--visit --case)" , MyOpt [] ["visit"] (NoArg visitOpt) (boolOpt visit) "try generating visit functions"+ , MyOpt [] ["loag"] (OptArg loagOpt "Bool") (boolOpt loag) "recognises all linear ordered attribute grammars by generting a SAT problem, uses --verbose to print out numbers of clauses and variables"+ , MyOpt [] ["aoag"] (NoArg aoagOpt) (boolOpt aoag) "recognises all linear ordered attribute grammars by finding fake dependencies, uses --verbose to print out the selected fake dependencies" , MyOpt [] ["seq"] (NoArg seqOpt) (boolOpt withSeq) "force evaluation using function seq (visit functions only)" , MyOpt [] ["unbox"] (NoArg unboxOpt) (boolOpt unbox) "use unboxed tuples" , MyOpt [] ["bangpats"] (NoArg bangpatsOpt) (boolOpt bangpats) "use bang patterns (visit functions only)"@@ -185,6 +187,9 @@ , showHelp :: Bool , showVersion :: Bool , visit :: Bool+ , loag :: Bool+ , minvisits :: Bool+ , aoag :: Bool , withSeq :: Bool , unbox :: Bool , bangpats :: Bool@@ -281,6 +286,9 @@ , withSelf = False , withCycle = False , visit = False+ , loag = False+ , minvisits = False+ , aoag = False , withSeq = False , unbox = False , bangpats = False@@ -351,6 +359,19 @@ , noInlinePragmas = False , aggressiveInlinePragmas = False }++loagOpt :: (Maybe String) -> Options -> Options+loagOpt mstr opts = + case mstr of+ Nothing -> opts'+ Just "0" -> opts'+ Just _ -> opts' {minvisits = True}++ where opts'=opts{loag = True, visit = True}++aoagOpt :: Options -> Options+aoagOpt opts = + opts{loag = True, visit = True, aoag = True} --Options -> String -> [String] moduleOpt :: Maybe String -> Options -> Options
src/Distribution/Simple/UUAGC/UUAGC.hs view
@@ -23,9 +23,7 @@ import Distribution.Simple.UUAGC.Parser import Options hiding (verbose) import Distribution.Verbosity-import System.Process( CreateProcess(..), createProcess, CmdSpec(..)- , StdStream(..), runProcess, waitForProcess- , shell)+import System.Process( readProcessWithExitCode ) import System.Directory(getModificationTime ,doesFileExist ,removeFile)@@ -90,22 +88,15 @@ -- | Create uuagc function using shell (old method) uuagcFromString :: String -> [String] -> FilePath -> IO (ExitCode, [FilePath]) uuagcFromString uuagcPath args file = do- let argline = uuagcPath ++ concatMap (' ':) (args ++ [file])- (_, Just ppOutput, Just ppError, ph) <- createProcess (shell argline)- { std_in = Inherit- , std_out = CreatePipe- , std_err = CreatePipe- }- ec <- waitForProcess ph+ (ec,out,err) <- readProcessWithExitCode uuagcPath (args ++ [file]) "" case ec of ExitSuccess ->- do putErrorInfo ppError- fls <- processContent ppOutput- return (ExitSuccess, fls)+ do hPutStr stderr err+ return (ExitSuccess, words out) (ExitFailure exc) -> do hPutStrLn stderr (uuagcPath ++ ": " ++ show exc)- putErrorInfo ppOutput- putErrorInfo ppError+ hPutStr stderr out+ hPutStr stderr err return (ExitFailure exc, []) -- | Main hook, argument should be uuagc function@@ -120,9 +111,6 @@ originalPreBuild = preBuild simpleUserHooks originalBuildHook = buildHook simpleUserHooks originalSDistHook = sDistHook simpleUserHooks--processContent :: Handle -> IO [String]-processContent = liftM words . hGetContents putErrorInfo :: Handle -> IO () putErrorInfo h = hGetContents h >>= hPutStr stderr
uuagc-cabal.cabal view
@@ -1,7 +1,7 @@ cabal-version: >=1.8 build-type: Simple name: uuagc-cabal-version: 1.0.5.0+version: 1.0.6.0 license: BSD3 license-file: LICENSE maintainer: Jeroen Bransen <J.Bransen@uu.nl>