|
|
|
|
@ -44,7 +44,8 @@ clangmm::Cursor clangmm::CompletionString::get_cursor(CXTranslationUnit &tu) con
|
|
|
|
|
if((pos2 = chunk.rfind("::")) != std::string::npos) { |
|
|
|
|
pos1 = pos2 - 1; |
|
|
|
|
while(pos1 != std::string::npos && ((chunk[pos1] >= 'a' && chunk[pos1] <= 'z') || (chunk[pos1] >= 'A' && chunk[pos1] <= 'Z') || |
|
|
|
|
(chunk[pos1] >= '0' && chunk[pos1] <= '9') || chunk[pos1] == ':' || chunk[pos1] == '_')) |
|
|
|
|
(chunk[pos1] >= '0' && chunk[pos1] <= '9') || chunk[pos1] == ':' || |
|
|
|
|
chunk[pos1] == '_' || chunk[pos1] == '$' || static_cast<unsigned char>(chunk[pos1]) >= 128)) |
|
|
|
|
--pos1; |
|
|
|
|
chunk = chunk.substr(0, pos1 + 1) + chunk.substr(pos2 + 2); |
|
|
|
|
} |
|
|
|
|
@ -74,7 +75,9 @@ clangmm::Cursor clangmm::CompletionString::get_cursor(CXTranslationUnit &tu) con
|
|
|
|
|
|
|
|
|
|
VisitorData visitor_data{chunks, parent_parts, clangmm::Cursor()}; |
|
|
|
|
|
|
|
|
|
clang_visitChildren(clang_getTranslationUnitCursor(tu), [](CXCursor cx_cursor, CXCursor cx_parent, CXClientData cx_data) { |
|
|
|
|
clang_visitChildren( |
|
|
|
|
clang_getTranslationUnitCursor(tu), |
|
|
|
|
[](CXCursor cx_cursor, CXCursor cx_parent, CXClientData cx_data) { |
|
|
|
|
auto data = static_cast<VisitorData *>(cx_data); |
|
|
|
|
|
|
|
|
|
bool equal = true; |
|
|
|
|
@ -128,7 +131,8 @@ clangmm::Cursor clangmm::CompletionString::get_cursor(CXTranslationUnit &tu) con
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return CXChildVisit_Recurse; |
|
|
|
|
}, &visitor_data); |
|
|
|
|
}, |
|
|
|
|
&visitor_data); |
|
|
|
|
|
|
|
|
|
return Cursor(visitor_data.found_cursor); |
|
|
|
|
} |
|
|
|
|
|