diff --git a/README.md b/README.md index a48020f..2f75c7a 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,7 @@ Preprocessing: --siloed Lex input files separately, so macros from earlier files are not defined in later files --skip-preprocessor Disable preprocessor + --pass-through Dump input without converting Conversion: -E --exclude=CONV Exclude a particular conversion (always, assert, interface, or logic) diff --git a/src/Job.hs b/src/Job.hs index 53908d6..59a056d 100644 --- a/src/Job.hs +++ b/src/Job.hs @@ -38,6 +38,7 @@ data Job = Job , define :: [String] , siloed :: Bool , skipPreprocessor :: Bool + , passThrough :: Bool , exclude :: [Exclude] , verbose :: Bool , write :: Write @@ -61,6 +62,7 @@ defaultJob = Job , siloed = nam_ "siloed" &= help ("Lex input files separately, so" ++ " macros from earlier files are not defined in later files") , skipPreprocessor = nam_ "skip-preprocessor" &= help "Disable preprocessor" + , passThrough = nam_ "pass-through" &= help "Dump input without converting" , exclude = nam_ "exclude" &= name "E" &= typ "CONV" &= help ("Exclude a particular conversion (always, assert, interface," ++ " or logic)") diff --git a/src/sv2v.hs b/src/sv2v.hs index 20db5e7..5910507 100644 --- a/src/sv2v.hs +++ b/src/sv2v.hs @@ -88,8 +88,10 @@ main = do hPutStrLn stderr msg exitFailure Right asts -> do - -- convert the files - let asts' = convert (exclude job) asts + -- convert the files if requested + let asts' = if passThrough job + then asts + else convert (exclude job) asts emptyWarnings (concat asts) (concat asts') -- write the converted files out writeOutput (write job) (files job) asts'