Exemple #1
0
void PrintTo(const SourceRange &sourceRange, ::std::ostream* os)
{
    *os << "[";
    PrintTo(sourceRange.start(), os);
    *os << ", ";
    PrintTo(sourceRange.end(), os);
    *os << "]";
}
HighlightingMark::HighlightingMark(const CXCursor &cxCursor,
                                                 CXToken *cxToken,
                                                 CXTranslationUnit cxTranslationUnit)
{
    const SourceRange sourceRange = clang_getTokenExtent(cxTranslationUnit, *cxToken);
    const auto start = sourceRange.start();
    const auto end = sourceRange.end();

    originalCursor = cxCursor;
    line = start.line();
    column = start.column();
    length = end.offset() - start.offset();
    collectKinds(cxToken, originalCursor);
}