Allow empty rules files.
This commit is contained in:
parent
75b139c7b4
commit
8dc6f8e82b
|
@ -49,28 +49,28 @@ void DRC_RULES_PARSER::Parse( std::vector<DRC_SELECTOR*>& aSelectors,
|
||||||
std::vector<DRC_RULE*>& aRules )
|
std::vector<DRC_RULE*>& aRules )
|
||||||
{
|
{
|
||||||
std::vector< std::pair<DRC_SELECTOR*, wxString> > selectorRules;
|
std::vector< std::pair<DRC_SELECTOR*, wxString> > selectorRules;
|
||||||
|
bool haveVersion = false;
|
||||||
|
|
||||||
T token;
|
for( T token = NextTok(); token != T_EOF; token = NextTok() )
|
||||||
|
|
||||||
NeedLEFT();
|
|
||||||
|
|
||||||
if( NextTok() != T_version )
|
|
||||||
Expecting( "version" );
|
|
||||||
|
|
||||||
NeedNUMBER( "version" );
|
|
||||||
m_requiredVersion = (int)strtol( CurText(), NULL, 10 );
|
|
||||||
m_tooRecent = ( m_requiredVersion > DRC_RULE_FILE_VERSION );
|
|
||||||
NeedRIGHT();
|
|
||||||
|
|
||||||
for( token = NextTok(); token != T_EOF; token = NextTok() )
|
|
||||||
{
|
{
|
||||||
if( token != T_LEFT )
|
if( token != T_LEFT )
|
||||||
Expecting( T_LEFT );
|
Expecting( T_LEFT );
|
||||||
|
|
||||||
token = NextTok();
|
token = NextTok();
|
||||||
|
|
||||||
|
if( !haveVersion && token != T_version )
|
||||||
|
Expecting( "version" );
|
||||||
|
|
||||||
switch( token )
|
switch( token )
|
||||||
{
|
{
|
||||||
|
case T_version:
|
||||||
|
NeedNUMBER( "version" );
|
||||||
|
m_requiredVersion = (int)strtol( CurText(), NULL, 10 );
|
||||||
|
m_tooRecent = ( m_requiredVersion > DRC_RULE_FILE_VERSION );
|
||||||
|
haveVersion = true;
|
||||||
|
NeedRIGHT();
|
||||||
|
break;
|
||||||
|
|
||||||
case T_selector:
|
case T_selector:
|
||||||
{
|
{
|
||||||
wxString ruleName;
|
wxString ruleName;
|
||||||
|
|
Loading…
Reference in New Issue