[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250213170413.39caf2d7@foz.lan>
Date: Thu, 13 Feb 2025 17:04:13 +0100
From: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
To: Linux Doc Mailing List <linux-doc@...r.kernel.org>, Jonathan Corbet
<corbet@....net>
Cc: linux-hardening@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFCv2 4/5] scripts/kernel-doc.py: add a Python parser
Em Thu, 13 Feb 2025 13:06:17 +0100
Mauro Carvalho Chehab <mchehab+huawei@...nel.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
Powered by blists - more mailing lists