Browse Source

Cleanup, added Cursor::Type class, and extra functions to Cursor

merge-requests/37/head
eidheim 10 years ago
parent
commit
ca2021d935
  1. 4
      src/CodeCompleteResults.cc
  2. 6
      src/CompilationDatabase.cc
  3. 1
      src/CompilationDatabase.h
  4. 10
      src/CompileCommand.cc
  5. 11
      src/CompileCommands.cc
  6. 9
      src/CompletionString.cc
  7. 54
      src/Cursor.cc
  8. 26
      src/Cursor.h
  9. 10
      src/Diagnostic.cc
  10. 3
      src/Index.cc
  11. 2
      src/SourceLocation.cc
  12. 3
      src/SourceRange.cc
  13. 6
      src/Token.cc
  14. 19
      src/Token.h
  15. 24
      src/Tokens.cc
  16. 2
      src/Tokens.h
  17. 26
      src/TranslationUnit.cc
  18. 2
      tests/Cursor_H_Test.cc
  19. 2
      tests/Token_H_Test.cc

4
src/CodeCompleteResults.cc

@ -7,7 +7,7 @@ clang::CodeCompleteResults::CodeCompleteResults(CXTranslationUnit &cx_tu,
const std::string &buffer,
unsigned line_num, unsigned column) {
CXUnsavedFile files[1];
auto file_path=clang::to_string(clang_getTranslationUnitSpelling(cx_tu));
auto file_path=to_string(clang_getTranslationUnitSpelling(cx_tu));
files[0].Filename = file_path.c_str();
files[0].Contents = buffer.c_str();
files[0].Length = buffer.size();
@ -41,5 +41,5 @@ clang::CompletionString clang::CodeCompleteResults::get(unsigned i) const {
}
std::string clang::CodeCompleteResults::get_usr() const {
return clang::to_string(clang_codeCompleteGetContainerUSR(cx_results));
return to_string(clang_codeCompleteGetContainerUSR(cx_results));
}

6
src/CompilationDatabase.cc

@ -1,8 +1,7 @@
#include "CompilationDatabase.h"
#include <exception>
clang::CompilationDatabase::
CompilationDatabase(const std::string &project_path) {
clang::CompilationDatabase::CompilationDatabase(const std::string &project_path) {
CXCompilationDatabase_Error error;
cx_db = clang_CompilationDatabase_fromDirectory(project_path.c_str(), &error);
if(error) {
@ -10,7 +9,6 @@ CompilationDatabase(const std::string &project_path) {
}
}
clang::CompilationDatabase::
~CompilationDatabase() {
clang::CompilationDatabase::~CompilationDatabase() {
clang_CompilationDatabase_dispose(cx_db);
}

1
src/CompilationDatabase.h

@ -8,7 +8,6 @@ namespace clang {
class CompilationDatabase {
public:
explicit CompilationDatabase(const std::string &project_path);
CompilationDatabase();
~CompilationDatabase();
CXCompilationDatabase cx_db;

10
src/CompileCommand.cc

@ -2,22 +2,20 @@
#include "CompileCommands.h"
#include "Utility.h"
std::string clang::CompileCommand::
get_command() {
std::string clang::CompileCommand::get_command() {
std::string res;
unsigned N = clang_CompileCommand_getNumArgs(cx_command);
for (unsigned i = 0; i < N; i++) {
res += clang::to_string(clang_CompileCommand_getArg(cx_command, i));
res += to_string(clang_CompileCommand_getArg(cx_command, i));
}
return res;
}
std::vector<std::string> clang::CompileCommand::
get_command_as_args() {
std::vector<std::string> clang::CompileCommand::get_command_as_args() {
unsigned N = clang_CompileCommand_getNumArgs(cx_command);
std::vector<std::string> res(N);
for (unsigned i = 0; i < N; i++) {
res[i] = clang::to_string(clang_CompileCommand_getArg(cx_command, i));
res[i] = to_string(clang_CompileCommand_getArg(cx_command, i));
}
return res;
}

11
src/CompileCommands.cc

@ -1,22 +1,19 @@
#include "CompileCommands.h"
clang::CompileCommands::
CompileCommands(const std::string &filename, CompilationDatabase &db) {
clang::CompileCommands::CompileCommands(const std::string &filename, CompilationDatabase &db) {
cx_commands =
clang_CompilationDatabase_getCompileCommands(db.cx_db, filename.c_str());
if(clang_CompileCommands_getSize(cx_commands)==0)
cx_commands = clang_CompilationDatabase_getAllCompileCommands(db.cx_db);
}
clang::CompileCommands::
~CompileCommands() {
clang::CompileCommands::~CompileCommands() {
clang_CompileCommands_dispose(cx_commands);
}
std::vector<clang::CompileCommand> clang::CompileCommands::
get_commands() {
std::vector<clang::CompileCommand> clang::CompileCommands::get_commands() {
unsigned N = clang_CompileCommands_getSize(cx_commands);
std::vector<clang::CompileCommand> res;
std::vector<CompileCommand> res;
for (unsigned i = 0; i < N; i++) {
res.emplace_back(clang_CompileCommands_getCommand(cx_commands, i));
}

9
src/CompletionString.cc

@ -13,17 +13,16 @@ unsigned clang::CompletionString::get_num_chunks() {
}
std::vector<clang::CompletionChunk> clang::CompletionString::get_chunks() {
std::vector<clang::CompletionChunk> res;
std::vector<CompletionChunk> res;
for (unsigned i = 0; i < get_num_chunks(); i++) {
res.emplace_back(clang::to_string(clang_getCompletionChunkText(cx_completion_sting, i)), static_cast<CompletionChunkKind> (clang_getCompletionChunkKind(cx_completion_sting, i)));
res.emplace_back(to_string(clang_getCompletionChunkText(cx_completion_sting, i)), static_cast<CompletionChunkKind> (clang_getCompletionChunkKind(cx_completion_sting, i)));
}
return res;
}
std::string clang::CompletionString::get_brief_comments() {
return clang::to_string(clang_getCompletionBriefComment(cx_completion_sting));
return to_string(clang_getCompletionBriefComment(cx_completion_sting));
}
clang::CompletionChunk::
CompletionChunk(std::string chunk, clang::CompletionChunkKind kind) :
clang::CompletionChunk::CompletionChunk(std::string chunk, CompletionChunkKind kind) :
chunk(chunk), kind(kind) { }

54
src/Cursor.cc

@ -2,8 +2,24 @@
#include "Utility.h"
#include <algorithm>
clang::CursorKind clang::Cursor::get_kind() {
return static_cast<CursorKind>(clang_getCursorKind(this->cx_cursor));
std::string clang::Cursor::Type::get_spelling() const {
return to_string(clang_getTypeSpelling(cx_type));
}
clang::Cursor::Type clang::Cursor::Type::get_result() const {
return Type(clang_getResultType(cx_type));
}
bool clang::Cursor::Type::operator==(const Cursor::Type& rhs) const {
return clang_equalTypes(cx_type, rhs.cx_type);
}
clang::Cursor::Kind clang::Cursor::get_kind() const {
return static_cast<Kind>(clang_getCursorKind(cx_cursor));
}
clang::Cursor::Type clang::Cursor::get_type() const {
return Type(clang_getCursorType(cx_cursor));
}
clang::SourceLocation clang::Cursor::get_source_location() const {
@ -15,19 +31,35 @@ clang::SourceRange clang::Cursor::get_source_range() const {
}
std::string clang::Cursor::get_spelling() const {
return clang::to_string(clang_getCursorSpelling(cx_cursor));
return to_string(clang_getCursorSpelling(cx_cursor));
}
std::string clang::Cursor::get_usr() const {
return clang::to_string(clang_getCursorUSR(cx_cursor));
return to_string(clang_getCursorUSR(cx_cursor));
}
clang::Cursor clang::Cursor::get_referenced() const {
return Cursor(clang_getCursorReferenced(cx_cursor));
}
clang::Cursor clang::Cursor::get_canonical() const {
return Cursor(clang_getCanonicalCursor(cx_cursor));
}
clang::Cursor clang::Cursor::get_definition() const {
return Cursor(clang_getCursorDefinition(cx_cursor));
}
clang::Cursor clang::Cursor::get_semantic_parent() const {
return clang::Cursor(clang_getCursorSemanticParent(cx_cursor));
return Cursor(clang_getCursorSemanticParent(cx_cursor));
}
std::vector<clang::Cursor> clang::Cursor::get_arguments() const {
std::vector<Cursor> cursors;
auto size=clang_Cursor_getNumArguments(cx_cursor);
for(int c=0;c<size;++c)
cursors.emplace_back(clang_Cursor_getArgument(cx_cursor, c));
return cursors;
}
clang::Cursor::operator bool() const {
@ -38,7 +70,7 @@ bool clang::Cursor::operator==(const Cursor& rhs) const {
return clang_equalCursors(cx_cursor, rhs.cx_cursor);
}
bool clang::Cursor::has_type() {
bool clang::Cursor::has_type_description() {
auto referenced=clang_getCursorReferenced(cx_cursor);
if(clang_Cursor_isNull(referenced))
return false;
@ -46,18 +78,18 @@ bool clang::Cursor::has_type() {
return type.kind!=0;
}
std::string clang::Cursor::get_type() {
std::string clang::Cursor::get_type_description() {
std::string spelling;
auto referenced=clang_getCursorReferenced(cx_cursor);
if(!clang_Cursor_isNull(referenced)) {
auto type=clang_getCursorType(referenced);
spelling=clang::to_string(clang_getTypeSpelling(type));
spelling=to_string(clang_getTypeSpelling(type));
#if CINDEX_VERSION_MAJOR==0 && CINDEX_VERSION_MINOR<32
const std::string auto_str="auto";
if(spelling.size()>=4 && std::equal(auto_str.begin(), auto_str.end(), spelling.begin())) {
auto canonical_type=clang_getCanonicalType(clang_getCursorType(cx_cursor));
auto canonical_spelling=clang::to_string(clang_getTypeSpelling(canonical_type));
auto canonical_spelling=to_string(clang_getTypeSpelling(canonical_type));
if(spelling.size()>5 && spelling[4]==' ' && spelling[5]=='&' && spelling!=canonical_spelling)
return canonical_spelling+" &";
else
@ -67,7 +99,7 @@ std::string clang::Cursor::get_type() {
const std::string const_auto_str="const auto";
if(spelling.size()>=10 && std::equal(const_auto_str.begin(), const_auto_str.end(), spelling.begin())) {
auto canonical_type=clang_getCanonicalType(clang_getCursorType(cx_cursor));
auto canonical_spelling=clang::to_string(clang_getTypeSpelling(canonical_type));
auto canonical_spelling=to_string(clang_getTypeSpelling(canonical_type));
if(spelling.size()>11 && spelling[10]==' ' && spelling[11]=='&' && spelling!=canonical_spelling)
return canonical_spelling+" &";
else
@ -83,7 +115,7 @@ std::string clang::Cursor::get_brief_comments() {
std::string comment_string;
auto referenced=get_referenced();
if(referenced) {
comment_string=clang::to_string(clang_Cursor_getBriefCommentText(referenced.cx_cursor));
comment_string=to_string(clang_Cursor_getBriefCommentText(referenced.cx_cursor));
}
return comment_string;
}

26
src/Cursor.h

@ -4,9 +4,12 @@
#include "SourceLocation.h"
#include "SourceRange.h"
#include <string>
#include <vector>
namespace clang {
enum class CursorKind {
class Cursor {
public:
enum class Kind {
UnexposedDecl = 1,
StructDecl = 2,
UnionDecl = 3,
@ -173,23 +176,34 @@ namespace clang {
FirstExtraDecl = ModuleImportDecl,
LastExtraDecl = ModuleImportDecl,
};
class Cursor {
class Type {
public:
Type(const CXType &cx_type) : cx_type(cx_type) {}
std::string get_spelling() const;
Type get_result() const;
bool operator==(const Cursor::Type& rhs) const;
CXType cx_type;
};
Cursor() { cx_cursor=clang_getNullCursor(); }
Cursor(const CXCursor &cx_cursor) : cx_cursor(cx_cursor) {}
CursorKind get_kind();
Kind get_kind() const;
Type get_type() const;
SourceLocation get_source_location() const;
SourceRange get_source_range() const;
std::string get_spelling() const;
std::string get_usr() const;
Cursor get_referenced() const;
Cursor get_canonical() const;
Cursor get_definition() const;
Cursor get_semantic_parent() const;
std::vector<Cursor> get_arguments() const;
operator bool() const;
bool operator==(const Cursor& rhs) const;
bool has_type();
std::string get_type();
bool has_type_description();
std::string get_type_description();
std::string get_brief_comments();
CXCursor cx_cursor;

10
src/Diagnostic.cc

@ -6,20 +6,20 @@
clang::Diagnostic::Diagnostic(CXTranslationUnit& cx_tu, CXDiagnostic& cx_diagnostic) {
severity=clang_getDiagnosticSeverity(cx_diagnostic);
severity_spelling=get_severity_spelling(severity);
spelling=clang::to_string(clang_getDiagnosticSpelling(cx_diagnostic));
spelling=to_string(clang_getDiagnosticSpelling(cx_diagnostic));
clang::SourceLocation start_location(clang_getDiagnosticLocation(cx_diagnostic));
SourceLocation start_location(clang_getDiagnosticLocation(cx_diagnostic));
path=start_location.get_path();
auto start_offset=start_location.get_offset();
clang::Tokens tokens(cx_tu, SourceRange(start_location, start_location));
Tokens tokens(cx_tu, SourceRange(start_location, start_location));
if(tokens.size()==1)
offsets={start_offset, tokens.begin()->offsets.second};
unsigned num_fix_its=clang_getDiagnosticNumFixIts(cx_diagnostic);
for(unsigned c=0;c<num_fix_its;c++) {
CXSourceRange fix_it_range;
auto source=clang::to_string(clang_getDiagnosticFixIt(cx_diagnostic, c, &fix_it_range));
fix_its.emplace_back(source, clang::SourceRange(fix_it_range).get_offsets());
auto source=to_string(clang_getDiagnosticFixIt(cx_diagnostic, c, &fix_it_range));
fix_its.emplace_back(source, SourceRange(fix_it_range).get_offsets());
}
}

3
src/Index.cc

@ -1,7 +1,6 @@
#include "Index.h"
clang::Index::
Index(int excludeDeclarationsFromPCH, int displayDiagnostics) {
clang::Index::Index(int excludeDeclarationsFromPCH, int displayDiagnostics) {
cx_index = clang_createIndex(excludeDeclarationsFromPCH, displayDiagnostics);
}

2
src/SourceLocation.cc

@ -32,7 +32,7 @@ void clang::SourceLocation::get_data(std::string* path, unsigned *line, unsigned
CXFile file;
clang_getExpansionLocation(cx_location, &file, line, column, offset);
if (file!=NULL) {
*path=clang::to_string(clang_getFileName(file));
*path=to_string(clang_getFileName(file));
}
}
}

3
src/SourceRange.cc

@ -1,7 +1,6 @@
#include "SourceRange.h"
clang::SourceRange::
SourceRange(clang::SourceLocation &start, clang::SourceLocation &end) {
clang::SourceRange::SourceRange(clang::SourceLocation &start, clang::SourceLocation &end) {
cx_range = clang_getRange(start.cx_location, end.cx_location);
}

6
src/Token.cc

@ -17,9 +17,9 @@ clang::SourceRange clang::Token::get_source_range() {
}
// returns a string description of this tokens kind
std::string clang::Token::get_spelling() {
return clang::to_string(clang_getTokenSpelling(cx_tu, cx_token));
return to_string(clang_getTokenSpelling(cx_tu, cx_token));
}
clang::TokenKind clang::Token::get_kind() {
return static_cast<TokenKind>(clang_getTokenKind(cx_token));
clang::Token::Kind clang::Token::get_kind() {
return static_cast<Kind>(clang_getTokenKind(cx_token));
}

19
src/Token.h

@ -7,20 +7,21 @@
#include <string>
namespace clang {
enum TokenKind {
Token_Punctuation,
Token_Keyword,
Token_Identifier,
Token_Literal,
Token_Comment
};
class Token {
friend class Tokens;
public:
enum Kind {
Punctuation,
Keyword,
Identifier,
Literal,
Comment
};
private:
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:
TokenKind get_kind();
Kind get_kind();
std::string get_spelling();
SourceLocation get_source_location();
SourceRange get_source_range();

24
src/Tokens.cc

@ -23,12 +23,12 @@ clang::Tokens::~Tokens() {
//This works across TranslationUnits! However, to get rename refactoring to work,
//one have to open all the files that might include a similar token
//Similar tokens defined as tokens with equal referenced cursors.
std::vector<std::pair<clang::Offset, clang::Offset> > clang::Tokens::get_similar_token_offsets(CursorKind kind,
std::vector<std::pair<clang::Offset, clang::Offset> > clang::Tokens::get_similar_token_offsets(Cursor::Kind kind,
const std::string &spelling,
const std::string &usr) {
std::vector<std::pair<clang::Offset, clang::Offset> > offsets;
std::vector<std::pair<Offset, Offset> > offsets;
for(auto &token: *this) {
if(token.get_kind()==clang::Token_Identifier) {
if(token.get_kind()==Token::Kind::Identifier) {
auto referenced=token.get_cursor().get_referenced();
if(referenced && kind==referenced.get_kind() && spelling==token.get_spelling() && usr==referenced.get_usr())
offsets.emplace_back(token.offsets);
@ -38,19 +38,19 @@ std::vector<std::pair<clang::Offset, clang::Offset> > clang::Tokens::get_similar
}
std::vector<std::pair<std::string, clang::Offset> > clang::Tokens::get_cxx_methods() {
std::vector<std::pair<std::string, clang::Offset> > methods;
clang::Offset last_offset={(unsigned)-1,(unsigned) -1};
std::vector<std::pair<std::string, Offset> > methods;
Offset last_offset={(unsigned)-1,(unsigned) -1};
for(auto &token: *this) {
if(token.get_kind()==clang::Token_Identifier) {
if(token.get_kind()==Token::Kind::Identifier) {
auto cursor=token.get_cursor();
auto kind=cursor.get_kind();
if(kind==clang::CursorKind::CXXMethod || kind==clang::CursorKind::Constructor || kind==clang::CursorKind::Destructor) {
if(kind==Cursor::Kind::CXXMethod || kind==Cursor::Kind::Constructor || kind==Cursor::Kind::Destructor) {
auto offset=cursor.get_source_location().get_offset();
if(offset!=last_offset) {
std::string method;
if(kind==clang::CursorKind::CXXMethod) {
if(kind==Cursor::Kind::CXXMethod) {
auto type=clang_getResultType(clang_getCursorType(cursor.cx_cursor));
method+=clang::to_string(clang_getTypeSpelling(type));
method+=to_string(clang_getTypeSpelling(type));
auto pos=method.find(" ");
if(pos!=std::string::npos)
method.erase(pos, 1);
@ -59,12 +59,12 @@ std::vector<std::pair<std::string, clang::Offset> > clang::Tokens::get_cxx_metho
std::string parent_str;
auto parent=cursor.get_semantic_parent();
while(parent && parent.get_kind()!=clang::CursorKind::TranslationUnit) {
parent_str.insert(0, clang::to_string(clang_getCursorDisplayName(parent.cx_cursor))+"::");
while(parent && parent.get_kind()!=Cursor::Kind::TranslationUnit) {
parent_str.insert(0, to_string(clang_getCursorDisplayName(parent.cx_cursor))+"::");
parent=parent.get_semantic_parent();
}
method+=parent_str+clang::to_string(clang_getCursorDisplayName(cursor.cx_cursor));
method+=parent_str+to_string(clang_getCursorDisplayName(cursor.cx_cursor));
methods.emplace_back(method, offset);
}
last_offset=offset;

2
src/Tokens.h

@ -13,7 +13,7 @@ namespace clang {
Tokens(CXTranslationUnit &cx_tu, const SourceRange &range);
public:
~Tokens();
std::vector<std::pair<clang::Offset, clang::Offset> > get_similar_token_offsets(CursorKind kind,
std::vector<std::pair<clang::Offset, clang::Offset> > get_similar_token_offsets(Cursor::Kind kind,
const std::string &spelling,
const std::string &usr);
std::vector<std::pair<std::string, clang::Offset> > get_cxx_methods();

26
src/TranslationUnit.cc

@ -63,7 +63,7 @@ void clang::TranslationUnit::parse(Index &index, const std::string &file_path,
int clang::TranslationUnit::ReparseTranslationUnit(const std::string &buffer, unsigned flags) {
CXUnsavedFile files[1];
auto file_path=clang::to_string(clang_getTranslationUnitSpelling(cx_tu));
auto file_path=to_string(clang_getTranslationUnitSpelling(cx_tu));
files[0].Filename=file_path.c_str();
files[0].Contents=buffer.c_str();
@ -78,15 +78,15 @@ unsigned clang::TranslationUnit::DefaultFlags() {
clang::CodeCompleteResults clang::TranslationUnit::get_code_completions(const std::string &buffer,
unsigned line_number, unsigned column) {
clang::CodeCompleteResults results(cx_tu, buffer, line_number, column);
CodeCompleteResults results(cx_tu, buffer, line_number, column);
return results;
}
std::vector<clang::Diagnostic> clang::TranslationUnit::get_diagnostics() {
std::vector<clang::Diagnostic> diagnostics;
std::vector<Diagnostic> diagnostics;
for(unsigned c=0;c<clang_getNumDiagnostics(cx_tu);c++) {
CXDiagnostic clang_diagnostic=clang_getDiagnostic(cx_tu, c);
diagnostics.emplace_back(clang::Diagnostic(cx_tu, clang_diagnostic));
diagnostics.emplace_back(Diagnostic(cx_tu, clang_diagnostic));
clang_disposeDiagnostic(clang_diagnostic);
}
return diagnostics;
@ -94,27 +94,27 @@ std::vector<clang::Diagnostic> clang::TranslationUnit::get_diagnostics() {
std::unique_ptr<clang::Tokens> clang::TranslationUnit::get_tokens(unsigned start_offset, unsigned end_offset) {
auto path=clang::to_string(clang_getTranslationUnitSpelling(cx_tu));
clang::SourceLocation start_location(cx_tu, path, start_offset);
clang::SourceLocation end_location(cx_tu, path, end_offset);
clang::SourceRange range(start_location, end_location);
SourceLocation start_location(cx_tu, path, start_offset);
SourceLocation end_location(cx_tu, path, end_offset);
SourceRange range(start_location, end_location);
return std::unique_ptr<Tokens>(new Tokens(cx_tu, range));
}
std::unique_ptr<clang::Tokens> clang::TranslationUnit::get_tokens(unsigned start_line, unsigned start_column,
unsigned end_line, unsigned end_column) {
auto path=clang::to_string(clang_getTranslationUnitSpelling(cx_tu));
clang::SourceLocation start_location(cx_tu, path, start_line, start_column);
clang::SourceLocation end_location(cx_tu, path, end_line, end_column);
clang::SourceRange range(start_location, end_location);
auto path=to_string(clang_getTranslationUnitSpelling(cx_tu));
SourceLocation start_location(cx_tu, path, start_line, start_column);
SourceLocation end_location(cx_tu, path, end_line, end_column);
SourceRange range(start_location, end_location);
return std::unique_ptr<Tokens>(new Tokens(cx_tu, range));
}
clang::Cursor clang::TranslationUnit::get_cursor(std::string path, unsigned offset) {
clang::SourceLocation location(cx_tu, path, offset);
SourceLocation location(cx_tu, path, offset);
return Cursor(clang_getCursor(cx_tu, location.cx_location));
}
clang::Cursor clang::TranslationUnit::get_cursor(std::string path, unsigned line, unsigned column) {
clang::SourceLocation location(cx_tu, path, line, column);
SourceLocation location(cx_tu, path, line, column);
return Cursor(clang_getCursor(cx_tu, location.cx_location));
}

2
tests/Cursor_H_Test.cc

@ -14,5 +14,5 @@ BOOST_AUTO_TEST_CASE(cursor) {
auto cursor=tu.get_cursor(path, 103);
BOOST_CHECK(cursor.get_kind() == clang::CursorKind::ReturnStmt);
BOOST_CHECK(cursor.get_kind() == clang::Cursor::Kind::ReturnStmt);
}

2
tests/Token_H_Test.cc

@ -12,7 +12,7 @@ BOOST_AUTO_TEST_CASE(token) {
auto tokens=tu.get_tokens(0, 113);
BOOST_CHECK(tokens->size() == 32);
BOOST_CHECK((*tokens)[1].get_kind() == clang::TokenKind::Token_Identifier);
BOOST_CHECK((*tokens)[1].get_kind() == clang::Token::Kind::Identifier);
std::string str = (*tokens)[28].get_spelling();
BOOST_CHECK(str == "return");

Loading…
Cancel
Save