diff options
author | chriseth <chris@ethereum.org> | 2018-07-13 00:42:30 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-13 00:42:30 +0800 |
commit | 6dcafac44e1dc6b6b75b61c65b3f55c4f2af8575 (patch) | |
tree | 08507ac1afa9ea8e0a50eb3c57f31299bf232e60 | |
parent | 81271801b4560c15911b69a9f6d7e0530359f523 (diff) | |
parent | a0d8459d95bd596f3087310a80bbaa1dcbe948de (diff) | |
download | dexon-solidity-6dcafac44e1dc6b6b75b61c65b3f55c4f2af8575.tar dexon-solidity-6dcafac44e1dc6b6b75b61c65b3f55c4f2af8575.tar.gz dexon-solidity-6dcafac44e1dc6b6b75b61c65b3f55c4f2af8575.tar.bz2 dexon-solidity-6dcafac44e1dc6b6b75b61c65b3f55c4f2af8575.tar.lz dexon-solidity-6dcafac44e1dc6b6b75b61c65b3f55c4f2af8575.tar.xz dexon-solidity-6dcafac44e1dc6b6b75b61c65b3f55c4f2af8575.tar.zst dexon-solidity-6dcafac44e1dc6b6b75b61c65b3f55c4f2af8575.zip |
Merge pull request #4447 from hosho/develop
Fix NatSpec json output for "@notice" and "@dev" tags on contract definitions
-rw-r--r-- | Changelog.md | 1 | ||||
-rw-r--r-- | libsolidity/interface/Natspec.cpp | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/Changelog.md b/Changelog.md index a7b452ac..094cdc0d 100644 --- a/Changelog.md +++ b/Changelog.md @@ -63,6 +63,7 @@ Compiler Features: Bugfixes: * Tests: Fix chain parameters to make ipc tests work with newer versions of cpp-ethereum. * Code Generator: Fix allocation of byte arrays (zeroed out too much memory). + * Fix NatSpec json output for `@notice` and `@dev` tags on contract definitions. * Type System: Allow arbitrary exponents for literals with a mantissa of zero. ### 0.4.24 (2018-05-16) 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()) { |