From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Linux Doc Mailing List <linux-doc@vger.kernel.org>,
Jonathan Corbet <corbet@lwn.net>
Cc: linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFCv2 4/5] scripts/kernel-doc.py: add a Python parser
Date: Thu, 13 Feb 2025 17:04:13 +0100 [thread overview]
Message-ID: <20250213170413.39caf2d7@foz.lan> (raw)
In-Reply-To: <59e3bb9ad6f9147c139ef4cc5500985e0bc847c2.1739447912.git.mchehab+huawei@kernel.org>
Em Thu, 13 Feb 2025 13:06:17 +0100
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> escreveu:
> + def dump_function(self, ln, prototype):
> +
...
> + (r"""
> + __attribute__\s*\(\(
> + (?:
> + [\w\s]++ # attribute name
> + (?:\([^)]*+\))? # attribute arguments
> + \s*+,? # optional comma at the end
> + )+
> + \)\)\s+
> + """, "", re.X),
Heh, funny enough, this regex doesn't work here (Python 3.13.2), even
after removing the extra "+" on some lines, e. g.:
(r"""
__attribute__\s*\(\(
(?:
[\w\s]+ # attribute name
(?:\([^)]*\))? # attribute arguments
\s*,? # optional comma at the end
)+
\)\)\s+
""", "", re.X),
I had to fold it into a non-verbose/extended regex, e. g.:
(r"__attribute__\s*\(\((?:[\w\s]+(?:\([^)]*\))?\s*,?)+\)\)\s+", "", 0),
Thanks,
Mauro
next prev parent reply other threads:[~2025-02-13 16:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-13 12:06 [PATCH RFCv2 0/5]Implement kernel-doc in Python Mauro Carvalho Chehab
2025-02-13 12:06 ` [PATCH RFCv2 1/5] include/asm-generic/io.h: fix kerneldoc markup Mauro Carvalho Chehab
2025-02-13 12:16 ` Arnd Bergmann
2025-02-13 12:06 ` [PATCH RFCv2 2/5] scripts/kernel-doc: remove an obscure logic from kernel-doc Mauro Carvalho Chehab
2025-02-13 12:06 ` [PATCH RFCv2 3/5] scripts/kernel-doc: don't add not needed new lines Mauro Carvalho Chehab
2025-02-13 12:06 ` [PATCH RFCv2 4/5] scripts/kernel-doc.py: add a Python parser Mauro Carvalho Chehab
2025-02-13 16:04 ` Mauro Carvalho Chehab [this message]
2025-02-13 12:06 ` [PATCH RFCv2 5/5] docs: use kernel-doc.py script for kerneldoc output Mauro Carvalho Chehab
2025-02-14 3:15 ` [PATCH RFCv2 0/5]Implement kernel-doc in Python Randy Dunlap
2025-02-14 8:02 ` Mauro Carvalho Chehab
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=20250213170413.39caf2d7@foz.lan \
--to=mchehab+huawei@kernel.org \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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 NNTP newsgroup(s).