summaryrefslogtreecommitdiff
path: root/tools/lib/python/kdoc
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2026-03-18 10:11:03 +0100
committerJonathan Corbet <corbet@lwn.net>2026-03-22 15:10:40 -0600
commit8c0b7c0d3c0e640b3ebb7f1f648ea322e56c227a (patch)
treed9c9feebfcb92dbe826d1d14e91f0bd1291aa755 /tools/lib/python/kdoc
parentb2d231f4a77800661b3fb812d997841a548c6526 (diff)
downloadlwn-8c0b7c0d3c0e640b3ebb7f1f648ea322e56c227a.tar.gz
lwn-8c0b7c0d3c0e640b3ebb7f1f648ea322e56c227a.zip
docs: kdoc: add c_lex to generated documentation
Do some fixes at groups() description for it to be parsed by Sphinx and add it to the documentation. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <799178cf30dd4022fdb1d029ba998a458e037b52.1773823995.git.mchehab+huawei@kernel.org>
Diffstat (limited to 'tools/lib/python/kdoc')
-rw-r--r--tools/lib/python/kdoc/c_lex.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/lib/python/kdoc/c_lex.py b/tools/lib/python/kdoc/c_lex.py
index b6d58bd470a9..e01b154f458e 100644
--- a/tools/lib/python/kdoc/c_lex.py
+++ b/tools/lib/python/kdoc/c_lex.py
@@ -336,13 +336,14 @@ class CTokenArgs:
self.sub_tokeninzer = CTokenizer(sub_str)
def groups(self, new_tokenizer):
- """
+ r"""
Create replacement arguments for backrefs like:
- ``\0``, ``\1``, ``\2``, ...``\n``
+ ``\0``, ``\1``, ``\2``, ... ``\{number}``
- It also accepts a ``+`` character to the highest backref. When used,
- it means in practice to ignore delimins after it, being greedy.
+ It also accepts a ``+`` character to the highest backref, like
+ ``\4+``. When used, the backref will be greedy, picking all other
+ arguments afterwards.
The logic is smart enough to only go up to the maximum required
argument, even if there are more.