mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Extract scopes into compiler stack.
This commit is contained in:
@@ -53,7 +53,8 @@ eth::AssemblyItems compileContract(const string& _sourceCode)
|
||||
BOOST_REQUIRE_NO_THROW(sourceUnit = parser.parse(make_shared<Scanner>(CharStream(_sourceCode))));
|
||||
BOOST_CHECK(!!sourceUnit);
|
||||
|
||||
NameAndTypeResolver resolver({}, errors);
|
||||
map<ASTNode const*, shared_ptr<DeclarationContainer>> scopes;
|
||||
NameAndTypeResolver resolver({}, scopes, errors);
|
||||
solAssert(Error::containsOnlyWarnings(errors), "");
|
||||
resolver.registerDeclarations(*sourceUnit);
|
||||
for (ASTPointer<ASTNode> const& node: sourceUnit->nodes())
|
||||
|
||||
@@ -114,7 +114,8 @@ bytes compileFirstExpression(
|
||||
declarations.push_back(variable.get());
|
||||
|
||||
ErrorList errors;
|
||||
NameAndTypeResolver resolver(declarations, errors);
|
||||
map<ASTNode const*, shared_ptr<DeclarationContainer>> scopes;
|
||||
NameAndTypeResolver resolver(declarations, scopes, errors);
|
||||
resolver.registerDeclarations(*sourceUnit);
|
||||
|
||||
vector<ContractDefinition const*> inheritanceHierarchy;
|
||||
|
||||
@@ -66,7 +66,8 @@ parseAnalyseAndReturnError(string const& _source, bool _reportWarnings = false,
|
||||
return make_pair(sourceUnit, errors.at(0));
|
||||
|
||||
std::shared_ptr<GlobalContext> globalContext = make_shared<GlobalContext>();
|
||||
NameAndTypeResolver resolver(globalContext->declarations(), errors);
|
||||
map<ASTNode const*, shared_ptr<DeclarationContainer>> scopes;
|
||||
NameAndTypeResolver resolver(globalContext->declarations(), scopes, errors);
|
||||
solAssert(Error::containsOnlyWarnings(errors), "");
|
||||
resolver.registerDeclarations(*sourceUnit);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user