From patchwork Fri Apr 28 12:18:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 756356 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wDtC52RbWz9s7s for ; Fri, 28 Apr 2017 22:18:41 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="alUdCZFt"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=w+3DkxdcfU8o7Gh3i 6DcpDolmAHOq0JAwBHYsaYED5+9yuzXmeD5BLOqC2VFFjOG2xeidcRBiCYW6HlnJ p1P0qbme7UUYYKkSXgK+uo/GSFXsFcClv4EhHT7CSAD5LXYD4qtRuAtifs5UCmtN qewqrhakXYmR6339QzOJA157J4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=eH7bfiJEn7YQPTVDvyjfKPg Ai6w=; b=alUdCZFtoaH2Wfl2Vt4kQ069X8oimMnTzGqMvmGuoVvH18iG8KoaYH9 /l9bbtw9sm4xRYdXEklPqNoQKcqtwQuE9QDnDIBAuXGs2GabJvu+GvE0bj6uZwg4 4xrG7wAc1SKFpxIa9xkhNtE5crqFFIjF/V7gkvCjs5b9dDaqAXGI= Received: (qmail 84992 invoked by alias); 28 Apr 2017 12:18:08 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 84474 invoked by uid 89); 28 Apr 2017 12:18:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2898, 3411 X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 28 Apr 2017 12:18:02 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 1FAF2AB09; Fri, 28 Apr 2017 12:18:02 +0000 (UTC) Subject: [PATCH 2/2] Doxygen: transform ENUM_BITFIELD and comments starting with '/**'. To: David Malcolm , gcc-patches@gcc.gnu.org References: <1489715500-63153-1-git-send-email-dmalcolm@redhat.com> From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: Date: Fri, 28 Apr 2017 14:18:01 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1489715500-63153-1-git-send-email-dmalcolm@redhat.com> X-IsSubscribed: yes 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 From a29b960344128d34f9dbe8f0bbf1e282694beb5b Mon Sep 17 00:00:00 2001 From: marxin 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 * 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