Re: [PATCH 3/7] docs: kdoc: clean up the create_parameter_list() "first arg" logic

From: Jonathan Corbet
Date: Wed Aug 13 2025 - 12:00:24 EST


Mauro Carvalho Chehab <mchehab+huawei@xxxxxxxxxx> writes:

>> + #
>> + # args[0] has a string of "type a". If "a" includes an [array]
>> + # declaration, we want to not be fooled by any white space inside
>> + # the brackets, so detect and handle that case specially.
>> + #
>> + r = KernRe(r'^([^[\]]*\s+)' r'((?:.*?\[.*\].*)|(?:.*?))$')
>
> Same comment as patch 6/7... concats in the middle of the like IMO makes it
> harder to read. Better to place them on separate lines:
>
> r = KernRe(r'^([^[\]]*\s+)'
> r'((?:.*?\[.*\].*)|(?:.*?))$')

So I went to do this, and realized that the second chunk of the regex is
really just a complex way of saying "(.*)$" - so I'll make it just that,
at which point splitting up the string seems a bit excessive.

Thanks,

jon