Skip to content

Commit

Permalink
Another crack at filtering out type-parameter-N-M
Browse files Browse the repository at this point in the history
  • Loading branch information
fosterbrereton committed Oct 26, 2018
1 parent 94ac989 commit 53b1601
Show file tree
Hide file tree
Showing 7 changed files with 123 additions and 153 deletions.
8 changes: 4 additions & 4 deletions matchers/class_matcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class FindStaticMembers : public RecursiveASTVisitor<FindStaticMembers> {
auto type = hyde::StandardDeclInfo(context, d);
auto name = type["qualified_name"].get<std::string>();
type["static"] = true;
type["type"] = hyde::to_string(context, d->getType());
type["type"] = hyde::to_string(d, d->getType());
static_members[name] = type;
}
return true;
Expand Down Expand Up @@ -151,7 +151,7 @@ void ClassInfo::run(const MatchFinder::MatchResult& Result) {
if (!AccessCheck(_access_filter, field->getAccess())) continue;

json fieldInfo = StandardDeclInfo(Result.Context, field);
fieldInfo["type"] = hyde::to_string(Result.Context, field->getType());
fieldInfo["type"] = hyde::to_string(field, field->getType());
info["fields"][static_cast<const std::string&>(fieldInfo["qualified_name"])] =
fieldInfo; // can't move this into place for some reason.
}
Expand All @@ -174,7 +174,7 @@ void ClassInfo::run(const MatchFinder::MatchResult& Result) {
if (!AccessCheck(_access_filter, type_def->getAccess())) continue;

json typedefInfo = StandardDeclInfo(Result.Context, type_def);
typedefInfo["type"] = hyde::to_string(Result.Context, type_def->getUnderlyingType());
typedefInfo["type"] = hyde::to_string(type_def, type_def->getUnderlyingType());

info["typedefs"].push_back(std::move(typedefInfo));
}
Expand All @@ -188,7 +188,7 @@ void ClassInfo::run(const MatchFinder::MatchResult& Result) {
if (!AccessCheck(_access_filter, type_alias->getAccess())) continue;

json typealiasInfo = StandardDeclInfo(Result.Context, type_alias);
typealiasInfo["type"] = hyde::to_string(Result.Context, type_alias->getUnderlyingType());
typealiasInfo["type"] = hyde::to_string(type_alias, type_alias->getUnderlyingType());
if (auto template_decl = type_alias->getDescribedAliasTemplate()) {
typealiasInfo["template_parameters"] =
GetTemplateParameters(Result.Context, template_decl);
Expand Down
2 changes: 1 addition & 1 deletion matchers/enum_matcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void EnumInfo::run(const MatchFinder::MatchResult& Result) {
json info = StandardDeclInfo(Result.Context, enumeration);
//info["scoped"] = enumeration->isScoped();
//info["fixed"] = enumeration->isFixed();
info["type"] = hyde::to_string(Result.Context, enumeration->getIntegerType());
info["type"] = hyde::to_string(enumeration, enumeration->getIntegerType());
info["values"] = json::array();

for (const auto& p : enumeration->enumerators()) {
Expand Down
4 changes: 2 additions & 2 deletions matchers/matcher_fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ namespace hyde {
/**************************************************************************************************/

enum ToolAccessFilter {
ToolAccessFilterPublic,
ToolAccessFilterPrivate,
ToolAccessFilterProtected,
ToolAccessFilterPrivate
ToolAccessFilterPublic,
};

/**************************************************************************************************/
Expand Down
2 changes: 1 addition & 1 deletion matchers/typealias_matcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void TypeAliasInfo::run(const MatchFinder::MatchResult& Result) {
// do not process class type aliases here.
if (!info["parents"].empty()) return;

info["type"] = hyde::to_string(Result.Context, node->getUnderlyingType());
info["type"] = hyde::to_string(node, node->getUnderlyingType());

if (auto template_decl = node->getDescribedAliasTemplate()) {
info["template_parameters"] = GetTemplateParameters(Result.Context, template_decl);
Expand Down
2 changes: 1 addition & 1 deletion matchers/typedef_matcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void TypedefInfo::run(const MatchFinder::MatchResult& Result) {
// do not process class type aliases here.
if (!info["parents"].empty()) return;

info["type"] = hyde::to_string(Result.Context, node->getUnderlyingType());
info["type"] = hyde::to_string(node, node->getUnderlyingType());

_j["typedefs"].push_back(std::move(info));
}
Expand Down
Loading

0 comments on commit 53b1601

Please sign in to comment.