aboutsummaryrefslogtreecommitdiffstats
path: root/Parser.cpp
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2014-12-10 20:13:12 +0800
committerLefteris Karapetsas <lefteris@refu.co>2014-12-10 20:24:48 +0800
commitfbc35003cee590b24bbbf8b68dad1cf4a81073c5 (patch)
tree7e83f579f063575b58ca294a02e2dc21cb817717 /Parser.cpp
parent57e6827cb57708ed8f687bf9b0a304b1481cf742 (diff)
downloaddexon-solidity-fbc35003cee590b24bbbf8b68dad1cf4a81073c5.tar
dexon-solidity-fbc35003cee590b24bbbf8b68dad1cf4a81073c5.tar.gz
dexon-solidity-fbc35003cee590b24bbbf8b68dad1cf4a81073c5.tar.bz2
dexon-solidity-fbc35003cee590b24bbbf8b68dad1cf4a81073c5.tar.lz
dexon-solidity-fbc35003cee590b24bbbf8b68dad1cf4a81073c5.tar.xz
dexon-solidity-fbc35003cee590b24bbbf8b68dad1cf4a81073c5.tar.zst
dexon-solidity-fbc35003cee590b24bbbf8b68dad1cf4a81073c5.zip
Natspec title and author tag.
- Adding the title and author natspec documentation tags for contracts - Also using the author tag for functions now - Tests
Diffstat (limited to 'Parser.cpp')
-rw-r--r--Parser.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Parser.cpp b/Parser.cpp
index ddab489b..b678b2fc 100644
--- a/Parser.cpp
+++ b/Parser.cpp
@@ -112,6 +112,9 @@ ASTPointer<ImportDirective> Parser::parseImportDirective()
ASTPointer<ContractDefinition> Parser::parseContractDefinition()
{
ASTNodeFactory nodeFactory(*this);
+ ASTPointer<ASTString> docstring;
+ if (m_scanner->getCurrentCommentLiteral() != "")
+ docstring = make_shared<ASTString>(m_scanner->getCurrentCommentLiteral());
expectToken(Token::CONTRACT);
ASTPointer<ASTString> name = expectIdentifierToken();
expectToken(Token::LBRACE);
@@ -146,7 +149,7 @@ ASTPointer<ContractDefinition> Parser::parseContractDefinition()
}
nodeFactory.markEndPosition();
expectToken(Token::RBRACE);
- return nodeFactory.createNode<ContractDefinition>(name, structs, stateVariables, functions);
+ return nodeFactory.createNode<ContractDefinition>(name, docstring, structs, stateVariables, functions);
}
ASTPointer<FunctionDefinition> Parser::parseFunctionDefinition(bool _isPublic)