From: "Martin Liška" <mliska@suse.cz>
To: David Malcolm <dmalcolm@redhat.com>, gcc-patches@gcc.gnu.org
Subject: [PATCH 2/2] Doxygen: transform ENUM_BITFIELD and comments starting with '/**'.
Date: Fri, 28 Apr 2017 12:41:00 -0000 [thread overview]
Message-ID: <ff7a44c3-d973-4003-9584-7586b1a371f1@suse.cz> (raw)
In-Reply-To: <1489715500-63153-1-git-send-email-dmalcolm@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 452 bytes --]
Hi.
As mentioned in the subject, another 2 transformations. With David's patch applied and
my 2 hunks, I can see just these 3 warnings related to verbatim/end verbatim decoration:
/home/marxin/Programming/gcc/gcc/gcov-io.c:464: warning: unexpected command endverbatim
/home/marxin/Programming/gcc/gcc/common.md:19: warning: unexpected command endverbatim
/home/marxin/Programming/gcc/gcc/domwalk.h:47: warning: unexpected command endverbatim
Martin
[-- Attachment #2: 0002-Doxygen-transform-ENUM_BITFIELD-and-comments-startin.patch --]
[-- Type: text/x-patch, Size: 2865 bytes --]
From a29b960344128d34f9dbe8f0bbf1e282694beb5b Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Fri, 28 Apr 2017 13:52:57 +0200
Subject: [PATCH 2/2] Doxygen: transform ENUM_BITFIELD and comments starting
with '/**'.
contrib/ChangeLog:
2017-04-28 Martin Liska <mliska@suse.cz>
* filter_params.py:
Transform ENUM_BITFIELD and comments starting with '/**'
---
contrib/filter_params.py | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/contrib/filter_params.py b/contrib/filter_params.py
index f94d201bbf8..a82a8d5728c 100644
--- a/contrib/filter_params.py
+++ b/contrib/filter_params.py
@@ -34,6 +34,11 @@ def filter_src(text):
# so that doxygen will parse them.
#
# Only comments that begin on the left-most column are converted.
+ #
+ text = re.sub(r'^/\*\* ',
+ r'/** @verbatim ',
+ text,
+ flags=re.MULTILINE)
text = re.sub(r'^/\* ',
r'/** @verbatim ',
text,
@@ -58,6 +63,11 @@ def filter_src(text):
r'(\1)',
text)
+ # Replace 'ENUM_BITFIELD(enum_name)' with 'enum enum_name'.
+ text = re.sub('ENUM_BITFIELD\s*\(([^\)]*)\)',
+ r'enum \1',
+ text)
+
return text
class FilteringTests(unittest.TestCase):
@@ -81,6 +91,21 @@ class FilteringTests(unittest.TestCase):
' NEXT_LINE\n'
' FINAL_LINE. @endverbatim */\n'))
+ def test_comment_example_gengtype(self):
+ self.assert_filters_to(
+ ('/** Allocate and initialize an input buffer state.\n'
+ ' * @param file A readable stream.\n'
+ ' * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.\n'
+ ' * \n'
+ ' * @return the allocated buffer state.\n'
+ ' */'),
+ ('/** @verbatim Allocate and initialize an input buffer state.\n'
+ ' * @param file A readable stream.\n'
+ ' * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.\n'
+ ' * \n'
+ ' * @return the allocated buffer state.\n'
+ ' @endverbatim */'))
+
def test_oneliner_comment(self):
self.assert_filters_to(
'/* Returns the string representing CLASS. */\n',
@@ -131,6 +156,11 @@ class FilteringTests(unittest.TestCase):
'char *strcpy PARAMS ((char *dest, char *source));\n',
'char *strcpy (char *dest, char *source);\n')
+ def test_ENUM_BITFIELD(self):
+ self.assert_filters_to(
+ ' ENUM_BITFIELD (sym_intent) intent:2;\n',
+ ' enum sym_intent intent:2;\n')
+
def act_on_files(argv):
for filename in argv[1:]:
with open(filename) as f:
--
2.12.2
next prev parent reply other threads:[~2017-04-28 12:18 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-31 22:11 [PATCH] Support multiline GTY markers in Doxygen filter; add unittests David Malcolm
2013-11-01 15:16 ` Diego Novillo
2017-03-17 1:21 ` [PATCH 1/2] Port Doxygen support script from Perl to Python; " David Malcolm
2017-03-17 1:21 ` [PATCH 2/2] filter_params.py: GTY fix and other cleanups David Malcolm
2017-04-28 12:25 ` [PATCH 1/2] Port Doxygen support script from Perl to Python; add unittests Martin Liška
2017-05-03 9:49 ` [PATCH] Doxygen: add default location for filters and output folder Martin Liška
2017-05-31 12:43 ` [PATCH 1/2] Port Doxygen support script from Perl to Python; add unittests Martin Liška
2017-04-28 12:30 ` [PATCH 1/2] Change comment style to one we normally use Martin Liška
2017-04-28 12:41 ` Martin Liška [this message]
2017-04-29 2:57 ` [PING] Re: [PATCH 1/2] Port Doxygen support script from Perl to Python; add unittests David Malcolm
2017-05-19 9:14 ` Martin Liška
2017-05-26 19:35 ` [PING^2] " David Malcolm
2017-05-31 14:07 ` [PATCH] " Martin Liška
2017-05-31 14:10 ` Martin Liška
2017-05-31 14:13 ` Martin Liška
2017-06-22 12:45 ` Martin Liška
2017-06-28 4:41 ` Jeff Law
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ff7a44c3-d973-4003-9584-7586b1a371f1@suse.cz \
--to=mliska@suse.cz \
--cc=dmalcolm@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).