================
@@ -167,9 +184,31 @@ static void genMarkdown(const ClangDocContext &CDCtx, 
const EnumInfo &I,
 
   std::string Buffer;
   llvm::raw_string_ostream Members(Buffer);
-  if (!I.Members.empty())
-    for (const auto &N : I.Members)
-      Members << "| " << N.Name << " |\n";
+  if (!I.Members.empty()) {
+    OS << "| Name | Value |";
+    bool HasComments = false;
+    for (const auto &Member : I.Members) {
+      if (!Member.Description.empty()) {
+        HasComments = true;
+        break;
+      }
+    }
+    if (HasComments)
+      OS << " Comments |";
+    OS << "\n\n";
+    for (const auto &N : I.Members) {
+      Members << "| " << N.Name << " ";
+      if (!N.Value.empty())
+        Members << "| " << N.Value << " ";
+      if (HasComments) {
+        std::string RawComment = genRawText(N.Description);
+        RawComment.erase(0, RawComment.find_first_not_of(" \t\r\n"));
+        RawComment.erase(RawComment.find_last_not_of(" \t\r\n") + 1);
----------------
ilovepi wrote:

There's also `StringRef.trim()`, which is maybe a better method for handling 
this type of thing, since it seems like you're trying to remove things from the 
beginning and end. 

https://github.com/llvm/llvm-project/pull/183085
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to