Skip to content

Commit

Permalink
Commenting out #include <cassert> too
Browse files Browse the repository at this point in the history
  • Loading branch information
Davide Mancusi committed Nov 14, 2011
1 parent 42501fc commit 1ac1e54
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/G4Release.hs
Expand Up @@ -27,7 +27,7 @@ data G4Module = G4Module {
releaseG4 :: GitRepo -> FilePath -> [G4Module] -> IO ()
releaseG4 repo targetdir modules = do
-- let transformFn code = (useG4Types code) >>= (appendRevisionInfo repo) >>= (appendLicense licenseBoilerplate)
let transformFn code = (useG4Types code) >>= appendDefines >>= (appendRevisionInfo repo) >>= (appendLicense licenseBoilerplate)
let transformFn code = (useG4Types code) >>= disableAssertions >>= appendDefines >>= (appendRevisionInfo repo) >>= (appendLicense licenseBoilerplate)
-- let transformFn code = (appendDefines code) >>= (appendRevisionInfo repo) >>= (appendLicense licenseBoilerplate)
releaseFn = releaseModule targetdir transformFn
mapM_ releaseFn modules
Expand Down
11 changes: 10 additions & 1 deletion 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 @@ -30,6 +32,7 @@ sedCommandArgs SedFloatToG4Float = toG4TypeRegexp "float"
sedCommandArgs SedDoubleToG4Double = toG4TypeRegexp "double"
sedCommandArgs SedBoolToG4Bool = toG4TypeRegexp "bool"
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 @@ -49,6 +52,12 @@ useG4Bool = runSed SedBoolToG4Bool
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 1ac1e54

Please sign in to comment.