improved comment formatting for Python
This commit is contained in:
parent
1883797742
commit
29d1bba70a
10 changed files with 213 additions and 140 deletions
|
|
@ -1247,6 +1247,16 @@ void DoxygenParser::tokenizeDoxygenComment(const std::string &doxygenComment,
|
|||
|
||||
StringVector lines = split(doxygenComment, '\n');
|
||||
|
||||
// remove trailing spaces, because they cause additional new line at the end
|
||||
// comment, which is wrong, because these spaces are space preceding
|
||||
// end of comment : ' */'
|
||||
if (!doxygenComment.empty() && doxygenComment[doxygenComment.size() - 1] == ' ') {
|
||||
string lastLine = lines[lines.size() - 1];
|
||||
if (trim(lastLine).empty()) {
|
||||
lines.pop_back(); // remove trailing empy line
|
||||
}
|
||||
}
|
||||
|
||||
for (StringVectorCIt it = lines.begin(); it != lines.end(); it++) {
|
||||
const string &line = *it;
|
||||
size_t pos = line.find_first_not_of(" \t");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue