docs: c_lex: setup a logger to report tokenizer issues

Report file that has issues detected via CMatch and CTokenizer.

This is done by setting up a logger that will be overriden by
kdoc_parser, when used on it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <903ad83ae176196a50444e66177a4f5bcdef5199.1773770483.git.mchehab+huawei@kernel.org>
This commit is contained in:
Mauro Carvalho Chehab
2026-03-17 19:09:38 +01:00
committed by Jonathan Corbet
parent 2f07ddbd57
commit 024e200e2a
2 changed files with 19 additions and 1 deletions

View File

@@ -13,7 +13,7 @@ import sys
import re
from pprint import pformat
from kdoc.c_lex import CTokenizer
from kdoc.c_lex import CTokenizer, tokenizer_set_log
from kdoc.kdoc_re import KernRe
from kdoc.kdoc_item import KdocItem
@@ -253,6 +253,8 @@ class KernelDoc:
self.config = config
self.xforms = xforms
tokenizer_set_log(self.config.log, f"{self.fname}: CMatch: ")
# Initial state for the state machines
self.state = state.NORMAL