Solidity FunctionDefinition used ASTString shared ptr for docstrings

This commit is contained in:
Lefteris Karapetsas
2014-11-28 01:26:37 +01:00
parent 034870b4c0
commit e3e90c4e6b
2 changed files with 16 additions and 7 deletions
+6 -2
View File
@@ -117,9 +117,13 @@ ASTPointer<ContractDefinition> Parser::parseContractDefinition()
ASTPointer<FunctionDefinition> Parser::parseFunctionDefinition(bool _isPublic)
{
ASTNodeFactory nodeFactory(*this);
ASTPointer<ASTString> docstring;
expectToken(Token::FUNCTION);
std::string docstring = m_scanner->getCurrentCommentLiteral();
m_scanner->clearCurrentCommentLiteral();
if (m_scanner->getCurrentCommentLiteral() != "")
{
docstring = std::make_shared<ASTString>(m_scanner->getCurrentCommentLiteral());
m_scanner->clearCurrentCommentLiteral();
}
ASTPointer<ASTString> name(expectIdentifierToken());
ASTPointer<ParameterList> parameters(parseParameterList());
bool isDeclaredConst = false;