diff options
author | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2025-07-10 18:36:40 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2025-08-12 07:47:31 +0200 |
commit | 47459937be8031aae6aaa17ac5f60985f7c9e1bd (patch) | |
tree | 03956bc7a2f4ee071464765153d53eeac57ceccc /scripts/lib/kdoc/kdoc_parser.py | |
parent | d90555ef0603935529837e490d5acc8436297c56 (diff) |
sphinx: parser_yaml.py: fix line numbers information
As reported by Donald, this code:
rst_parser = RSTParser()
rst_parser.parse('\n'.join(result), document)
breaks line parsing. As an alternative, I tested a variant of it:
rst_parser.parse(result, document)
but still line number was not preserved. As Donald noted,
standard Parser classes don't have a direct mechanism to preserve
line numbers from ViewList().
So, instead, let's use a mechanism similar to what we do already at
kerneldoc.py: call the statemachine mechanism directly there.
I double-checked when states and statemachine were introduced:
both were back in 2002. I also tested doc build with docutils 0.16
and 0.21.2. It worked with both, so it seems to be stable enough
for our needs.
Reported-by: Donald Hunter <donald.hunter@gmail.com>
Closes: https://lore.kernel.org/linux-doc/m24ivk78ng.fsf@gmail.com/T/#u
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'scripts/lib/kdoc/kdoc_parser.py')
0 files changed, 0 insertions, 0 deletions