Parse cpp_namespace
This commit is contained in:
parent
51567da741
commit
ce69b0157f
11 changed files with 160 additions and 16 deletions
|
|
@ -4,13 +4,28 @@
|
|||
|
||||
#include "parse_functions.hpp"
|
||||
|
||||
#include "parse_error.hpp"
|
||||
|
||||
using namespace cppast;
|
||||
|
||||
cpp_entity_id detail::get_entity_id(const CXCursor& cur)
|
||||
{
|
||||
cxstring usr(clang_getCursorUSR(cur));
|
||||
DEBUG_ASSERT(!usr.empty(), detail::parse_error_handler{}, cur, "cannot create id for entity");
|
||||
return cpp_entity_id(usr.c_str());
|
||||
}
|
||||
|
||||
std::unique_ptr<cpp_entity> detail::parse_entity(const detail::parse_context& context,
|
||||
const CXCursor& cur) try
|
||||
{
|
||||
auto kind = clang_getCursorKind(cur);
|
||||
switch (kind)
|
||||
{
|
||||
case CXCursor_Namespace:
|
||||
return parse_cpp_namespace(context, cur);
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
catch (parse_error& ex)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue