mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Stylistic corrections
This commit is contained in:
parent
220ccfb492
commit
0c98e4b2da
@ -190,7 +190,7 @@ void ContractDefinition::setUserDocumentation(Json::Value const& _userDocumentat
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::string ContractDefinition::fullyQualifiedName() const
|
string ContractDefinition::fullyQualifiedName() const
|
||||||
{
|
{
|
||||||
std::string sourceString = *(location().sourceName);
|
std::string sourceString = *(location().sourceName);
|
||||||
std::string qualifiedName = (sourceString.empty() ? ("") : (sourceString + ":")) + name();
|
std::string qualifiedName = (sourceString.empty() ? ("") : (sourceString + ":")) + name();
|
||||||
|
@ -184,7 +184,7 @@ bool CompilerStack::parse()
|
|||||||
|
|
||||||
if (m_contracts.find(contract->fullyQualifiedName()) != m_contracts.end())
|
if (m_contracts.find(contract->fullyQualifiedName()) != m_contracts.end())
|
||||||
{
|
{
|
||||||
const ContractDefinition* existingContract = m_contracts.find(contract->fullyQualifiedName())->second.contract;
|
ContractDefinition const* existingContract = m_contracts[contract->fullyQualifiedName()].contract;
|
||||||
if (contract != existingContract)
|
if (contract != existingContract)
|
||||||
{
|
{
|
||||||
auto err = make_shared<Error>(Error::Type::DeclarationError);
|
auto err = make_shared<Error>(Error::Type::DeclarationError);
|
||||||
@ -201,10 +201,8 @@ bool CompilerStack::parse()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
m_contracts[contract->fullyQualifiedName()].contract = contract;
|
m_contracts[contract->fullyQualifiedName()].contract = contract;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!checkLibraryNameClashes())
|
if (!checkLibraryNameClashes())
|
||||||
noErrors = false;
|
noErrors = false;
|
||||||
@ -224,9 +222,10 @@ bool CompilerStack::parse()
|
|||||||
else
|
else
|
||||||
noErrors = false;
|
noErrors = false;
|
||||||
|
|
||||||
|
// Note that find() must be used here to prevent an automatic insert into the map
|
||||||
if (m_contracts.find(contract->fullyQualifiedName()) != m_contracts.end())
|
if (m_contracts.find(contract->fullyQualifiedName()) != m_contracts.end())
|
||||||
{
|
{
|
||||||
const ContractDefinition* existingContract = m_contracts.find(contract->fullyQualifiedName())->second.contract;
|
ContractDefinition const* existingContract = m_contracts[contract->fullyQualifiedName()].contract;
|
||||||
|
|
||||||
if (contract != existingContract)
|
if (contract != existingContract)
|
||||||
{
|
{
|
||||||
@ -245,10 +244,8 @@ bool CompilerStack::parse()
|
|||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
m_contracts[contract->fullyQualifiedName()].contract = contract;
|
m_contracts[contract->fullyQualifiedName()].contract = contract;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (noErrors)
|
if (noErrors)
|
||||||
{
|
{
|
||||||
@ -379,8 +376,7 @@ std::string const CompilerStack::filesystemFriendlyName(string const& _contractN
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If no collision, return the contract's name
|
// If no collision, return the contract's name
|
||||||
// String is copied to ensure that the contract's name can't be messed with
|
return matchContract.contract->name();
|
||||||
return std::string(matchContract.contract->name());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
eth::LinkerObject const& CompilerStack::object(string const& _contractName) const
|
eth::LinkerObject const& CompilerStack::object(string const& _contractName) const
|
||||||
|
@ -186,9 +186,7 @@ void CommandLineInterface::handleBinary(string const& _contract)
|
|||||||
if (m_args.count(g_argBinary))
|
if (m_args.count(g_argBinary))
|
||||||
{
|
{
|
||||||
if (m_args.count("output-dir"))
|
if (m_args.count("output-dir"))
|
||||||
{
|
|
||||||
createFile(m_compiler->filesystemFriendlyName(_contract) + ".bin", m_compiler->object(_contract).toHex());
|
createFile(m_compiler->filesystemFriendlyName(_contract) + ".bin", m_compiler->object(_contract).toHex());
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cout << "Binary: " << endl;
|
cout << "Binary: " << endl;
|
||||||
|
Loading…
Reference in New Issue
Block a user