Browse Source

Added one more friend class.

merge-requests/37/head
eidheim 11 years ago
parent
commit
6b958d083e
  1. 3
      src/Token.h
  2. 2
      src/Tokens.cc

3
src/Token.h

@ -16,9 +16,10 @@ namespace clang {
}; };
class Token { class Token {
public: friend class Tokens;
Token(CXTranslationUnit &cx_tu, CXToken &cx_token, CXCursor &cx_cursor): 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()) {}; cx_tu(cx_tu), cx_token(cx_token), cx_cursor(cx_cursor), offsets(get_source_range().get_offsets()) {};
public:
const TokenKind get_kind(); const TokenKind get_kind();
std::string get_spelling(); std::string get_spelling();
SourceLocation get_source_location(); SourceLocation get_source_location();

2
src/Tokens.cc

@ -8,7 +8,7 @@ clang::Tokens::Tokens(CXTranslationUnit &cx_tu, const SourceRange &range): cx_tu
cx_cursors.reserve(num_tokens); cx_cursors.reserve(num_tokens);
clang_annotateTokens(cx_tu, cx_tokens, num_tokens, cx_cursors.data()); clang_annotateTokens(cx_tu, cx_tokens, num_tokens, cx_cursors.data());
for (unsigned i = 0; i < num_tokens; i++) { 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]));
} }
} }

Loading…
Cancel
Save