[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fe5e5235ca96c990d8400d1cb8f05e378348b5c5.1771408406.git.mchehab+huawei@kernel.org>
Date: Wed, 18 Feb 2026 11:12:48 +0100
From: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
To: Jonathan Corbet <corbet@....net>,
Linux Doc Mailing List <linux-doc@...r.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
intel-wired-lan@...ts.osuosl.org,
linux-hardening@...r.kernel.org,
linux-kernel@...r.kernel.org,
netdev@...r.kernel.org,
Aleksandr Loktionov <aleksandr.loktionov@...el.com>,
Randy Dunlap <rdunlap@...radead.org>
Subject: [PATCH 18/38] docs: kdoc_re: Change NestedMath args replacement to \0
Future patches will allow parsing each argument instead of the
hole set. Prepare for it by changing the replace all args from
\1 to \0.
No functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@...el.com>
---
tools/lib/python/kdoc/kdoc_parser.py | 2 +-
tools/lib/python/kdoc/kdoc_re.py | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/lib/python/kdoc/kdoc_parser.py b/tools/lib/python/kdoc/kdoc_parser.py
index 32a30851db08..3ee169b505d3 100644
--- a/tools/lib/python/kdoc/kdoc_parser.py
+++ b/tools/lib/python/kdoc/kdoc_parser.py
@@ -160,7 +160,7 @@ struct_xforms = [
# is allowed.
#
struct_nested_prefixes = [
- (re.compile(r'\bSTRUCT_GROUP\('), r'\1'),
+ (re.compile(r'\bSTRUCT_GROUP\('), r'\0'),
]
#
diff --git a/tools/lib/python/kdoc/kdoc_re.py b/tools/lib/python/kdoc/kdoc_re.py
index 00afa5bccd6d..2d83b6fb1cd6 100644
--- a/tools/lib/python/kdoc/kdoc_re.py
+++ b/tools/lib/python/kdoc/kdoc_re.py
@@ -291,7 +291,7 @@ class NestedMatch:
if the sub argument contains::
- r'\1'
+ r'\0'
it will work just like re: it places there the matched paired data
with the delimiter stripped.
@@ -310,9 +310,9 @@ class NestedMatch:
# Value, ignoring start/end delimiters
value = line[end:pos - 1]
- # replaces \1 at the sub string, if \1 is used there
+ # replaces \0 at the sub string, if \0 is used there
new_sub = sub
- new_sub = new_sub.replace(r'\1', value)
+ new_sub = new_sub.replace(r'\0', value)
out += new_sub
--
2.52.0
Powered by blists - more mailing lists