Allow NatSpec documentation for local variable declarations

This won't be part of NatSpec JSON, but in AST, under the field documentation.
This commit is contained in:
hrkrshnn 2021-04-01 14:27:43 +02:00
parent 2856f56525
commit 39e3da1905

View File

@ -721,9 +721,6 @@ ASTPointer<VariableDeclaration> Parser::parseVariableDeclaration(
ASTPointer<TypeName> type = _lookAheadArrayType ? _lookAheadArrayType : parseTypeName();
nodeFactory.setEndPositionFromNode(type);
if (_options.kind == VarDeclKind::Other && documentation != nullptr)
parserError(2837_error, "Only state variables or file-level variables can have a docstring.");
if (dynamic_cast<FunctionTypeName*>(type.get()) && _options.kind == VarDeclKind::State && m_scanner->currentToken() == Token::LBrace)
fatalParserError(
2915_error,