mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Split DocStringParsing in two stages
one requiring type info in the next step
This commit is contained in:
@@ -416,11 +416,6 @@ bool CompilerStack::analyze()
|
||||
if (source->ast && !syntaxChecker.checkSyntax(*source->ast))
|
||||
noErrors = false;
|
||||
|
||||
DocStringTagParser docStringTagParser(m_errorReporter);
|
||||
for (Source const* source: m_sourceOrder)
|
||||
if (source->ast && !docStringTagParser.parseDocStrings(*source->ast))
|
||||
noErrors = false;
|
||||
|
||||
m_globalContext = make_shared<GlobalContext>();
|
||||
// We need to keep the same resolver during the whole process.
|
||||
NameAndTypeResolver resolver(*m_globalContext, m_evmVersion, m_errorReporter);
|
||||
@@ -437,6 +432,12 @@ bool CompilerStack::analyze()
|
||||
|
||||
resolver.warnHomonymDeclarations();
|
||||
|
||||
DocStringTagParser docStringTagParser(m_errorReporter);
|
||||
for (Source const* source: m_sourceOrder)
|
||||
if (source->ast && !docStringTagParser.parseDocStrings(*source->ast))
|
||||
noErrors = false;
|
||||
|
||||
// Requires DocStringTagParser
|
||||
for (Source const* source: m_sourceOrder)
|
||||
if (source->ast && !resolver.resolveNamesAndTypes(*source->ast))
|
||||
return false;
|
||||
@@ -446,6 +447,11 @@ bool CompilerStack::analyze()
|
||||
if (source->ast && !declarationTypeChecker.check(*source->ast))
|
||||
return false;
|
||||
|
||||
// Requires DeclarationTypeChecker to have run
|
||||
for (Source const* source: m_sourceOrder)
|
||||
if (source->ast && !docStringTagParser.validateDocStringsUsingTypes(*source->ast))
|
||||
noErrors = false;
|
||||
|
||||
// Next, we check inheritance, overrides, function collisions and other things at
|
||||
// contract or function level.
|
||||
// This also calculates whether a contract is abstract, which is needed by the
|
||||
|
||||
Reference in New Issue
Block a user