Skip to content

Commit

Permalink
add is_variadic to method (#56)
Browse files Browse the repository at this point in the history
for variadic function
  • Loading branch information
guoxianzhe authored Dec 5, 2024
1 parent 033a8b4 commit f08e270
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cxx-parser/cxx/terra/include/terra.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ namespace terra
method.is_overriding = cppast::is_overriding(cpp_member_function.virtual_info());
method.is_const = cpp_member_function.cv_qualifier() == cppast::cpp_cv::cpp_cv_const;
method.signature = cpp_member_function.signature();
method.is_variadic = cpp_member_function.is_variadic();
}

void parse_constructor(
Expand Down Expand Up @@ -1169,6 +1170,7 @@ namespace terra
json["is_overriding"] = node->is_overriding;
json["is_const"] = node->is_const;
json["signature"] = node->signature;
json["is_variadic"] = node->is_variadic;
}

void Variable2Json(Variable *node, nlohmann::json &json)
Expand Down
3 changes: 2 additions & 1 deletion cxx-parser/cxx/terra/include/terra_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,9 @@ namespace terra
bool is_overriding;
bool is_const;
std::string signature;
bool is_variadic;
} MemberFunction;
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(MemberFunction, name, is_virtual, return_type, parameters, access_specifier, is_overriding, signature, namespaces, file_path);
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(MemberFunction, name, is_virtual, return_type, parameters, access_specifier, is_overriding, signature, is_variadic, namespaces, file_path);

typedef struct MemberVariable : BaseNode
{
Expand Down
1 change: 1 addition & 0 deletions cxx-parser/src/cxx_terra_node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ export class MemberFunction extends CXXTerraNode {
is_overriding: boolean = false;
is_const: boolean = false;
signature: string = '';
is_variadic: boolean = false;

override get fullName(): string {
return `${this.parent?.fullName}.${this.name}`;
Expand Down

0 comments on commit f08e270

Please sign in to comment.