[PATCH v2 22/28] docs: c_lex: don't exclude an extra token

From: Mauro Carvalho Chehab

Date: Thu Mar 12 2026 - 10:56:19 EST


On simple match, replace only the match and following spaces.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@xxxxxxxxxx>
---
tools/lib/python/kdoc/c_lex.py | 2 ++
1 file changed, 2 insertions(+)

diff --git a/tools/lib/python/kdoc/c_lex.py b/tools/lib/python/kdoc/c_lex.py
index a61f5fe88363..bc70b55f0dbe 100644
--- a/tools/lib/python/kdoc/c_lex.py
+++ b/tools/lib/python/kdoc/c_lex.py
@@ -486,6 +486,8 @@ class CMatch:
continue
else:
# Name only token without BEGIN/END
+ if i > start:
+ i -= 1
yield start, i
start = None

--
2.52.0