Merge branch 'ignore-empty-doxygen-commands'
* ignore-empty-doxygen-commands: Fix incorrect warning "Unknown Doxygen command: ." Don't use invalid iterators in Doxygen command parsing code Conflicts: CHANGES.current
This commit is contained in:
commit
bff805dae5
4 changed files with 22 additions and 0 deletions
|
|
@ -7,6 +7,9 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/
|
||||||
Version 4.1.0 (in progress)
|
Version 4.1.0 (in progress)
|
||||||
===========================
|
===========================
|
||||||
|
|
||||||
|
2021-03-01: vadz
|
||||||
|
#1952 Fix incorrect warning "Unknown Doxygen command: ."
|
||||||
|
|
||||||
2021-02-28: p2k
|
2021-02-28: p2k
|
||||||
#969 [Javascript] v8/node - prevent crash calling a constructor without new keyword.
|
#969 [Javascript] v8/node - prevent crash calling a constructor without new keyword.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ enum SomeEnum
|
||||||
*/
|
*/
|
||||||
struct SomeStruct
|
struct SomeStruct
|
||||||
{
|
{
|
||||||
|
int width; ///< \**immutable** image width in pixels
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,12 @@ public class doxygen_parsing_runme {
|
||||||
" The struct comment \n" +
|
" The struct comment \n" +
|
||||||
" \n" +
|
" \n" +
|
||||||
"");
|
"");
|
||||||
|
wantedComments.put("doxygen_parsing.SomeStruct.setWidth(int)",
|
||||||
|
"**immutable** image width in pixels \n" +
|
||||||
|
"");
|
||||||
|
wantedComments.put("doxygen_parsing.SomeStruct.getWidth()",
|
||||||
|
"**immutable** image width in pixels \n" +
|
||||||
|
"");
|
||||||
wantedComments.put("doxygen_parsing.doxygen_parsing.setSomeVar(int)",
|
wantedComments.put("doxygen_parsing.doxygen_parsing.setSomeVar(int)",
|
||||||
" The var comment \n" +
|
" The var comment \n" +
|
||||||
" \n" +
|
" \n" +
|
||||||
|
|
|
||||||
|
|
@ -1081,6 +1081,13 @@ bool DoxygenParser::addDoxyCommand(DoxygenParser::TokenList &tokList, const std:
|
||||||
tokList.push_back(Token(COMMAND, cmd));
|
tokList.push_back(Token(COMMAND, cmd));
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
if (cmd.empty()) {
|
||||||
|
// This actually indicates a bug in the code in this file, as this
|
||||||
|
// function shouldn't be called at all in this case.
|
||||||
|
printListError(WARN_DOXYGEN_UNKNOWN_COMMAND, "Unexpected empty Doxygen command.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// This function is called for the special Doxygen commands, but also for
|
// This function is called for the special Doxygen commands, but also for
|
||||||
// HTML commands (or anything that looks like them, actually) and entities.
|
// HTML commands (or anything that looks like them, actually) and entities.
|
||||||
// We don't recognize all of those, so just ignore them and pass them
|
// We don't recognize all of those, so just ignore them and pass them
|
||||||
|
|
@ -1181,6 +1188,11 @@ void DoxygenParser::processWordCommands(size_t &pos, const std::string &line) {
|
||||||
size_t endOfWordPos = getEndOfWordCommand(line, pos);
|
size_t endOfWordPos = getEndOfWordCommand(line, pos);
|
||||||
|
|
||||||
string cmd = line.substr(pos, endOfWordPos - pos);
|
string cmd = line.substr(pos, endOfWordPos - pos);
|
||||||
|
if (cmd.empty()) {
|
||||||
|
// This was a bare backslash, just ignore it.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
addDoxyCommand(m_tokenList, cmd);
|
addDoxyCommand(m_tokenList, cmd);
|
||||||
|
|
||||||
// A flag for whether we want to skip leading spaces after the command
|
// A flag for whether we want to skip leading spaces after the command
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue