From 6b958d083e68dd674d2ff35fd722ece8f758bd61 Mon Sep 17 00:00:00 2001 From: eidheim Date: Fri, 17 Jul 2015 14:55:16 +0200 Subject: [PATCH] Added one more friend class. --- src/Token.h | 3 ++- src/Tokens.cc | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Token.h b/src/Token.h index 77b4e89..15ded6c 100644 --- a/src/Token.h +++ b/src/Token.h @@ -16,9 +16,10 @@ namespace clang { }; class Token { - public: + friend class Tokens; Token(CXTranslationUnit &cx_tu, CXToken &cx_token, CXCursor &cx_cursor): cx_tu(cx_tu), cx_token(cx_token), cx_cursor(cx_cursor), offsets(get_source_range().get_offsets()) {}; + public: const TokenKind get_kind(); std::string get_spelling(); SourceLocation get_source_location(); diff --git a/src/Tokens.cc b/src/Tokens.cc index a597557..50d9ebe 100644 --- a/src/Tokens.cc +++ b/src/Tokens.cc @@ -8,7 +8,7 @@ clang::Tokens::Tokens(CXTranslationUnit &cx_tu, const SourceRange &range): cx_tu cx_cursors.reserve(num_tokens); clang_annotateTokens(cx_tu, cx_tokens, num_tokens, cx_cursors.data()); for (unsigned i = 0; i < num_tokens; i++) { - emplace_back(cx_tu, cx_tokens[i], cx_cursors[i]); + emplace_back(Token(cx_tu, cx_tokens[i], cx_cursors[i])); } }