aboutsummaryrefslogtreecommitdiffstats
path: root/Parser.cpp
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2014-11-28 01:57:50 +0800
committerLefteris Karapetsas <lefteris@refu.co>2014-11-28 01:57:50 +0800
commite11e651929aaffe23d03b706c6770f92a57af6a6 (patch)
treea894081ede7ab5599d04db326be27619ff4d8684 /Parser.cpp
parent6ddfebafae2ec419ea40cd1907a700ba9812593c (diff)
downloaddexon-solidity-e11e651929aaffe23d03b706c6770f92a57af6a6.tar
dexon-solidity-e11e651929aaffe23d03b706c6770f92a57af6a6.tar.gz
dexon-solidity-e11e651929aaffe23d03b706c6770f92a57af6a6.tar.bz2
dexon-solidity-e11e651929aaffe23d03b706c6770f92a57af6a6.tar.lz
dexon-solidity-e11e651929aaffe23d03b706c6770f92a57af6a6.tar.xz
dexon-solidity-e11e651929aaffe23d03b706c6770f92a57af6a6.tar.zst
dexon-solidity-e11e651929aaffe23d03b706c6770f92a57af6a6.zip
Solidity work for documentation strings
- Still a work in progress - Parser now properly gets each function's doc comment - Small changes in the scanner - Multiline comments are considered
Diffstat (limited to 'Parser.cpp')
-rw-r--r--Parser.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Parser.cpp b/Parser.cpp
index 3cf44014..17fd2d78 100644
--- a/Parser.cpp
+++ b/Parser.cpp
@@ -118,6 +118,8 @@ ASTPointer<FunctionDefinition> Parser::parseFunctionDefinition(bool _isPublic)
{
ASTNodeFactory nodeFactory(*this);
expectToken(Token::FUNCTION);
+ std::string docstring = m_scanner->getCurrentCommentLiteral();
+ m_scanner->clearCurrentCommentLiteral();
ASTPointer<ASTString> name(expectIdentifierToken());
ASTPointer<ParameterList> parameters(parseParameterList());
bool isDeclaredConst = false;
@@ -142,7 +144,7 @@ ASTPointer<FunctionDefinition> Parser::parseFunctionDefinition(bool _isPublic)
}
ASTPointer<Block> block = parseBlock();
nodeFactory.setEndPositionFromNode(block);
- return nodeFactory.createNode<FunctionDefinition>(name, _isPublic, m_scanner->getCurrentCommentLiteral(),
+ return nodeFactory.createNode<FunctionDefinition>(name, _isPublic, docstring,
parameters,
isDeclaredConst, returnParameters, block);
}