From e662aa66b182288591b91b569710e8b7a629c828 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 12 Mar 2021 15:00:53 +0100 Subject: Usage of default lex rule with `\param` In case we have a file like ``` /// \file /// the fie /// \param /// arg the argument void fie(int arg); ``` we get in the console output extra empty lines, this is due to the fact that the default lex rule kicks in an the output is echoed to the consol. We have defined an explicit rule. --- src/commentscan.l | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/commentscan.l b/src/commentscan.l index 89b8052..16db2d6 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -1198,6 +1198,10 @@ STopt [^\n@\\]* "," { addOutput(yyscanner," , "); } +{DOCNL} { + if (*yytext=='\n') yyextra->lineNr++; + addOutput(yyscanner," "); + } {ID} { addOutput(yyscanner,yytext); BEGIN( Comment ); @@ -1897,6 +1901,10 @@ STopt [^\n@\\]* addOutput(yyscanner,yytext); } + /* +<*>. { fprintf(stderr,"Lex scanner %s %sdefault rule for state %s: #%s#\n", __FILE__,yyextra->fileName ? ("(" + yyextra->fileName +") ").data(): "",stateToString(YY_START),yytext);} +<*>\n { fprintf(stderr,"Lex scanner %s %sdefault rule newline for state %s.\n", __FILE__, yyextra->fileName ? ("(" + yyextra->fileName +") ").data(): "",stateToString(YY_START));} + */ %% -- cgit v0.12 From a4afb374c4aca216707f2e8ba2e4ccf98ef49b17 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sun, 14 Mar 2021 14:48:35 +0100 Subject: issue #8425 Would like a way to sort class list but not brief member list In the 1.9 series the sorting of the classes inside the namespaces was made dependent on the configuration setting `SORT_BRIEF_DOCS`, this is a regression compared to the 1.8.20 and earlier versions. (see also the discussion in the issue #8425) --- src/namespacedef.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp index 7acd463..4b44f5c 100644 --- a/src/namespacedef.cpp +++ b/src/namespacedef.cpp @@ -1337,23 +1337,19 @@ void NamespaceDefImpl::sortMemberLists() if (ml->needsSorting()) { ml->sort(); ml->setNeedsSorting(FALSE); } } - if (Config_getBool(SORT_BRIEF_DOCS)) + auto classComp = [](const ClassLinkedRefMap::Ptr &c1,const ClassLinkedRefMap::Ptr &c2) { - auto classComp = [](const ClassLinkedRefMap::Ptr &c1,const ClassLinkedRefMap::Ptr &c2) - { - return Config_getBool(SORT_BY_SCOPE_NAME) ? - qstricmp(c1->name(), c2->name())<0 : - qstricmp(c1->className(), c2->className())<0; - }; + return Config_getBool(SORT_BY_SCOPE_NAME) ? + qstricmp(c1->name(), c2->name())<0 : + qstricmp(c1->className(), c2->className())<0; + }; - std::sort(classes.begin(), classes.end(), classComp); - std::sort(interfaces.begin(),interfaces.end(),classComp); - std::sort(structs.begin(), structs.end(), classComp); - std::sort(exceptions.begin(),exceptions.end(),classComp); + std::sort(classes.begin(), classes.end(), classComp); + std::sort(interfaces.begin(),interfaces.end(),classComp); + std::sort(structs.begin(), structs.end(), classComp); + std::sort(exceptions.begin(),exceptions.end(),classComp); - } - // TODO: inconsistent: should be only done when SORT_BRIEF_DOCS is enabled... auto namespaceComp = [](const NamespaceLinkedRefMap::Ptr &n1,const NamespaceLinkedRefMap::Ptr &n2) { return qstricmp(n1->name(),n2->name())<0; -- cgit v0.12 From c16cda14f6234ce541d204be1267751f97a6f2a0 Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 14 Apr 2021 14:31:22 +0200 Subject: Coverity warnings Correcting new coverity warnings. - utf8.cpp is dead code. - template.cpp, made consistent with other render functions --- src/template.cpp | 1 + src/utf8.cpp | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) mode change 100644 => 100755 src/template.cpp diff --git a/src/template.cpp b/src/template.cpp old mode 100644 new mode 100755 index 5ae5881..2e8dc4f --- a/src/template.cpp +++ b/src/template.cpp @@ -4023,6 +4023,7 @@ class TemplateNodeCycle : public TemplateNodeCreator void render(TextStream &ts, TemplateContext *c) { TemplateContextImpl *ci = dynamic_cast(c); + if (ci==0) return; // should not happen ci->setLocation(m_templateName,m_line); if (m_index Date: Thu, 22 Apr 2021 14:37:17 +0200 Subject: No warning for incorrect ALIASES When having the alias: ``` "\latexonly mytable=\\mytable \endlatexonly" ``` the 1.9.1. version gave a warning: ``` error: Illegal ALIASES format '\latexonly mytable=\\mytable \endlatexonly'. Use "name=value" or "name{n}=value", where n is the number of arguments ``` though the current version doesn't give a warning, probably due to the regexp replacement. Now most likely the string found starts at `mytable=` The alias should start at the beginning of the string when searching. --- src/configimpl.l | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/configimpl.l b/src/configimpl.l index cae157b..b01ad38 100644 --- a/src/configimpl.l +++ b/src/configimpl.l @@ -1626,8 +1626,8 @@ void Config::checkAndCorrect() for (const auto &alias : aliasList) { // match aliases of the form re1='name=' and re2='name{2} =' - static const reg::Ex re1(R"(\a\w*\s*=)"); - static const reg::Ex re2(R"(\a\w*{\d+}\s*=)"); + static const reg::Ex re1(R"(^\a\w*\s*=)"); + static const reg::Ex re2(R"(^\a\w*{\d+}\s*=)"); if (!reg::search(alias,re1) && !reg::search(alias,re2)) { err("Illegal ALIASES format '%s'. Use \"name=value\" or \"name{n}=value\", where n is the number of arguments\n", -- cgit v0.12 From 453ecff58b2b2b447743af8890392060b5922dfc Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 23 Apr 2021 15:45:44 +0200 Subject: Problem with Fortran, giving a warning about invalid state Fortran gives a warning like ``` Error in file .../mic_lib.f90 line: 15, state: 4(SubprogBody) ``` This happens after the upade: ``` Commit: 592aaa4f17d73ec8c475df0f44efaea8cc4d575c [592aaa4] Date: Sunday, April 11, 2021 9:22:59 PM Commit Date: Thursday, April 22, 2021 7:34:13 PM Refactoring: remove implicit conversion from QCString to const char * ``` Looks like an initialization that was previously done automatic doesn't happen anymore. (Problem found by Fossies in openmpi, gcc, fimex). --- src/fortranscanner.l | 1 + 1 file changed, 1 insertion(+) diff --git a/src/fortranscanner.l b/src/fortranscanner.l index f36b6ae..328612a 100755 --- a/src/fortranscanner.l +++ b/src/fortranscanner.l @@ -378,6 +378,7 @@ SCOPENAME ({ID}{BS}"::"{BS})* if (YY_START != Prepass) { yyextra->comments.clear(); + yyextra->inputStringPrepass=QCString(); yy_push_state(Prepass,yyscanner); } -- cgit v0.12