mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Provide optional list of contract names to CompilerStack.compile
This commit is contained in:
1 parent
19274c7890
commit
f96e932243
2 files changed
+21
-1
No files matched your search
@@ -252,6 +252,14 @@ bool CompilerStack::parseAndAnalyze()
|
||||
return parse() && analyze();
|
||||
}
|
||||
|
||||
bool CompilerStack::isRequestedContract(ContractDefinition const& _contract) const
|
||||
{
|
||||
return
|
||||
m_requestedContractNames.empty() ||
|
||||
m_requestedContractNames.count(_contract.fullyQualifiedName()) ||
|
||||
m_requestedContractNames.count(_contract.name());
|
||||
}
|
||||
|
||||
bool CompilerStack::compile()
|
||||
{
|
||||
if (m_stackState < AnalysisSuccessful)
|
||||
@@ -262,7 +270,8 @@ bool CompilerStack::compile()
|
||||
for (Source const* source: m_sourceOrder)
|
||||
for (ASTPointer<ASTNode> const& node: source->ast->nodes())
|
||||
if (auto contract = dynamic_cast<ContractDefinition const*>(node.get()))
|
||||
compileContract(*contract, compiledContracts);
|
||||
if (isRequestedContract(*contract))
|
||||
compileContract(*contract, compiledContracts);
|
||||
this->link();
|
||||
m_stackState = CompilationSuccessful;
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user