Commit bb938f1e by Zachary Snow

add ability to --pass-through input without conversion

parent 3f20055c
......@@ -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)
......
......@@ -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)")
......
......@@ -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'
......
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