summaryrefslogtreecommitdiffstats
path: root/src
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 /src
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
Diffstat (limited to 'src')
-rw-r--r--src/debug.cpp3
-rw-r--r--src/debug.h3
-rw-r--r--src/pre.l5
3 files changed, 7 insertions, 4 deletions
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");