summaryrefslogtreecommitdiffstats
path: root/src/pre.l
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2021-02-16 10:44:05 (GMT)
committeralbert-github <albert.tests@gmail.com>2021-02-16 10:44:05 (GMT)
commit9e4d6df2e549c2251d2bd3a88431cec0b262fad8 (patch)
tree41a50f46efdfbf0964d043ce88a71ad60a43b623 /src/pre.l
parenta136cfef5489af08ada5ed8c928a5876133b9f3e (diff)
downloadDoxygen-9e4d6df2e549c2251d2bd3a88431cec0b262fad8.zip
Doxygen-9e4d6df2e549c2251d2bd3a88431cec0b262fad8.tar.gz
Doxygen-9e4d6df2e549c2251d2bd3a88431cec0b262fad8.tar.bz2
Get preprocessor output without line numbers
For easier comparison of the original source with a doxygen preprocessed source the line numbers can be a bit of an obstacle. To remove the line numbers in the preprocessor output the option `NoLineno` has been added. (In case `Preprocessor` is not invoked, `NoLineno` has no effect).
Diffstat (limited to 'src/pre.l')
-rw-r--r--src/pre.l5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pre.l b/src/pre.l
index e817a9d..21746a0 100644
--- a/src/pre.l
+++ b/src/pre.l
@@ -3390,11 +3390,12 @@ void Preprocessor::processFile(const char *fileName,BufStr &input,BufStr &output
char *newPos=output.data()+output.curPos();
Debug::print(Debug::Preprocessor,0,"Preprocessor output of %s (size: %d bytes):\n",fileName,newPos-orgPos);
int line=1;
- Debug::print(Debug::Preprocessor,0,"---------\n00001 ");
+ Debug::print(Debug::Preprocessor,0,"---------\n");
+ if (!Debug::isFlagSet(Debug::NoLineNo)) Debug::print(Debug::Preprocessor,0,"00001 ");
while (orgPos<newPos)
{
putchar(*orgPos);
- if (*orgPos=='\n') Debug::print(Debug::Preprocessor,0,"%05d ",++line);
+ if (*orgPos=='\n' && !Debug::isFlagSet(Debug::NoLineNo)) Debug::print(Debug::Preprocessor,0,"%05d ",++line);
orgPos++;
}
Debug::print(Debug::Preprocessor,0,"\n---------\n");