mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Adressing some natspec issues
This commit is contained in:
parent
a6b0fba227
commit
d97bdba471
@ -170,7 +170,7 @@ std::string::const_iterator InterfaceHandler::parseDocTagLine(std::string::const
|
||||
bool _appending)
|
||||
{
|
||||
auto nlPos = std::find(_pos, _end, '\n');
|
||||
if (_appending && *_pos != ' ')
|
||||
if (_appending && _pos < _end && *_pos != ' ')
|
||||
_tagString += " ";
|
||||
std::copy(_pos, nlPos, back_inserter(_tagString));
|
||||
m_lastTag = _tagType;
|
||||
@ -204,7 +204,7 @@ std::string::const_iterator InterfaceHandler::appendDocTagParam(std::string::con
|
||||
solAssert(!m_params.empty(), "Internal: Tried to append to empty parameter");
|
||||
|
||||
auto pair = m_params.back();
|
||||
if (*_pos != ' ')
|
||||
if (_pos < _end && *_pos != ' ')
|
||||
pair.second += " ";
|
||||
auto nlPos = std::find(_pos, _end, '\n');
|
||||
std::copy(_pos, nlPos, back_inserter(pair.second));
|
||||
|
@ -328,6 +328,7 @@ Token::Value Scanner::scanMultiLineDocComment()
|
||||
|
||||
void Scanner::scanToken()
|
||||
{
|
||||
int savedPosition;
|
||||
m_nextToken.literal.clear();
|
||||
m_nextSkippedComment.literal.clear();
|
||||
Token::Value token;
|
||||
@ -428,6 +429,7 @@ void Scanner::scanToken()
|
||||
break;
|
||||
case '/':
|
||||
// / // /* /=
|
||||
savedPosition = getSourcePos();
|
||||
advance();
|
||||
if (m_char == '/')
|
||||
{
|
||||
@ -436,7 +438,7 @@ void Scanner::scanToken()
|
||||
else if (m_char == '/')
|
||||
{
|
||||
Token::Value comment;
|
||||
m_nextSkippedComment.location.start = getSourcePos();
|
||||
m_nextSkippedComment.location.start = savedPosition;
|
||||
comment = scanSingleLineDocComment();
|
||||
m_nextSkippedComment.location.end = getSourcePos();
|
||||
m_nextSkippedComment.token = comment;
|
||||
@ -447,12 +449,13 @@ void Scanner::scanToken()
|
||||
}
|
||||
else if (m_char == '*')
|
||||
{
|
||||
// /** doxygent style natspec comment
|
||||
if (!advance()) /* slash star comment before EOS */
|
||||
token = Token::WHITESPACE;
|
||||
else if (m_char == '*')
|
||||
{
|
||||
Token::Value comment;
|
||||
m_nextSkippedComment.location.start = getSourcePos();
|
||||
m_nextSkippedComment.location.start = savedPosition;
|
||||
comment = scanMultiLineDocComment();
|
||||
m_nextSkippedComment.location.end = getSourcePos();
|
||||
m_nextSkippedComment.token = comment;
|
||||
|
Loading…
Reference in New Issue
Block a user