mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fixes Natspec parser error when whitespace is missing.
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
|
||||
#include <libsolidity/parsing/DocStringParser.h>
|
||||
|
||||
#include <liblangutil/Common.h>
|
||||
#include <liblangutil/ErrorReporter.h>
|
||||
#include <liblangutil/Exceptions.h>
|
||||
|
||||
@@ -39,12 +40,19 @@ string::const_iterator skipLineOrEOS(
|
||||
return (_nlPos == _end) ? _end : ++_nlPos;
|
||||
}
|
||||
|
||||
string::const_iterator firstSpaceOrTab(
|
||||
string::const_iterator firstNonIdentifier(
|
||||
string::const_iterator _pos,
|
||||
string::const_iterator _end
|
||||
)
|
||||
{
|
||||
return boost::range::find_first_of(make_pair(_pos, _end), " \t");
|
||||
auto currPos = _pos;
|
||||
if (currPos == _pos && isIdentifierStart(*currPos))
|
||||
{
|
||||
currPos++;
|
||||
while (currPos != _end && isIdentifierPart(*currPos))
|
||||
currPos++;
|
||||
}
|
||||
return currPos;
|
||||
}
|
||||
|
||||
string::const_iterator firstWhitespaceOrNewline(
|
||||
@@ -135,7 +143,7 @@ DocStringParser::iter DocStringParser::parseDocTagParam(iter _pos, iter _end)
|
||||
appendError("No param name given");
|
||||
return _end;
|
||||
}
|
||||
auto nameEndPos = firstSpaceOrTab(nameStartPos, _end);
|
||||
auto nameEndPos = firstNonIdentifier(nameStartPos, _end);
|
||||
auto paramName = string(nameStartPos, nameEndPos);
|
||||
|
||||
auto descStartPos = skipWhitespace(nameEndPos, _end);
|
||||
|
||||
Reference in New Issue
Block a user