mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
- removed unnesessary braces but one in if statement is still there because of warrning about ambiguous "else"
- added marking of position in node factory to the function Conflicts: libsolidity/Parser.cpp
This commit is contained in:
parent
2a5c2578bd
commit
bcccfa8805
3
AST.cpp
3
AST.cpp
@ -60,7 +60,6 @@ void ContractDefinition::checkTypeRequirements()
|
|||||||
|
|
||||||
FunctionDefinition const* fallbackFunction = nullptr;
|
FunctionDefinition const* fallbackFunction = nullptr;
|
||||||
for (ASTPointer<FunctionDefinition> const& function: getDefinedFunctions())
|
for (ASTPointer<FunctionDefinition> const& function: getDefinedFunctions())
|
||||||
{
|
|
||||||
if (function->getName().empty())
|
if (function->getName().empty())
|
||||||
{
|
{
|
||||||
if (fallbackFunction)
|
if (fallbackFunction)
|
||||||
@ -72,8 +71,6 @@ void ContractDefinition::checkTypeRequirements()
|
|||||||
BOOST_THROW_EXCEPTION(fallbackFunction->getParameterList().createTypeError("Fallback function cannot take parameters."));
|
BOOST_THROW_EXCEPTION(fallbackFunction->getParameterList().createTypeError("Fallback function cannot take parameters."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
for (ASTPointer<ModifierDefinition> const& modifier: getFunctionModifiers())
|
for (ASTPointer<ModifierDefinition> const& modifier: getFunctionModifiers())
|
||||||
modifier->checkTypeRequirements();
|
modifier->checkTypeRequirements();
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ ASTPointer<InheritanceSpecifier> Parser::parseInheritanceSpecifier()
|
|||||||
|
|
||||||
Declaration::Visibility Parser::parseVisibilitySpecifier(Token::Value _token)
|
Declaration::Visibility Parser::parseVisibilitySpecifier(Token::Value _token)
|
||||||
{
|
{
|
||||||
Declaration::Visibility visibility = Declaration::Visibility::DEFAULT;
|
Declaration::Visibility visibility(Declaration::Visibility::DEFAULT);
|
||||||
if (_token == Token::PUBLIC)
|
if (_token == Token::PUBLIC)
|
||||||
visibility = Declaration::Visibility::PUBLIC;
|
visibility = Declaration::Visibility::PUBLIC;
|
||||||
else if (_token == Token::PROTECTED)
|
else if (_token == Token::PROTECTED)
|
||||||
@ -278,17 +278,14 @@ ASTPointer<VariableDeclaration> Parser::parseVariableDeclaration(VarDeclParserOp
|
|||||||
isIndexed = true;
|
isIndexed = true;
|
||||||
m_scanner->next();
|
m_scanner->next();
|
||||||
}
|
}
|
||||||
|
nodeFactory.markEndPosition();
|
||||||
if (_options.allowEmptyName && m_scanner->getCurrentToken() != Token::IDENTIFIER)
|
if (_options.allowEmptyName && m_scanner->getCurrentToken() != Token::IDENTIFIER)
|
||||||
{
|
{
|
||||||
identifier = make_shared<ASTString>("");
|
identifier = make_shared<ASTString>("");
|
||||||
nodeFactory.setEndPositionFromNode(type);
|
nodeFactory.setEndPositionFromNode(type);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
nodeFactory.markEndPosition();
|
|
||||||
identifier = expectIdentifierToken();
|
identifier = expectIdentifierToken();
|
||||||
}
|
|
||||||
nodeFactory.markEndPosition();
|
|
||||||
return nodeFactory.createNode<VariableDeclaration>(type, identifier,
|
return nodeFactory.createNode<VariableDeclaration>(type, identifier,
|
||||||
visibility, _options.isStateVariable,
|
visibility, _options.isStateVariable,
|
||||||
isIndexed);
|
isIndexed);
|
||||||
|
Loading…
Reference in New Issue
Block a user