aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorLianaHus <liana@ethdev.com>2015-09-08 20:30:21 +0800
committerLianaHus <liana@ethdev.com>2015-09-08 20:30:21 +0800
commitdf8c82bc60f4d9238635082f9a9f41a45b5e2b98 (patch)
treef52b1582b3f532e3b8fcdc91f85ede89e21e8510 /libsolidity
parent02d4198242ec3dacc7af31c9446c83adcf014de9 (diff)
downloaddexon-solidity-df8c82bc60f4d9238635082f9a9f41a45b5e2b98.tar
dexon-solidity-df8c82bc60f4d9238635082f9a9f41a45b5e2b98.tar.gz
dexon-solidity-df8c82bc60f4d9238635082f9a9f41a45b5e2b98.tar.bz2
dexon-solidity-df8c82bc60f4d9238635082f9a9f41a45b5e2b98.tar.lz
dexon-solidity-df8c82bc60f4d9238635082f9a9f41a45b5e2b98.tar.xz
dexon-solidity-df8c82bc60f4d9238635082f9a9f41a45b5e2b98.tar.zst
dexon-solidity-df8c82bc60f4d9238635082f9a9f41a45b5e2b98.zip
- renamed AST to ast and ABI to abi
- style fixes
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/AST.cpp6
-rw-r--r--libsolidity/CompilerStack.cpp2
-rw-r--r--libsolidity/CompilerStack.h2
-rw-r--r--libsolidity/InterfaceHandler.cpp4
-rw-r--r--libsolidity/InterfaceHandler.h2
-rw-r--r--libsolidity/NameAndTypeResolver.cpp4
-rw-r--r--libsolidity/Parser.cpp19
7 files changed, 23 insertions, 16 deletions
diff --git a/libsolidity/AST.cpp b/libsolidity/AST.cpp
index a9382031..8889edf0 100644
--- a/libsolidity/AST.cpp
+++ b/libsolidity/AST.cpp
@@ -112,8 +112,10 @@ map<FixedHash<4>, FunctionTypePointer> ContractDefinition::interfaceFunctions()
for (auto const& it: exportedFunctionList)
exportedFunctions.insert(it);
- solAssert(exportedFunctionList.size() == exportedFunctions.size(),
- "Hash collision at Function Definition Hash calculation");
+ solAssert(
+ exportedFunctionList.size() == exportedFunctions.size(),
+ "Hash collision at Function Definition Hash calculation"
+ );
return exportedFunctions;
}
diff --git a/libsolidity/CompilerStack.cpp b/libsolidity/CompilerStack.cpp
index 53ac5344..385533b2 100644
--- a/libsolidity/CompilerStack.cpp
+++ b/libsolidity/CompilerStack.cpp
@@ -277,7 +277,7 @@ Scanner const& CompilerStack::scanner(string const& _sourceName) const
return *source(_sourceName).scanner;
}
-SourceUnit const& CompilerStack::AST(string const& _sourceName) const
+SourceUnit const& CompilerStack::ast(string const& _sourceName) const
{
return *source(_sourceName).ast;
}
diff --git a/libsolidity/CompilerStack.h b/libsolidity/CompilerStack.h
index e5e1ece8..0d812e02 100644
--- a/libsolidity/CompilerStack.h
+++ b/libsolidity/CompilerStack.h
@@ -132,7 +132,7 @@ public:
/// @returns the previously used scanner, useful for counting lines during error reporting.
Scanner const& scanner(std::string const& _sourceName = "") const;
/// @returns the parsed source unit with the supplied name.
- SourceUnit const& AST(std::string const& _sourceName = "") const;
+ SourceUnit const& ast(std::string const& _sourceName = "") const;
/// @returns the parsed contract with the supplied name. Throws an exception if the contract
/// does not exist.
ContractDefinition const& contractDefinition(std::string const& _contractName) const;
diff --git a/libsolidity/InterfaceHandler.cpp b/libsolidity/InterfaceHandler.cpp
index a52357d0..fc79b493 100644
--- a/libsolidity/InterfaceHandler.cpp
+++ b/libsolidity/InterfaceHandler.cpp
@@ -28,7 +28,7 @@ string InterfaceHandler::documentation(
case DocumentationType::NatspecDev:
return devDocumentation(_contractDef);
case DocumentationType::ABIInterface:
- return ABIInterface(_contractDef);
+ return abiInterface(_contractDef);
case DocumentationType::ABISolidityInterface:
return ABISolidityInterface(_contractDef);
}
@@ -37,7 +37,7 @@ string InterfaceHandler::documentation(
return "";
}
-string InterfaceHandler::ABIInterface(ContractDefinition const& _contractDef)
+string InterfaceHandler::abiInterface(ContractDefinition const& _contractDef)
{
Json::Value abi(Json::arrayValue);
diff --git a/libsolidity/InterfaceHandler.h b/libsolidity/InterfaceHandler.h
index 86cdc2c4..62164517 100644
--- a/libsolidity/InterfaceHandler.h
+++ b/libsolidity/InterfaceHandler.h
@@ -73,7 +73,7 @@ public:
/// Get the ABI Interface of the contract
/// @param _contractDef The contract definition
/// @return A string with the json representation of the contract's ABI Interface
- std::string ABIInterface(ContractDefinition const& _contractDef);
+ std::string abiInterface(ContractDefinition const& _contractDef);
std::string ABISolidityInterface(ContractDefinition const& _contractDef);
/// Get the User documentation of the contract
/// @param _contractDef The contract definition
diff --git a/libsolidity/NameAndTypeResolver.cpp b/libsolidity/NameAndTypeResolver.cpp
index a0298e8e..96800ec3 100644
--- a/libsolidity/NameAndTypeResolver.cpp
+++ b/libsolidity/NameAndTypeResolver.cpp
@@ -80,7 +80,9 @@ void NameAndTypeResolver::resolveNamesAndTypes(ContractDefinition& _contract)
{
m_currentScope = &m_scopes[function.get()];
ReferencesResolver referencesResolver(
- *function, *this, &_contract,
+ *function,
+ *this,
+ &_contract,
function->returnParameterList().get()
);
}
diff --git a/libsolidity/Parser.cpp b/libsolidity/Parser.cpp
index c196c666..e001d0f1 100644
--- a/libsolidity/Parser.cpp
+++ b/libsolidity/Parser.cpp
@@ -139,16 +139,19 @@ ASTPointer<ContractDefinition> Parser::parseContractDefinition()
while (true)
{
Token::Value currentTokenValue= m_scanner->currentToken();
- if (currentTokenValue== Token::RBrace)
+ if (currentTokenValue == Token::RBrace)
break;
- else if (currentTokenValue== Token::Function)
+ else if (currentTokenValue == Token::Function)
functions.push_back(parseFunctionDefinition(name.get()));
- else if (currentTokenValue== Token::Struct)
+ else if (currentTokenValue == Token::Struct)
structs.push_back(parseStructDefinition());
- else if (currentTokenValue== Token::Enum)
+ else if (currentTokenValue == Token::Enum)
enums.push_back(parseEnumDefinition());
- else if (currentTokenValue== Token::Identifier || currentTokenValue== Token::Mapping ||
- Token::isElementaryTypeName(currentTokenValue))
+ else if (
+ currentTokenValue == Token::Identifier ||
+ currentTokenValue == Token::Mapping ||
+ Token::isElementaryTypeName(currentTokenValue)
+ )
{
VarDeclParserOptions options;
options.isStateVariable = true;
@@ -156,9 +159,9 @@ ASTPointer<ContractDefinition> Parser::parseContractDefinition()
stateVariables.push_back(parseVariableDeclaration(options));
expectToken(Token::Semicolon);
}
- else if (currentTokenValue== Token::Modifier)
+ else if (currentTokenValue == Token::Modifier)
modifiers.push_back(parseModifierDefinition());
- else if (currentTokenValue== Token::Event)
+ else if (currentTokenValue == Token::Event)
events.push_back(parseEventDefinition());
else
BOOST_THROW_EXCEPTION(createParserError("Function, variable, struct or modifier declaration expected."));