From de502ca71fc1c20ed93209f6a223c488eee38297 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sun, 6 Apr 2014 20:47:42 +0200 Subject: Bug 678436 - Nested \if messes up list items Blank spaces after an if statement have to be removed as well. Just enable them as part of the parameter of the conditional expression and remove them later on (to be safe not having them in the parser). --- src/commentscan.l | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commentscan.l b/src/commentscan.l index 82afca5..8aa3c83 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -1836,7 +1836,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$" unput(*yytext); BEGIN(GuardParam); } -[a-z_A-Z0-9.\-]+ { // parameter of if/ifnot guard +{B}*[a-z_A-Z0-9.\-]+ { // parameter of if/ifnot guard handleGuard(yytext); } {DOCNL} { // end of argument @@ -3135,7 +3135,7 @@ static void groupAddDocs(Entry *e,const char *fileName) static void handleGuard(const QCString &expr) { CondParser prs; - bool sectionEnabled=prs.parse(yyFileName,yyLineNr,expr); + bool sectionEnabled=prs.parse(yyFileName,yyLineNr,expr.stripWhiteSpace()); bool parentEnabled = TRUE; if (!guards.isEmpty()) parentEnabled = guards.top()->isEnabled(); if (parentEnabled) -- cgit v0.12 From 7f4414b92a1c2147b073dd3cf58e0db7c8a88be6 Mon Sep 17 00:00:00 2001 From: albert-github Date: Mon, 7 Apr 2014 19:52:41 +0200 Subject: Bug 678436 - Nested \if messes up list items Blank spaces after an if statement have to be removed as well. Also spaces before the firs round bracket have to be removed. --- src/commentscan.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commentscan.l b/src/commentscan.l index 8aa3c83..4b25dff 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -1810,7 +1810,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$" /* ----- handle arguments of if/ifnot commands ------- */ -"(" { +{B}*"(" { g_guardExpr=yytext; g_roundCount=1; BEGIN(GuardExpr); -- cgit v0.12