Don't throw implicit rules out after failing to compile user rules.

This commit is contained in:
Jeff Young 2020-10-16 12:41:19 +01:00
parent eea7957e16
commit 1b2168af1e
1 changed files with 19 additions and 3 deletions

View File

@ -497,10 +497,26 @@ void DRC_ENGINE::InitEngine( const wxFileName& aRulePath )
m_rules.clear();
m_rulesValid = false;
loadImplicitRules();
loadRules( aRulePath );
try // attempt to load full set of rules (implicit + user rules)
{
loadImplicitRules();
loadRules( aRulePath );
compileRules();
}
catch( PARSE_ERROR& original_parse_error )
{
try // try again with just our implicit rules
{
loadImplicitRules();
compileRules();
}
catch( PARSE_ERROR& ignore )
{
wxFAIL_MSG( "Compiling implict rules failed." );
}
compileRules();
throw original_parse_error;
}
for( int ii = DRCE_FIRST; ii < DRCE_LAST; ++ii )
m_errorLimits[ ii ] = INT_MAX;