diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2014-11-28 01:57:50 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2014-11-28 01:57:50 +0800 |
commit | e11e651929aaffe23d03b706c6770f92a57af6a6 (patch) | |
tree | a894081ede7ab5599d04db326be27619ff4d8684 /Parser.cpp | |
parent | 6ddfebafae2ec419ea40cd1907a700ba9812593c (diff) | |
download | dexon-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.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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); } |