mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Minors.
This commit is contained in:
parent
65d09e7995
commit
e57c137558
@ -79,7 +79,7 @@ void Assembly::addAssemblyItemsFromJSON(Json::Value const& _code)
|
||||
solAssert(m_items.empty(), "");
|
||||
solAssert(_code.isArray(), "");
|
||||
for (auto const& jsonItem: _code)
|
||||
m_items.emplace_back(loadItemFromJSON(jsonItem));
|
||||
m_items.emplace_back(createAssemblyItemFromJSON(jsonItem));
|
||||
|
||||
for (auto current = m_items.begin(); current != m_items.end(); ++current)
|
||||
{
|
||||
@ -96,7 +96,7 @@ void Assembly::addAssemblyItemsFromJSON(Json::Value const& _code)
|
||||
}
|
||||
}
|
||||
|
||||
AssemblyItem Assembly::loadItemFromJSON(Json::Value const& _json)
|
||||
AssemblyItem Assembly::createAssemblyItemFromJSON(Json::Value const& _json)
|
||||
{
|
||||
std::string name = _json["name"].isString() ? _json["name"].asString() : "";
|
||||
int begin = _json["begin"].isInt() ? _json["begin"].asInt() : -1;
|
||||
|
@ -168,20 +168,20 @@ public:
|
||||
|
||||
bool isCreation() const { return m_creation; }
|
||||
|
||||
/// Set the source list.
|
||||
/// Set the source name list.
|
||||
void setSources(std::vector<std::shared_ptr<std::string const>> _sources)
|
||||
{
|
||||
m_sources = std::move(_sources);
|
||||
}
|
||||
|
||||
/// Set the source list from simple vector<string>.
|
||||
/// Set the source name list from simple vector<string>.
|
||||
void setSources(std::vector<std::string> const& _sources)
|
||||
{
|
||||
for (auto const& item: _sources)
|
||||
m_sources.emplace_back(std::make_shared<std::string>(item));
|
||||
}
|
||||
|
||||
/// @returns List of sources.
|
||||
/// @returns List of source names.
|
||||
std::vector<std::shared_ptr<std::string const>> sources() const& { return m_sources; }
|
||||
|
||||
protected:
|
||||
@ -197,8 +197,8 @@ protected:
|
||||
|
||||
/// Creates an AssemblyItem from a given JSON representation.
|
||||
/// @param _json JSON representation of an assembly item
|
||||
/// @returns AssemblyItem from a given JSON representation.
|
||||
AssemblyItem loadItemFromJSON(Json::Value const& _json);
|
||||
/// @returns AssemblyItem of _json argument.
|
||||
AssemblyItem createAssemblyItemFromJSON(Json::Value const& _json);
|
||||
|
||||
private:
|
||||
bool m_invalid = false;
|
||||
|
@ -423,7 +423,7 @@ void CompilerStack::importEvmAssemblyJson(std::map<std::string, Json::Value> con
|
||||
if (m_stackState != Empty)
|
||||
solThrow(CompilerError, "Must call importEvmAssemblyJson only before the SourcesSet state.");
|
||||
|
||||
Json::Value const& jsonValue = _sources.begin()->second;
|
||||
Json::Value jsonValue = _sources.begin()->second;
|
||||
if (jsonValue.isMember("sourceList"))
|
||||
for (auto const& item: jsonValue["sourceList"])
|
||||
{
|
||||
@ -432,7 +432,7 @@ void CompilerStack::importEvmAssemblyJson(std::map<std::string, Json::Value> con
|
||||
m_sources.emplace(std::make_pair(item.asString(), source));
|
||||
m_sourceOrder.push_back(&m_sources[item.asString()]);
|
||||
}
|
||||
m_evmAssemblyJson[_sources.begin()->first] = jsonValue;
|
||||
m_evmAssemblyJson[_sources.begin()->first] = std::move(jsonValue);
|
||||
m_importedSources = true;
|
||||
m_stackState = SourcesSet;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user