[rtems-central commit] content: Discard empty Doxygen blocks

Sebastian Huber sebh at rtems.org
Wed Feb 3 05:28:01 UTC 2021


Module:    rtems-central
Branch:    master
Commit:    e82333a0d8ffd51350cbab0b85bb9b81e7d5d6ba
Changeset: http://git.rtems.org/rtems-central/commit/?id=e82333a0d8ffd51350cbab0b85bb9b81e7d5d6ba

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Feb  2 14:18:37 2021 +0100

content: Discard empty Doxygen blocks

---

 rtemsspec/content.py                     |  4 ++++
 rtemsspec/tests/spec-interface/func6.yml | 29 +++++++++++++++++++++++++++++
 rtemsspec/tests/test_interface.py        |  3 +++
 3 files changed, 36 insertions(+)

diff --git a/rtemsspec/content.py b/rtemsspec/content.py
index 7f65949..19f0bbb 100644
--- a/rtemsspec/content.py
+++ b/rtemsspec/content.py
@@ -742,6 +742,10 @@ class CContent(Content):
         yield
         self.close_comment_block()
 
+        # Discard empty Doxygen blocks
+        if self._lines[-2] == "/**":
+            self._lines = self._lines[:-3]
+
     @contextmanager
     def file_block(self) -> Iterator[None]:
         """ Opens a Doxygen @file comment block context. """
diff --git a/rtemsspec/tests/spec-interface/func6.yml b/rtemsspec/tests/spec-interface/func6.yml
new file mode 100644
index 0000000..7a2455a
--- /dev/null
+++ b/rtemsspec/tests/spec-interface/func6.yml
@@ -0,0 +1,29 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+brief: null
+copyrights:
+- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+definition:
+  default:
+    attributes: null
+    body: null
+    params:
+    - int ${.:/params[0]/name}
+    return: void
+  variants: []
+description: null
+enabled-by: true
+index-entries: []
+interface-type: function
+links:
+- role: interface-placement
+  uid: h
+name: Function6
+notes: null
+params:
+- description: null
+  dir: null
+  name: Param0
+return:
+  return: null
+  return-values: []
+type: interface
diff --git a/rtemsspec/tests/test_interface.py b/rtemsspec/tests/test_interface.py
index b3bf4d3..4d05d3a 100644
--- a/rtemsspec/tests/test_interface.py
+++ b/rtemsspec/tests/test_interface.py
@@ -239,6 +239,9 @@ void Function(
   int       *Param4
 );
 
+/* Generated from spec:/func6 */
+void Function6( int Param0 );
+
 /* Generated from spec:/macro */
 
 /**



More information about the vc mailing list