I'm trying to use the GCC Preprocessor with Javascript source code.
I would like achieve the output below from this input:
Line 1
Line 2 #define ASDF 'asdf'
Line 3
Line 4 var asdf = ASDF
Output:
Line 1
Line 2
Line 3
Line 4 var asdf = 'asdf'
How could I achieve the above?
So far I have tried:
/usr/bin/cpp -P -undef -Wundef -std=c99 -nostdinc -Wtrigraphs -fdollars-in-identifiers -traditional-cpp -E -C $INFILE -o $OUTFILE
The -traditional-cpp
preserves whitespace, and the -E
preserves comments.
Is it possible to replace all lines with preprocessor directives with empty lines?