[PATCH v4 14/19] scripts: apibuild: fix parsing block comments from typedef enum

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Removed the TODO as we can rely to the serialize_typedef() the job to
report missing comments.

Signed-off-by: Victor Toso <victortoso@xxxxxxxxxx>
---
 scripts/apibuild.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/scripts/apibuild.py b/scripts/apibuild.py
index 19e897b1ba..ddc2fff7af 100755
--- a/scripts/apibuild.py
+++ b/scripts/apibuild.py
@@ -1145,6 +1145,12 @@ class CParser:
     def parseTypedef(self, token):
         if token is None:
             return None
+
+        # With typedef enum types, we can have comments parsed before the
+        # enum themselves. The parsing of enum values does clear the
+        # self.comment variable. So we store it here for later.
+        typedef_comment = self.comment
+
         token = self.parseType(token)
         if token is None:
             self.error("parsing typedef")
@@ -1168,7 +1174,7 @@ class CParser:
                                        "struct", type)
                         base_type = "struct " + name
                     else:
-                        # TODO report missing or misformatted comments
+                        self.comment = typedef_comment
                         info = self.parseTypeComment(name, 1)
                         self.index_add(name, self.filename, not self.is_header,
                                        "typedef", type, info)
-- 
2.35.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux