summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2021-02-17 19:03:27 (GMT)
committerGitHub <noreply@github.com>2021-02-17 19:03:27 (GMT)
commit47728ce3cc650409a331e66c1d246416b8bdce9a (patch)
tree783ecc3bc0bbe7c87a6b9e0c8738c6546ceccf45
parentd194196c2888d66990b880188ff45d8e06655e80 (diff)
parentbcf2920bf17beb1b943d8d3b50309fa185d8ba5b (diff)
downloadDoxygen-47728ce3cc650409a331e66c1d246416b8bdce9a.zip
Doxygen-47728ce3cc650409a331e66c1d246416b8bdce9a.tar.gz
Doxygen-47728ce3cc650409a331e66c1d246416b8bdce9a.tar.bz2
Merge pull request #8386 from albert-github/feature/bug_preprocessornolineno_2
Get preprocessor output without line numbers
-rw-r--r--doc/preprocessing.doc4
-rw-r--r--src/debug.cpp3
-rw-r--r--src/debug.h3
-rw-r--r--src/pre.l5
4 files changed, 11 insertions, 4 deletions
diff --git a/doc/preprocessing.doc b/doc/preprocessing.doc
index 4df83ff..34aa3ed 100644
--- a/doc/preprocessing.doc
+++ b/doc/preprocessing.doc
@@ -259,6 +259,10 @@ you can run doxygen as follows:
\verbatim
doxygen -d Preprocessor
\endverbatim
+or when the line numbers are not wanted:
+\verbatim
+ doxygen -d Preprocessor -d NoLineno
+\endverbatim
This will instruct doxygen to dump the input sources to standard output after
preprocessing has been done (Hint: set <code>QUIET = YES</code> and
<code>WARNINGS = NO</code> in the configuration file to disable any other
diff --git a/src/debug.cpp b/src/debug.cpp
index c270b47..bc5abb2 100644
--- a/src/debug.cpp
+++ b/src/debug.cpp
@@ -31,6 +31,7 @@ static std::map< std::string, Debug::DebugMask > s_labels =
{ "functions", Debug::Functions },
{ "variables", Debug::Variables },
{ "preprocessor", Debug::Preprocessor },
+ { "nolineno", Debug::NoLineNo },
{ "classes", Debug::Classes },
{ "commentcnv", Debug::CommentCnv },
{ "commentscan", Debug::CommentScan },
@@ -79,7 +80,7 @@ static int labelToEnumValue(const char *l)
int Debug::setFlag(const char *lab)
{
int retVal = labelToEnumValue(lab);
- curMask = (DebugMask)(curMask | labelToEnumValue(lab));
+ curMask = (DebugMask)(curMask | retVal);
return retVal;
}
diff --git a/src/debug.h b/src/debug.h
index e71595f..5d4717a 100644
--- a/src/debug.h
+++ b/src/debug.h
@@ -37,7 +37,8 @@ class Debug
Lex = 0x00002000,
Plantuml = 0x00004000,
FortranFixed2Free = 0x00008000,
- Cite = 0x00010000
+ Cite = 0x00010000,
+ NoLineNo = 0x00020000
};
static void print(DebugMask mask,int prio,const char *fmt,...);
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");