mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Allow natspec comments on state variables.
This commit is contained in:
@@ -686,7 +686,7 @@ ASTPointer<VariableDeclaration> Parser::parseVariableDeclaration(
|
||||
ASTNodeFactory nodeFactory = _lookAheadArrayType ?
|
||||
ASTNodeFactory(*this, _lookAheadArrayType) : ASTNodeFactory(*this);
|
||||
ASTPointer<TypeName> type;
|
||||
ASTPointer<StructuredDocumentation> documentation = parseStructuredDocumentation();
|
||||
ASTPointer<StructuredDocumentation> const documentation = parseStructuredDocumentation();
|
||||
if (_lookAheadArrayType)
|
||||
type = _lookAheadArrayType;
|
||||
else
|
||||
@@ -696,8 +696,8 @@ ASTPointer<VariableDeclaration> Parser::parseVariableDeclaration(
|
||||
nodeFactory.setEndPositionFromNode(type);
|
||||
}
|
||||
|
||||
// if (!_options.isStateVariable && documentation != nullptr)
|
||||
// fatalParserError("Only state variables can retrieve a docstring.");
|
||||
if (!_options.isStateVariable && documentation != nullptr)
|
||||
parserWarning(2837_error, "Only state variables can have a docstring. This will be disallowed in 0.7.0.");
|
||||
|
||||
if (dynamic_cast<FunctionTypeName*>(type.get()) && _options.isStateVariable && m_scanner->currentToken() == Token::LBrace)
|
||||
fatalParserError(
|
||||
@@ -813,7 +813,7 @@ ASTPointer<VariableDeclaration> Parser::parseVariableDeclaration(
|
||||
identifier,
|
||||
value,
|
||||
visibility,
|
||||
documentation,
|
||||
documentation,
|
||||
_options.isStateVariable,
|
||||
isIndexed,
|
||||
mutability,
|
||||
@@ -1579,8 +1579,7 @@ ASTPointer<VariableDeclarationStatement> Parser::parseVariableDeclarationStateme
|
||||
ASTPointer<TypeName>(),
|
||||
name,
|
||||
ASTPointer<Expression>(),
|
||||
Visibility::Default,
|
||||
nullptr
|
||||
Visibility::Default
|
||||
);
|
||||
}
|
||||
variables.push_back(var);
|
||||
|
||||
Reference in New Issue
Block a user