MCPcopy Create free account
hub / github.com/argotorg/solidity / checkParameters

Method checkParameters

libsolidity/analysis/DocStringTagParser.cpp:247–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

245}
246
247void DocStringTagParser::checkParameters(
248 CallableDeclaration const& _callable,
249 StructurallyDocumented const& _node,
250 StructurallyDocumentedAnnotation& _annotation
251)
252{
253 std::set<std::string> validParams;
254 for (auto const& p: _callable.parameters())
255 validParams.insert(p->name());
256 if (_callable.returnParameterList())
257 for (auto const& p: _callable.returnParameterList()->parameters())
258 validParams.insert(p->name());
259 auto paramRange = _annotation.docTags.equal_range("param");
260 for (auto i = paramRange.first; i != paramRange.second; ++i)
261 if (!validParams.count(i->second.paramName))
262 m_errorReporter.docstringParsingError(
263 3881_error,
264 _node.documentation()->location(),
265 "Documented parameter \"" +
266 i->second.paramName +
267 "\" not found in the parameter list of the function."
268 );
269}
270
271void DocStringTagParser::handleConstructor(
272 CallableDeclaration const& _callable,

Callers

nothing calls this directly

Calls 7

parametersMethod · 0.80
insertMethod · 0.80
docstringParsingErrorMethod · 0.80
documentationMethod · 0.80
nameMethod · 0.45
countMethod · 0.45
locationMethod · 0.45

Tested by

no test coverage detected