diff --git a/common/dsnlexer.cpp b/common/dsnlexer.cpp index d14d7316ec..941ffb4587 100644 --- a/common/dsnlexer.cpp +++ b/common/dsnlexer.cpp @@ -230,42 +230,15 @@ LINE_READER* DSNLEXER::PopReader() } -#if 0 -static int compare( const void* a1, const void* a2 ) -{ - const KEYWORD* k1 = (const KEYWORD*) a1; - const KEYWORD* k2 = (const KEYWORD*) a2; - - int ret = strcmp( k1->name, k2->name ); - return ret; -} - -int DSNLEXER::findToken( const std::string& tok ) -{ - KEYWORD search; - - search.name = tok.c_str(); - - const KEYWORD* findings = (const KEYWORD*) bsearch( &search, - keywords, keywordCount, - sizeof(KEYWORD), compare ); - if( findings ) - return findings->token; - else - return DSN_SYMBOL; // not a keyword, some arbitrary symbol. -} - -#else - inline int DSNLEXER::findToken( const std::string& tok ) { KEYWORD_MAP::const_iterator it = keyword_hash.find( tok.c_str() ); + if( it != keyword_hash.end() ) return it->second; return DSN_SYMBOL; // not a keyword, some arbitrary symbol. } -#endif const char* DSNLEXER::Syntax( int aTok ) diff --git a/include/dsnlexer.h b/include/dsnlexer.h index 6201e99d8c..9326e2a06a 100644 --- a/include/dsnlexer.h +++ b/include/dsnlexer.h @@ -490,6 +490,15 @@ public: return curText; } + /** + * Function GetCurStrAsToken + * Used to support "loose" matches (quoted tokens) + */ + int GetCurStrAsToken() + { + return findToken( curText ); + } + /** * Function FromUTF8 * returns the current token text as a wxString, assuming that the input diff --git a/include/libeval_compiler/libeval_compiler.h b/include/libeval_compiler/libeval_compiler.h index c99008b94d..3fe783598e 100644 --- a/include/libeval_compiler/libeval_compiler.h +++ b/include/libeval_compiler/libeval_compiler.h @@ -56,23 +56,6 @@ namespace LIBEVAL class COMPILER; -struct ERROR_STATUS -{ - bool pendingError = false; - - enum STAGE - { - CST_PARSE = 0, - CST_CODEGEN, - CST_RUNTIME - }; - - STAGE stage; - wxString message; // Note: use wxString for GUI-related strings - int srcPos; -}; - - enum VAR_TYPE_T { VT_STRING = 1, diff --git a/pcbnew/drc/drc_rule_parser.cpp b/pcbnew/drc/drc_rule_parser.cpp index c96ffe0225..9c70f605f0 100644 --- a/pcbnew/drc/drc_rule_parser.cpp +++ b/pcbnew/drc/drc_rule_parser.cpp @@ -151,6 +151,9 @@ void DRC_RULES_PARSER::Parse( std::vector& aRules, REPORTER* aReporte } } + if( !m_reporter->HasMessage() ) + m_reporter->Report( _( "No errors found." ), RPT_SEVERITY_INFO ); + m_reporter = nullptr; } @@ -184,6 +187,10 @@ DRC_RULE* DRC_RULES_PARSER::parseDRC_RULE() "'blind_via', 'pad', 'zone', 'text', 'graphic' or 'hole'." ) ); break; } + else if( (int) token == DSN_STRING ) + { + token = GetCurStrAsToken(); + } switch( token ) { diff --git a/pcbnew/pcb_expr_evaluator.cpp b/pcbnew/pcb_expr_evaluator.cpp index 32796393e5..b19859efee 100644 --- a/pcbnew/pcb_expr_evaluator.cpp +++ b/pcbnew/pcb_expr_evaluator.cpp @@ -23,7 +23,6 @@ #include -#include #include #include #include @@ -207,10 +206,7 @@ LIBEVAL::UCODE::FUNC_PTR PCB_EXPR_UCODE::CreateFuncCall( const char* aName ) { PCB_EXPR_BUILTIN_FUNCTIONS& registry = PCB_EXPR_BUILTIN_FUNCTIONS::Instance(); - std::string lowerName( aName ); - boost::to_lower( lowerName ); - - return registry.Get( lowerName ); + return registry.Get( wxString::FromUTF8( aName ).Lower() ); } diff --git a/pcbnew/pcb_expr_evaluator.h b/pcbnew/pcb_expr_evaluator.h index b1674437c7..df14336d05 100644 --- a/pcbnew/pcb_expr_evaluator.h +++ b/pcbnew/pcb_expr_evaluator.h @@ -121,7 +121,7 @@ public: return self; } - LIBEVAL::UCODE::FUNC_PTR Get( const std::string &name ) + LIBEVAL::UCODE::FUNC_PTR Get( const wxString &name ) { return m_funcs[ name ]; } @@ -132,7 +132,7 @@ public: } private: - std::map m_funcs; + std::map m_funcs; wxArrayString m_funcSigs; };