diff options
author | Liana Husikyan <liana@ethdev.com> | 2015-02-09 09:24:57 +0800 |
---|---|---|
committer | Liana Husikyan <liana@ethdev.com> | 2015-02-09 09:24:57 +0800 |
commit | bcccfa8805dfe471b2e3711a23dcb2e0caf7e7bb (patch) | |
tree | 39f17e092b886ea6428c89431b0b06e317c758a8 | |
parent | 2a5c2578bd7e07326412ac0345ed5f5283908ccb (diff) | |
download | dexon-solidity-bcccfa8805dfe471b2e3711a23dcb2e0caf7e7bb.tar dexon-solidity-bcccfa8805dfe471b2e3711a23dcb2e0caf7e7bb.tar.gz dexon-solidity-bcccfa8805dfe471b2e3711a23dcb2e0caf7e7bb.tar.bz2 dexon-solidity-bcccfa8805dfe471b2e3711a23dcb2e0caf7e7bb.tar.lz dexon-solidity-bcccfa8805dfe471b2e3711a23dcb2e0caf7e7bb.tar.xz dexon-solidity-bcccfa8805dfe471b2e3711a23dcb2e0caf7e7bb.tar.zst dexon-solidity-bcccfa8805dfe471b2e3711a23dcb2e0caf7e7bb.zip |
- 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
-rw-r--r-- | AST.cpp | 3 | ||||
-rw-r--r-- | Parser.cpp | 11 |
2 files changed, 4 insertions, 10 deletions
@@ -60,7 +60,6 @@ void ContractDefinition::checkTypeRequirements() FunctionDefinition const* fallbackFunction = nullptr; for (ASTPointer<FunctionDefinition> const& function: getDefinedFunctions()) - { if (function->getName().empty()) { if (fallbackFunction) @@ -72,8 +71,6 @@ void ContractDefinition::checkTypeRequirements() BOOST_THROW_EXCEPTION(fallbackFunction->getParameterList().createTypeError("Fallback function cannot take parameters.")); } } - } - for (ASTPointer<ModifierDefinition> const& modifier: getFunctionModifiers()) modifier->checkTypeRequirements(); @@ -180,7 +180,7 @@ ASTPointer<InheritanceSpecifier> Parser::parseInheritanceSpecifier() Declaration::Visibility Parser::parseVisibilitySpecifier(Token::Value _token) { - Declaration::Visibility visibility = Declaration::Visibility::DEFAULT; + Declaration::Visibility visibility(Declaration::Visibility::DEFAULT); if (_token == Token::PUBLIC) visibility = Declaration::Visibility::PUBLIC; else if (_token == Token::PROTECTED) @@ -278,20 +278,17 @@ ASTPointer<VariableDeclaration> Parser::parseVariableDeclaration(VarDeclParserOp isIndexed = true; m_scanner->next(); } + nodeFactory.markEndPosition(); if (_options.allowEmptyName && m_scanner->getCurrentToken() != Token::IDENTIFIER) { identifier = make_shared<ASTString>(""); nodeFactory.setEndPositionFromNode(type); } else - { - nodeFactory.markEndPosition(); identifier = expectIdentifierToken(); - } - nodeFactory.markEndPosition(); return nodeFactory.createNode<VariableDeclaration>(type, identifier, - visibility, _options.isStateVariable, - isIndexed); + visibility, _options.isStateVariable, + isIndexed); } ASTPointer<ModifierDefinition> Parser::parseModifierDefinition() |