diff options
Diffstat (limited to 'solidityNameAndTypeResolution.cpp')
-rw-r--r-- | solidityNameAndTypeResolution.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/solidityNameAndTypeResolution.cpp b/solidityNameAndTypeResolution.cpp index 8804c519..219fa259 100644 --- a/solidityNameAndTypeResolution.cpp +++ b/solidityNameAndTypeResolution.cpp @@ -41,10 +41,13 @@ namespace void parseTextAndResolveNames(std::string const& _source) { Parser parser; - ASTPointer<ContractDefinition> contract = parser.parse( - std::make_shared<Scanner>(CharStream(_source))); - NameAndTypeResolver resolver({}); - resolver.resolveNamesAndTypes(*contract); + ASTPointer<SourceUnit> sourceUnit = parser.parse(std::make_shared<Scanner>(CharStream(_source))); + for (ASTPointer<ASTNode> const& node: sourceUnit->getNodes()) + if (ContractDefinition* contract = dynamic_cast<ContractDefinition*>(node.get())) + { + NameAndTypeResolver resolver({}); + resolver.resolveNamesAndTypes(*contract); + } } } |