mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Solidity natspec docstring test improvements
- Adding a test for docstring being between function signature and function body - Properly checking for exceptions in parsing - Small parser fix
This commit is contained in:
parent
e3e90c4e6b
commit
db7b118ece
@ -118,12 +118,12 @@ ASTPointer<FunctionDefinition> Parser::parseFunctionDefinition(bool _isPublic)
|
|||||||
{
|
{
|
||||||
ASTNodeFactory nodeFactory(*this);
|
ASTNodeFactory nodeFactory(*this);
|
||||||
ASTPointer<ASTString> docstring;
|
ASTPointer<ASTString> docstring;
|
||||||
expectToken(Token::FUNCTION);
|
|
||||||
if (m_scanner->getCurrentCommentLiteral() != "")
|
if (m_scanner->getCurrentCommentLiteral() != "")
|
||||||
{
|
{
|
||||||
docstring = std::make_shared<ASTString>(m_scanner->getCurrentCommentLiteral());
|
docstring = std::make_shared<ASTString>(m_scanner->getCurrentCommentLiteral());
|
||||||
m_scanner->clearCurrentCommentLiteral();
|
m_scanner->clearCurrentCommentLiteral();
|
||||||
}
|
}
|
||||||
|
expectToken(Token::FUNCTION);
|
||||||
ASTPointer<ASTString> name(expectIdentifierToken());
|
ASTPointer<ASTString> name(expectIdentifierToken());
|
||||||
ASTPointer<ParameterList> parameters(parseParameterList());
|
ASTPointer<ParameterList> parameters(parseParameterList());
|
||||||
bool isDeclaredConst = false;
|
bool isDeclaredConst = false;
|
||||||
|
@ -109,8 +109,7 @@ public:
|
|||||||
class LiteralScope
|
class LiteralScope
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit LiteralScope(Scanner* _self, enum LiteralType _type)
|
explicit LiteralScope(Scanner* _self, enum LiteralType _type): m_type(_type)
|
||||||
: m_type(_type)
|
|
||||||
, m_scanner(_self)
|
, m_scanner(_self)
|
||||||
, m_complete(false)
|
, m_complete(false)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user