Skip to content

Commit

Permalink
Merge remote-tracking branch 'arekfu/master'
Browse files Browse the repository at this point in the history
Conflicts:
	src/G4Release.hs
  • Loading branch information
kaitanie committed Nov 14, 2011
2 parents 009e648 + 1ac1e54 commit ec82431
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/G4Release.hs
Expand Up @@ -47,7 +47,7 @@ transformFn g4options repo code =
False -> (appendRevisionInfo repo)
assertEliminationTransform = case elem DisableAssertElimination g4options of
True -> identityTransform
False -> identityTransform
False -> disableAssertions
in initialTransform >>= typeTransform >>= assertEliminationTransform >>= revisionInfoTransform >>= licenseInfoTransform

releaseG4 :: GitRepo -> FilePath -> [G4Module] -> [G4ReleaseOption] -> IO ()
Expand Down
17 changes: 13 additions & 4 deletions src/SedRunner.hs
@@ -1,5 +1,6 @@
module SedRunner (
useG4Types
useG4Types,
disableAssertions
) where

import System.IO
Expand All @@ -11,6 +12,7 @@ data SedCommand = SedIntToG4Int
| SedDoubleToG4Double
| SedBoolToG4Bool
| SedCommentAsserts
| SedCommentIncludeCassert
| SedFixG4G4
| SedFixUnsignedG4Int
| SedFixG4boolalpha
Expand All @@ -29,7 +31,8 @@ sedCommandArgs SedIntToG4Int = ["s/int/G4int/g"]
sedCommandArgs SedFloatToG4Float = toG4TypeRegexp "float"
sedCommandArgs SedDoubleToG4Double = toG4TypeRegexp "double"
sedCommandArgs SedBoolToG4Bool = toG4TypeRegexp "bool"
sedCommandArgs SedCommentAsserts = ["s/assert/\\/\\/ assert/g"]
sedCommandArgs SedCommentAsserts = ["s/^ *assert/\\/\\/ assert/g"]
sedCommandArgs SedCommentIncludeCassert = ["s/#include \\+<cassert>/\\/\\/ #include <cassert>/g"]
sedCommandArgs SedFixG4G4 = ["s/G4G4/G4/g"]
sedCommandArgs SedFixUnsignedG4Int = ["s/unsigned\\ G4int/unsigned\\ int/g"]
sedCommandArgs SedFixG4boolalpha = ["s/G4boolalpha/boolalpha/g"]
Expand All @@ -46,8 +49,14 @@ useG4Double = runSed SedDoubleToG4Double
useG4Bool :: String -> IO String
useG4Bool = runSed SedBoolToG4Bool

-- commentAsserts :: String -> IO String
-- commentAsserts = runSed SedCommentAsserts
commentAsserts :: String -> IO String
commentAsserts = runSed SedCommentAsserts

commentIncludeCassert :: String -> IO String
commentIncludeCassert = runSed SedCommentIncludeCassert

disableAssertions :: String -> IO String
disableAssertions code = (commentAsserts code) >>= commentIncludeCassert

fixG4G4 :: String -> IO String
fixG4G4 = runSed SedFixG4G4
Expand Down

0 comments on commit ec82431

Please sign in to comment.