[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87sehvb6af.fsf@trenco.lwn.net>
Date: Wed, 13 Aug 2025 09:16:56 -0600
From: Jonathan Corbet <corbet@....net>
To: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
Cc: linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org, Akira Yokosawa
<akiyks@...il.com>
Subject: Re: [PATCH 5/7] docs: kdoc: tighten up the array-of-pointers case
Mauro Carvalho Chehab <mchehab+huawei@...nel.org> writes:
> On Tue, 12 Aug 2025 13:57:46 -0600
> Jonathan Corbet <corbet@....net> wrote:
>> elif KernRe(r'\(.+\)\s*\[').search(arg):
>> - # Array-of-pointers
>> -
>> - arg = arg.replace('#', ',')
>
> Hmm... if I'm not mistaken, there is(was?) a previous code that replaced
> commas by "#". Such statement is needed to catch some corner case.
>
> This like here is(was?) needed to restore the original arg string.
That (hackish :) replacement is still there ... but there will be no
commas in anything matched by the regex here, so the restoration is not
needed. I can add that to the changelog for curious readers in the
future.
>> - r = KernRe(r'[^\(]+\(\s*\*\s*([\w\[\].]*?)\s*(\s*\[\s*[\w]+\s*\]\s*)*\)')
>> + r = KernRe(r'[^\(]+\(\s*\*\s*' r'([\w.]*?)' r'\s*(\[\s*\w+\s*\]\s*)*\)')
>
> As mentioned on patch 6/7, IMHO doing concats like that at the same line
> IMO makes it harder to understand. This works best:
>
> r = KernRe(r'[^\(]+\(\s*\*\s*'
> r'([\w.]*?)'
> r'\s*(\[\s*\w+\s*\]\s*)*\)')
I'll do that.
Thanks,
jon
Powered by blists - more mailing lists