DocStringParser: Fix error message for empty parameter description.

This commit is contained in:
Daniel Kirchner 2018-03-14 09:55:04 +01:00
parent 032ea9bc5b
commit 0d0c9b8688

View File

@ -119,21 +119,17 @@ DocStringParser::iter DocStringParser::parseDocTagParam(iter _pos, iter _end)
return _end;
}
auto nameEndPos = firstSpaceOrTab(nameStartPos, _end);
if (nameEndPos == _end)
{
appendError("End of param name not found: " + string(nameStartPos, _end));
return _end;
}
auto paramName = string(nameStartPos, nameEndPos);
auto descStartPos = skipWhitespace(nameEndPos, _end);
if (descStartPos == _end)
auto nlPos = find(descStartPos, _end, '\n');
if (descStartPos == nlPos)
{
appendError("No description given for param " + paramName);
return _end;
}
auto nlPos = find(descStartPos, _end, '\n');
auto paramDesc = string(descStartPos, nlPos);
newTag("param");
m_lastTag->paramName = paramName;