Re: [PATCH 10/12] docs: kdoc: further rewrite_struct_members() cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

> Perhaps one alternative would do something like:
>
> 	tuples = struct_members.findall(members)
>         if not tuples:
>             break
>
> 	maintype, -, -, content, -, s_ids = tuples
>
> (assuming that we don't need t[1], t[2] and t[4] here)
>
> Btw, on this specific case, better to use non-capture group matches
> to avoid those "empty" spaces, e.g. (if I got it right):

The problem is this line here:

                oldmember = "".join(t) # Reconstruct the original formatting

The regex *has* to capture the entire match string so that it can be
reconstructed back to its original form, which we need to edit the full
list of members later on.

This code could use a deep rethink, but it works for now :)

Thanks,

jon




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux