2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/scripts/lib/kdoc
Jonathan Corbet b8ac0259f8 docs: kdoc: rework type prototype parsing
process_proto_type() is using a complex regex and a "while True" loop to
split a declaration into chunks and, in the end, count brackets.  Switch to
using a simpler regex to just do the split directly, and handle each chunk
as it comes.  The result is, IMO, easier to understand and reason about.

The old algorithm would occasionally elide the space between function
parameters; see struct rng_alg->generate(), foe example.  The only output
difference is to not elide that space, which is more correct.

Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tested-by: Akira Yokosawa <akiyks@gmail.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20250703184403.274408-5-corbet@lwn.net
2025-07-08 08:06:25 -06:00
..
kdoc_files.py scripts: kernel-doc: prevent a KeyError when checking output 2025-05-21 03:53:40 -06:00
kdoc_output.py scripts/lib/kdoc: change mode to 0644 2025-04-28 17:28:14 -06:00
kdoc_parser.py docs: kdoc: rework type prototype parsing 2025-07-08 08:06:25 -06:00
kdoc_re.py docs: kdoc: micro-optimize KernRe 2025-07-08 08:06:25 -06:00