diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2014-12-05 19:27:18 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2014-12-05 19:27:18 +0800 |
commit | 27ef18865d4014e50e917674cf4a7444b7f5565a (patch) | |
tree | 87d9be32149a3705fcaeb80e466b8b192b5f04da /InterfaceHandler.cpp | |
parent | 11cac68cf4e72d222da015f1aaa0bd6ce4fd7e62 (diff) | |
download | dexon-solidity-27ef18865d4014e50e917674cf4a7444b7f5565a.tar.gz dexon-solidity-27ef18865d4014e50e917674cf4a7444b7f5565a.tar.zst dexon-solidity-27ef18865d4014e50e917674cf4a7444b7f5565a.zip |
Newline right after doctag is now a valid natspec entry
- Plus tests for that
Diffstat (limited to 'InterfaceHandler.cpp')
-rw-r--r-- | InterfaceHandler.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/InterfaceHandler.cpp b/InterfaceHandler.cpp index ca02cc37..0115c7f5 100644 --- a/InterfaceHandler.cpp +++ b/InterfaceHandler.cpp @@ -137,8 +137,8 @@ void InterfaceHandler::resetDev() m_params.clear(); } -std::string::const_iterator skipLineOrEOS(std::string::const_iterator _nlPos, - std::string::const_iterator _end) +static inline std::string::const_iterator skipLineOrEOS(std::string::const_iterator _nlPos, + std::string::const_iterator _end) { return (_nlPos == _end) ? _end : ++_nlPos; } @@ -239,6 +239,14 @@ std::string::const_iterator InterfaceHandler::appendDocTag(std::string::const_it } } +static inline std::string::const_iterator getFirstSpaceOrNl(std::string::const_iterator _pos, + std::string::const_iterator _end) +{ + auto spacePos = std::find(_pos, _end, ' '); + auto nlPos = std::find(_pos, _end, '\n'); + return (spacePos < nlPos) ? spacePos : nlPos; +} + void InterfaceHandler::parseDocString(std::string const& _string) { auto currPos = _string.begin(); @@ -252,7 +260,7 @@ void InterfaceHandler::parseDocString(std::string const& _string) if (tagPos != end && tagPos < nlPos) { // we found a tag - auto tagNameEndPos = std::find(tagPos, end, ' '); + auto tagNameEndPos = getFirstSpaceOrNl(tagPos, end); if (tagNameEndPos == end) BOOST_THROW_EXCEPTION(DocstringParsingError() << errinfo_comment("End of tag " + std::string(tagPos, tagNameEndPos) + "not found")); |