mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #3730 from ethereum/docstringBug
DocStringParser: Fix error message for empty parameter description.
This commit is contained in:
commit
c3f07b5294
@ -6,6 +6,7 @@ Bugfixes:
|
|||||||
* Code Generator: Properly skip unneeded storgae array cleanup when not reducing length.
|
* Code Generator: Properly skip unneeded storgae array cleanup when not reducing length.
|
||||||
* Commandline interface: Support ``--evm-version constantinople`` properly.
|
* Commandline interface: Support ``--evm-version constantinople`` properly.
|
||||||
* Standard JSON: Support ``constantinople`` as ``evmVersion`` properly.
|
* Standard JSON: Support ``constantinople`` as ``evmVersion`` properly.
|
||||||
|
* DocString Parser: Fix error message for empty descriptions.
|
||||||
|
|
||||||
### 0.4.21 (2018-03-07)
|
### 0.4.21 (2018-03-07)
|
||||||
|
|
||||||
|
@ -119,21 +119,17 @@ DocStringParser::iter DocStringParser::parseDocTagParam(iter _pos, iter _end)
|
|||||||
return _end;
|
return _end;
|
||||||
}
|
}
|
||||||
auto nameEndPos = firstSpaceOrTab(nameStartPos, _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 paramName = string(nameStartPos, nameEndPos);
|
||||||
|
|
||||||
auto descStartPos = skipWhitespace(nameEndPos, _end);
|
auto descStartPos = skipWhitespace(nameEndPos, _end);
|
||||||
if (descStartPos == _end)
|
auto nlPos = find(descStartPos, _end, '\n');
|
||||||
|
|
||||||
|
if (descStartPos == nlPos)
|
||||||
{
|
{
|
||||||
appendError("No description given for param " + paramName);
|
appendError("No description given for param " + paramName);
|
||||||
return _end;
|
return _end;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto nlPos = find(descStartPos, _end, '\n');
|
|
||||||
auto paramDesc = string(descStartPos, nlPos);
|
auto paramDesc = string(descStartPos, nlPos);
|
||||||
newTag("param");
|
newTag("param");
|
||||||
m_lastTag->paramName = paramName;
|
m_lastTag->paramName = paramName;
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
contract C {
|
||||||
|
/// @param id
|
||||||
|
function vote(uint id) public;
|
||||||
|
}
|
||||||
|
// ----
|
||||||
|
// DocstringParsingError: No description given for param id
|
Loading…
Reference in New Issue
Block a user