Commit bb938f1e by Zachary Snow

add ability to --pass-through input without conversion

parent 3f20055c
...@@ -92,6 +92,7 @@ Preprocessing: ...@@ -92,6 +92,7 @@ Preprocessing:
--siloed Lex input files separately, so macros from --siloed Lex input files separately, so macros from
earlier files are not defined in later files earlier files are not defined in later files
--skip-preprocessor Disable preprocessor --skip-preprocessor Disable preprocessor
--pass-through Dump input without converting
Conversion: Conversion:
-E --exclude=CONV Exclude a particular conversion (always, assert, -E --exclude=CONV Exclude a particular conversion (always, assert,
interface, or logic) interface, or logic)
......
...@@ -38,6 +38,7 @@ data Job = Job ...@@ -38,6 +38,7 @@ data Job = Job
, define :: [String] , define :: [String]
, siloed :: Bool , siloed :: Bool
, skipPreprocessor :: Bool , skipPreprocessor :: Bool
, passThrough :: Bool
, exclude :: [Exclude] , exclude :: [Exclude]
, verbose :: Bool , verbose :: Bool
, write :: Write , write :: Write
...@@ -61,6 +62,7 @@ defaultJob = Job ...@@ -61,6 +62,7 @@ defaultJob = Job
, siloed = nam_ "siloed" &= help ("Lex input files separately, so" , siloed = nam_ "siloed" &= help ("Lex input files separately, so"
++ " macros from earlier files are not defined in later files") ++ " macros from earlier files are not defined in later files")
, skipPreprocessor = nam_ "skip-preprocessor" &= help "Disable preprocessor" , skipPreprocessor = nam_ "skip-preprocessor" &= help "Disable preprocessor"
, passThrough = nam_ "pass-through" &= help "Dump input without converting"
, exclude = nam_ "exclude" &= name "E" &= typ "CONV" , exclude = nam_ "exclude" &= name "E" &= typ "CONV"
&= help ("Exclude a particular conversion (always, assert, interface," &= help ("Exclude a particular conversion (always, assert, interface,"
++ " or logic)") ++ " or logic)")
......
...@@ -88,8 +88,10 @@ main = do ...@@ -88,8 +88,10 @@ main = do
hPutStrLn stderr msg hPutStrLn stderr msg
exitFailure exitFailure
Right asts -> do Right asts -> do
-- convert the files -- convert the files if requested
let asts' = convert (exclude job) asts let asts' = if passThrough job
then asts
else convert (exclude job) asts
emptyWarnings (concat asts) (concat asts') emptyWarnings (concat asts) (concat asts')
-- write the converted files out -- write the converted files out
writeOutput (write job) (files job) asts' writeOutput (write job) (files job) asts'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment