diff --git a/cxx-parser/__integration_test__/cxx_parser.integration.test.ts b/cxx-parser/__integration_test__/cxx_parser.integration.test.ts index 3e32897..fdf3f53 100644 --- a/cxx-parser/__integration_test__/cxx_parser.integration.test.ts +++ b/cxx-parser/__integration_test__/cxx_parser.integration.test.ts @@ -57,6 +57,7 @@ describe('cxx_parser', () => { { "__TYPE":"MemberVariable", "access_specifier":"", + "comment":"", "is_mutable":false, "name":"a", "type":{ @@ -126,6 +127,7 @@ describe('cxx_parser', () => { { "__TYPE":"MemberVariable", "access_specifier":"", + "comment":"", "is_mutable":false, "name":"a", "type":{ @@ -199,6 +201,7 @@ describe('cxx_parser', () => { { "__TYPE":"MemberVariable", "access_specifier":"", + "comment":"", "is_mutable":false, "name":"a", "type":{ @@ -268,6 +271,7 @@ describe('cxx_parser', () => { "enum_constants": [ { "__TYPE": "EnumConstant", + "comment":"", "name": "A", "source": "0", "value": "0" @@ -329,6 +333,7 @@ describe('cxx_parser', () => { "enum_constants": [ { "__TYPE": "EnumConstant", + "comment":"", "name": "A", "source": "0", "value": "0" @@ -456,6 +461,7 @@ describe('cxx_parser', () => { { "__TYPE":"MemberVariable", "access_specifier":"", + "comment":"", "is_mutable":false, "name":"a", "type":{ diff --git a/cxx-parser/cxx/terra/include/terra.hpp b/cxx-parser/cxx/terra/include/terra.hpp index d7c5469..fc8db8c 100644 --- a/cxx-parser/cxx/terra/include/terra.hpp +++ b/cxx-parser/cxx/terra/include/terra.hpp @@ -218,6 +218,7 @@ namespace terra SimpleType param_type; to_simple_type(param_type, cpp_variable_base.type()); parameter.type = param_type; + parameter.comment = parse_comment(cpp_variable_base); std::string default_value = ""; if (cpp_variable_base.default_value().has_value()) @@ -300,6 +301,7 @@ namespace terra { EnumConstant enum_constant; enum_constant.name = en.name(); + enum_constant.comment = parse_comment(en); enum_constant.parent_name = cpp_enum.name(); if (en.value().has_value()) { @@ -1082,6 +1084,7 @@ namespace terra json["type"] = typeJson; json["is_mutable"] = node->is_mutable; + json["comment"] = node->comment; json["access_specifier"] = node->access_specifier; } @@ -1091,6 +1094,7 @@ namespace terra json["name"] = node->name; json["value"] = node->value; json["source"] = node->source; + json["comment"] = node->comment; } };