mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add Steve Johnson-style parser recovery rules:
SourceUnit = Error $
Block = '{' Error '}'
ContractDefinition = '{' Error '}'
Statement = Error ';'
Co-Authored-By: chriseth <chris@ethereum.org>
This commit is contained in:
committed by
chriseth
co-authored by
chriseth
parent
2276b567b1
commit
97f8ee0d1b
@@ -44,12 +44,15 @@ AnalysisFramework::parseAnalyseAndReturnError(
|
||||
string const& _source,
|
||||
bool _reportWarnings,
|
||||
bool _insertVersionPragma,
|
||||
bool _allowMultipleErrors
|
||||
bool _allowMultipleErrors,
|
||||
bool _allowRecoveryErrors
|
||||
)
|
||||
{
|
||||
compiler().reset();
|
||||
compiler().setSources({{"", _insertVersionPragma ? "pragma solidity >=0.0;\n" + _source : _source}});
|
||||
compiler().setEVMVersion(dev::test::Options::get().evmVersion());
|
||||
compiler().setParserErrorRecovery(_allowRecoveryErrors);
|
||||
_allowMultipleErrors = _allowMultipleErrors || _allowRecoveryErrors;
|
||||
if (!compiler().parse())
|
||||
{
|
||||
BOOST_FAIL("Parsing contract failed in analysis test suite:" + formatErrors());
|
||||
|
||||
Reference in New Issue
Block a user