aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/parsing/DocStringParser.cpp
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-03-14 16:55:04 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-03-14 17:14:35 +0800
commit0d0c9b868817bad17968f9c23bce5d3844a5971c (patch)
tree19be73145ecb04d0b7f14b1dd99a68901054286a /libsolidity/parsing/DocStringParser.cpp
parent032ea9bc5ba0e0d46deb2620934500071f31e3de (diff)
downloaddexon-solidity-0d0c9b868817bad17968f9c23bce5d3844a5971c.tar.gz
dexon-solidity-0d0c9b868817bad17968f9c23bce5d3844a5971c.tar.zst
dexon-solidity-0d0c9b868817bad17968f9c23bce5d3844a5971c.zip
DocStringParser: Fix error message for empty parameter description.
Diffstat (limited to 'libsolidity/parsing/DocStringParser.cpp')
-rw-r--r--libsolidity/parsing/DocStringParser.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/libsolidity/parsing/DocStringParser.cpp b/libsolidity/parsing/DocStringParser.cpp
index 0409de72..d058d556 100644
--- a/libsolidity/parsing/DocStringParser.cpp
+++ b/libsolidity/parsing/DocStringParser.cpp
@@ -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;