Doxygen comment parsing fix for empty lines in code/verbatim blocks

Fix how end of paragraph is identified when parsing \code and
\verbatim blocks that appear within a paragraph and contain an empty
line.  Previously this would generate a warning for unexpected end of
doxygen comments, and it could generate a segfault due to
dereferencing an invalid iterator value.

The doxygen_basic_translate.i and doxygen_basic_translate_style2.i
tests have been updated to serve as regression tests for this
behavior.  Prior to this fix, inclusion of the empty code block line
in this context produced a segfault.
This commit is contained in:
John McFarland 2019-06-01 14:02:45 -05:00
commit 85a4c7ffc0
7 changed files with 24 additions and 0 deletions

View file

@ -50,6 +50,8 @@ Warning: This may not work as expected
.. code-block:: c++
int main() { while(true); }
// Test blank line in code block
}"""
)
comment_verifier.check(inspect.getdoc(doxygen_basic_translate.function5),

View file

@ -48,6 +48,8 @@ Warning: This may not work as expected
.. code-block:: c++
int main() { while(true); }
// Test blank line in code block
}"""
)
comment_verifier.check(inspect.getdoc(doxygen_basic_translate_style2.function5),