diff options
author | Matt Little <zone117x@gmail.com> | 2018-07-06 06:29:13 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-07-12 20:39:13 +0800 |
commit | 4efe3544f77c28853f657254269715c51933d894 (patch) | |
tree | 5ce0ea5eaaf885decbf9e3228dff91f04958954f /libsolidity/interface | |
parent | fa8102880f87c5a2806d59f959fd3e8a62dd4dc9 (diff) | |
download | dexon-solidity-4efe3544f77c28853f657254269715c51933d894.tar dexon-solidity-4efe3544f77c28853f657254269715c51933d894.tar.gz dexon-solidity-4efe3544f77c28853f657254269715c51933d894.tar.bz2 dexon-solidity-4efe3544f77c28853f657254269715c51933d894.tar.lz dexon-solidity-4efe3544f77c28853f657254269715c51933d894.tar.xz dexon-solidity-4efe3544f77c28853f657254269715c51933d894.tar.zst dexon-solidity-4efe3544f77c28853f657254269715c51933d894.zip |
Fix NatSpec json output for "@notice" and "@dev" tags on contract definitions.
Diffstat (limited to 'libsolidity/interface')
-rw-r--r-- | libsolidity/interface/Natspec.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libsolidity/interface/Natspec.cpp b/libsolidity/interface/Natspec.cpp index 7f7084ef..29a5b798 100644 --- a/libsolidity/interface/Natspec.cpp +++ b/libsolidity/interface/Natspec.cpp @@ -36,6 +36,10 @@ Json::Value Natspec::userDocumentation(ContractDefinition const& _contractDef) Json::Value doc; Json::Value methods(Json::objectValue); + string notice = extractDoc(_contractDef.annotation().docTags, "notice"); + if (!notice.empty()) + doc["notice"] = Json::Value(notice); + for (auto const& it: _contractDef.interfaceFunctions()) if (it.second->hasDeclaration()) if (auto const* f = dynamic_cast<FunctionDefinition const*>(&it.second->declaration())) @@ -65,6 +69,9 @@ Json::Value Natspec::devDocumentation(ContractDefinition const& _contractDef) auto title = extractDoc(_contractDef.annotation().docTags, "title"); if (!title.empty()) doc["title"] = title; + auto dev = extractDoc(_contractDef.annotation().docTags, "dev"); + if (!dev.empty()) + doc["details"] = Json::Value(dev); for (auto const& it: _contractDef.interfaceFunctions()) { |