Browse Source

Handle absence of Natspec doc and add option to solc

cl-refactor
Lefteris Karapetsas 10 years ago
parent
commit
93c488ce73
  1. 8
      libsolidity/CompilerStack.cpp
  2. 1
      solc/main.cpp

8
libsolidity/CompilerStack.cpp

@ -140,8 +140,12 @@ string const& CompilerStack::getDocumentation()
for (FunctionDefinition const* f: exportedFunctions)
{
Json::Value user;
user["user"] = Json::Value(*f->getDocumentation());
methods[f->getName()] = user;
auto strPtr = f->getDocumentation();
if (strPtr)
{
user["user"] = Json::Value(*strPtr);
methods[f->getName()] = user;
}
}
doc["methods"] = methods;
m_documentation = writer.write(doc);

1
solc/main.cpp

@ -136,6 +136,7 @@ int main(int argc, char** argv)
cout << eth::disassemble(compiler.getBytecode()) << endl;
cout << "Binary: " << toHex(compiler.getBytecode()) << endl;
cout << "Interface specification: " << compiler.getInterface() << endl;
cout << "Natspec documentation: " << compiler.getDocumentation() << endl;
return 0;
}

Loading…
Cancel
Save