From ac3ad1e58da96a28cb09cb9fab5b34837bc1c292 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Tue, 7 Jan 2020 21:06:57 +0100 Subject: Fix for removed spaces in certain \if \else \endif constructs --- src/commentscan.l | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/commentscan.l b/src/commentscan.l index 02117c2..fbcd089 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -2417,6 +2417,7 @@ static bool handleElseIf(yyscan_t yyscanner,const QCString &, const QCStringList else { yyextra->guardType = yyextra->enabledSectionFound ? Guard_Skip : Guard_If; + yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd; BEGIN(GuardParam); } return FALSE; @@ -2432,6 +2433,7 @@ static bool handleElse(yyscan_t yyscanner,const QCString &, const QCStringList & } else { + yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd; BEGIN( SkipGuardedSection ); } return FALSE; -- cgit v0.12 From b47de248b2c4d54bd83a4c679fa6a58dbaf3fe11 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Tue, 14 Jan 2020 21:07:06 +0100 Subject: Updated test 024 to better test spacing behaviour. --- testing/024/indexpage.xml | 16 +++++++++++++++- testing/024_if.dox | 20 ++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/testing/024/indexpage.xml b/testing/024/indexpage.xml index 7396177..fd94e77 100644 --- a/testing/024/indexpage.xml +++ b/testing/024/indexpage.xml @@ -6,7 +6,21 @@ - Unconditional (start) Enabled (if). Enabled (else). Unconditional (middle) Enabled (else). Unconditional (end) + Unconditional (start) Enabled (if). Enabled (else). Unconditional (middle) Enabled (else). Unconditional (end) + + with spaces + test1 test3 test4. + test1 test2 test4. + test1 test2 test3. + test1 test3. + + + without spaces + test1test3test4. + test1test2test4. + test1test2test3. + test1test3. + diff --git a/testing/024_if.dox b/testing/024_if.dox index f24be43..281ffe5 100644 --- a/testing/024_if.dox +++ b/testing/024_if.dox @@ -18,4 +18,24 @@ * Enabled (else). * \endif * Unconditional (end) + * + * # with spaces + * + * test1 \ifnot GUARD_ENABLED test2 \else test3 \endif test4. + * + * test1 \if GUARD_ENABLED test2 \else test3 \endif test4. + * + * test1 \if GUARD_ENABLED test2 \endif test3. + * + * test1 \if NOT_ENABLED test2 \endif test3. + * + * # without spaces + * + * test1\ifnot GUARD_ENABLED test2\else test3\endif test4. + * + * test1\if GUARD_ENABLED test2\else test3\endif test4. + * + * test1\if GUARD_ENABLED test2\endif test3. + * + * test1\if NOT_ENABLED test2\endif test3. */ -- cgit v0.12