diff options
author | Yoichi Hirai <i@yoichihirai.com> | 2017-07-19 17:37:10 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-19 17:37:10 +0800 |
commit | 46d31f7179779087e2b7dfae1befef8f1975d128 (patch) | |
tree | 3ff9f31f19f6fdb4d764a8c3555cfcb5d9427314 /libsolidity/interface/CompilerStack.cpp | |
parent | 1a7b61ad05f77bcfaf8cdd16f648e429ab63e279 (diff) | |
parent | 5bb4bfb08b7157ef79aaa673881638c809adf6a7 (diff) | |
download | dexon-solidity-46d31f7179779087e2b7dfae1befef8f1975d128.tar dexon-solidity-46d31f7179779087e2b7dfae1befef8f1975d128.tar.gz dexon-solidity-46d31f7179779087e2b7dfae1befef8f1975d128.tar.bz2 dexon-solidity-46d31f7179779087e2b7dfae1befef8f1975d128.tar.lz dexon-solidity-46d31f7179779087e2b7dfae1befef8f1975d128.tar.xz dexon-solidity-46d31f7179779087e2b7dfae1befef8f1975d128.tar.zst dexon-solidity-46d31f7179779087e2b7dfae1befef8f1975d128.zip |
Merge pull request #2590 from ethereum/natspec-cleanup
Remove unneccesary interface from Natspec
Diffstat (limited to 'libsolidity/interface/CompilerStack.cpp')
-rw-r--r-- | libsolidity/interface/CompilerStack.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index e2507821..8b08377b 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -451,18 +451,20 @@ Json::Value const& CompilerStack::natspec(Contract const& _contract, Documentati { case DocumentationType::NatspecUser: doc = &_contract.userDocumentation; + // caches the result + if (!*doc) + doc->reset(new Json::Value(Natspec::userDocumentation(*_contract.contract))); break; case DocumentationType::NatspecDev: doc = &_contract.devDocumentation; + // caches the result + if (!*doc) + doc->reset(new Json::Value(Natspec::devDocumentation(*_contract.contract))); break; default: BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Illegal documentation type.")); } - // caches the result - if (!*doc) - doc->reset(new Json::Value(Natspec::documentation(*_contract.contract, _type))); - return *(*doc); } |