diff --git a/common/dsnlexer.cpp b/common/dsnlexer.cpp index 8939ba130d..d14d7316ec 100644 --- a/common/dsnlexer.cpp +++ b/common/dsnlexer.cpp @@ -419,7 +419,7 @@ int DSNLEXER::NeedSYMBOLorNUMBER() { int tok = NextTok(); if( !IsSymbol( tok ) && tok!=DSN_NUMBER ) - Expecting( "symbol|number" ); + Expecting( "a symbol or number" ); return tok; } @@ -430,7 +430,7 @@ int DSNLEXER::NeedNUMBER( const char* aExpectation ) if( tok != DSN_NUMBER ) { wxString errText = wxString::Format( - _( "need a NUMBER for \"%s\"" ), wxString::FromUTF8( aExpectation ).GetData() ); + _( "need a number for '%s'" ), wxString::FromUTF8( aExpectation ).GetData() ); THROW_PARSE_ERROR( errText, CurSource(), CurLine(), CurLineNumber(), CurOffset() ); } return tok; diff --git a/pcbnew/drc/drc_rule_parser.cpp b/pcbnew/drc/drc_rule_parser.cpp index 9921ae3db6..ef95453b79 100644 --- a/pcbnew/drc/drc_rule_parser.cpp +++ b/pcbnew/drc/drc_rule_parser.cpp @@ -195,9 +195,11 @@ DRC_SELECTOR* DRC_RULES_PARSER::parseDRC_SELECTOR( wxString* aRuleName ) DRC_RULE* DRC_RULES_PARSER::parseDRC_RULE() { DRC_RULE* rule = new DRC_RULE(); - T token; + T token = NextTok(); + + if( !IsSymbol( token ) ) + Expecting( "rule name" ); - NeedSYMBOL(); rule->m_Name = FromUTF8(); for( token = NextTok(); token != T_RIGHT; token = NextTok() )