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

Mauro Carvalho Chehab
2026-03-12T14:55:01Z

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

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
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