Done, In fact, it failed in my system too.
So, I opened these files in NotePad++, and "convert to UTF8 without BOM", then it works, here is the patch.
Index: nativeparser.cpp
===================================================================
--- nativeparser.cpp (revision 5922)
+++ nativeparser.cpp (working copy)
@@ -2025,7 +2025,59 @@
// done
return result.size();
}
+size_t NativeParser::GenerateResultSet(Parser* parser, const wxString& search, int parentIdx, TokenIdxSet& result, bool caseSens, bool isPrefix, short int kindMask)
+{
+ if (!parser)
+ return 0;
+ if (search.IsEmpty())
+ {
+ Token* parent = parser->GetTokens()->at(parentIdx);
+ if (parent)
+ {
+ for (TokenIdxSet::iterator it = parent->m_Children.begin(); it != parent->m_Children.end(); ++it)
+ {
+ Token* token = parser->GetTokens()->at(*it);
+ if (token)
+ result.insert(*it);
+ }
+ for (TokenIdxSet::iterator it = parent->m_Ancestors.begin(); it != parent->m_Ancestors.end(); ++it)
+ {
+ Token* ancestor = parser->GetTokens()->at(*it);
+ if (!ancestor)
+ continue;
+ for (TokenIdxSet::iterator it2 = ancestor->m_Children.begin(); it2 != ancestor->m_Children.end(); ++it2)
+ {
+ Token* token = parser->GetTokens()->at(*it2);
+ if (token)
+ {
+ result.insert(*it2);
+ if (token->m_TokenKind == tkEnum) // check enumerators for match too
+ {
+ for(TokenIdxSet::iterator it3 = token->m_Children.begin(); it3 != token->m_Children.end(); ++it3)
+ result.insert(*it3);
+ }
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ TokenIdxSet tempResult;
+ if (parser->FindMatches(search, tempResult, caseSens, isPrefix))
+ {
+ for (TokenIdxSet::iterator it = tempResult.begin(); it != tempResult.end(); ++it)
+ {
+ Token* token = parser->GetTokens()->at(*it);
+ if (token && (token->m_ParentIndex ==parentIdx))
+ result.insert(*it);
+
+ }
+ }
+ }
+ return result.size();
+}
// Decides if the token belongs to its parent or one of its ancestors
bool NativeParser::BelongsToParentOrItsAncestors(TokensTree* tree, Token* token, int parentIdx, bool use_inheritance)
{
Index: nativeparser.h
===================================================================
--- nativeparser.h (revision 5922)
+++ nativeparser.h (working copy)
@@ -104,7 +104,7 @@
size_t BreakUpComponents(Parser* parser, const wxString& actual, std::queue<ParserComponent>& components);
bool BelongsToParentOrItsAncestors(TokensTree* tree, Token* token, int parentIdx, bool use_inheritance = true);
size_t GenerateResultSet(TokensTree* tree, const wxString& search, int parentIdx, TokenIdxSet& result, bool caseSens = true, bool isPrefix = false, short int kindMask = 0xFFFF);
-
+ size_t GenerateResultSet(Parser* parser, const wxString& search, int parentIdx, TokenIdxSet& result, bool caseSens = true, bool isPrefix = false, short int kindMask = 0xFFFF);
bool LastAISearchWasGlobal() const { return m_LastAISearchWasGlobal; }
const wxString& LastAIGlobalSearch() const { return m_LastAIGlobalSearch; }
Index: parser/parser.cpp
===================================================================
--- parser/parser.cpp (revision 5922)
+++ parser/parser.cpp (working copy)
@@ -424,7 +424,24 @@
}
return result.size();
}
+size_t Parser::FindMatches(const wxString& s,TokenIdxSet& result,bool caseSensitive,bool is_prefix)
+{
+ result.clear();
+ TokenIdxSet tmpresult;
+ wxCriticalSectionLocker lock(s_MutexProtection);
+ if(!m_pTokens->FindMatches(s,tmpresult,caseSensitive,is_prefix))
+ return 0;
+ TokenIdxSet::iterator it;
+ for(it = tmpresult.begin();it!=tmpresult.end();++it)
+ {
+ Token* token = m_pTokens->at(*it);
+ if(token)
+ //result.push_back(token);
+ result.insert(*it);
+ }
+ return result.size();
+}
void Parser::LinkInheritance(bool tempsOnly)
{
wxCriticalSectionLocker lock(s_MutexProtection);
Index: parser/parser.h
===================================================================
--- parser/parser.h (revision 5922)
+++ parser/parser.h (working copy)
@@ -147,7 +147,7 @@
Token* FindTokenByName(const wxString& name, bool globalsOnly = true, short int kindMask = 0xFFFF) const;
Token* FindChildTokenByName(Token* parent, const wxString& name, bool useInheritance = false, short int kindMask = 0xFFFF) const;
size_t FindMatches(const wxString& s,TokenList& result,bool caseSensitive = true,bool is_prefix = true);
-
+ size_t FindMatches(const wxString& s,TokenIdxSet& result,bool caseSensitive = true,bool is_prefix = true);
ParserOptions& Options(){ return m_Options; }
BrowserOptions& ClassBrowserOptions(){ return m_BrowserOptions; }