mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add a missing DocStringParser error to tests.
This commit is contained in:
parent
a1c33249f1
commit
acd42a08c1
@ -94,19 +94,12 @@ void DocStringParser::parse(string const& _docString, ErrorReporter& _errorRepor
|
|||||||
{
|
{
|
||||||
// we found a tag
|
// we found a tag
|
||||||
auto tagNameEndPos = firstWhitespaceOrNewline(tagPos, end);
|
auto tagNameEndPos = firstWhitespaceOrNewline(tagPos, end);
|
||||||
if (tagNameEndPos == end)
|
auto tagName = string(tagPos + 1, tagNameEndPos);
|
||||||
{
|
auto tagDataPos = (tagNameEndPos != end) ? tagNameEndPos + 1 : tagNameEndPos;
|
||||||
m_errorReporter->docstringParsingError(
|
currPos = parseDocTag(tagDataPos, end, tagName);
|
||||||
9222_error,
|
|
||||||
"End of tag " + string(tagPos, tagNameEndPos) + " not found"
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
currPos = parseDocTag(tagNameEndPos + 1, end, string(tagPos + 1, tagNameEndPos));
|
|
||||||
}
|
}
|
||||||
else if (!!m_lastTag) // continuation of the previous tag
|
else if (!!m_lastTag) // continuation of the previous tag
|
||||||
currPos = appendDocTag(currPos, end);
|
currPos = parseDocTagLine(currPos, end, true);
|
||||||
else if (currPos != end)
|
else if (currPos != end)
|
||||||
{
|
{
|
||||||
// if it begins without a tag then consider it as @notice
|
// if it begins without a tag then consider it as @notice
|
||||||
@ -127,7 +120,7 @@ DocStringParser::iter DocStringParser::parseDocTagLine(iter _pos, iter _end, boo
|
|||||||
{
|
{
|
||||||
solAssert(!!m_lastTag, "");
|
solAssert(!!m_lastTag, "");
|
||||||
auto nlPos = find(_pos, _end, '\n');
|
auto nlPos = find(_pos, _end, '\n');
|
||||||
if (_appending && _pos < _end && *_pos != ' ' && *_pos != '\t')
|
if (_appending && _pos != _end && *_pos != ' ' && *_pos != '\t')
|
||||||
m_lastTag->content += " ";
|
m_lastTag->content += " ";
|
||||||
else if (!_appending)
|
else if (!_appending)
|
||||||
_pos = skipWhitespace(_pos, _end);
|
_pos = skipWhitespace(_pos, _end);
|
||||||
@ -179,13 +172,7 @@ DocStringParser::iter DocStringParser::parseDocTag(iter _pos, iter _end, string
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return appendDocTag(_pos, _end);
|
return parseDocTagLine(_pos, _end, true);
|
||||||
}
|
|
||||||
|
|
||||||
DocStringParser::iter DocStringParser::appendDocTag(iter _pos, iter _end)
|
|
||||||
{
|
|
||||||
solAssert(!!m_lastTag, "");
|
|
||||||
return parseDocTagLine(_pos, _end, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DocStringParser::newTag(string const& _tagName)
|
void DocStringParser::newTag(string const& _tagName)
|
||||||
|
@ -50,7 +50,6 @@ private:
|
|||||||
iter parseDocTagParam(iter _pos, iter _end);
|
iter parseDocTagParam(iter _pos, iter _end);
|
||||||
iter appendDocTagParam(iter _pos, iter _end);
|
iter appendDocTagParam(iter _pos, iter _end);
|
||||||
void parseDocString(std::string const& _string);
|
void parseDocString(std::string const& _string);
|
||||||
iter appendDocTag(iter _pos, iter _end);
|
|
||||||
/// Parses the doc tag named @a _tag, adds it to m_docTags and returns the position
|
/// Parses the doc tag named @a _tag, adds it to m_docTags and returns the position
|
||||||
/// after the tag.
|
/// after the tag.
|
||||||
iter parseDocTag(iter _pos, iter _end, std::string const& _tag);
|
iter parseDocTag(iter _pos, iter _end, std::string const& _tag);
|
||||||
|
@ -3,4 +3,4 @@ abstract contract C {
|
|||||||
function vote(uint id) public {}
|
function vote(uint id) public {}
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// DocstringParsingError 9222: End of tag @param not found
|
// DocstringParsingError 3335: No param name given
|
||||||
|
Loading…
Reference in New Issue
Block a user