From f7663cf300375b4ec8d8fe052f3da48782743919 Mon Sep 17 00:00:00 2001 From: albert-github Date: Mon, 7 May 2018 15:59:33 +0200 Subject: Problem with \cond in normal comment of test 015 In the \cond is also recognized in non-doxygen comment. - As a work around the \ has been removed - in case of e.g. pdf the enabled function is not shown as it does not have a doxygen comment - test file output update due to change in input code. - pre.l and commentcnv.l. better error message i.e. showing better the used condition --- src/commentcnv.l | 2 +- src/pre.l | 2 +- testing/015/015__cond_8c.xml | 4 +++- testing/015_cond.c | 4 +++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/commentcnv.l b/src/commentcnv.l index 89d2fea..10dab28 100644 --- a/src/commentcnv.l +++ b/src/commentcnv.l @@ -1068,7 +1068,7 @@ void convertCppComments(BufStr *inBuf,BufStr *outBuf,const char *fileName) { CondCtx *ctx = g_condStack.pop(); QCString sectionInfo = " "; - if (ctx->sectionId!=" ") sectionInfo.sprintf(" with label %s ",ctx->sectionId.data()); + if (ctx->sectionId!=" ") sectionInfo.sprintf(" with label '%s' ",ctx->sectionId.stripWhiteSpace().data()); warn(g_fileName,ctx->lineNr,"Conditional section%sdoes not have " "a corresponding \\endcond command within this file.",sectionInfo.data()); } diff --git a/src/pre.l b/src/pre.l index bf1ec9b..37f7115 100644 --- a/src/pre.l +++ b/src/pre.l @@ -3195,7 +3195,7 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output) { CondCtx *ctx = g_condStack.pop(); QCString sectionInfo = " "; - if (ctx->sectionId!=" ") sectionInfo.sprintf(" with label %s ",ctx->sectionId.data()); + if (ctx->sectionId!=" ") sectionInfo.sprintf(" with label '%s' ",ctx->sectionId.stripWhiteSpace().data()); warn(fileName,ctx->lineNr,"Conditional section%sdoes not have " "a corresponding \\endcond command within this file.",sectionInfo.data()); delete ctx; diff --git a/testing/015/015__cond_8c.xml b/testing/015/015__cond_8c.xml index 43cf335..bcc18b5 100644 --- a/testing/015/015__cond_8c.xml +++ b/testing/015/015__cond_8c.xml @@ -11,15 +11,17 @@ + Function to be shown. - + + Text argument more text. diff --git a/testing/015_cond.c b/testing/015_cond.c index ab3044c..0ac209d 100644 --- a/testing/015_cond.c +++ b/testing/015_cond.c @@ -1,4 +1,4 @@ -// objective: test the \cond command +// objective: test the `cond` command // check: 015__cond_8c.xml // config: ENABLED_SECTIONS = COND_ENABLED @@ -17,12 +17,14 @@ void func(); /// \endcond /// \cond COND_ENABLED +/// Function to be shown. void cond_enabled() { } /// \endcond /** \cond COND_DISABLED */ + Function not to be shown. void cond_disabled() { } -- cgit v0.12