History

docs: kernel-doc: properly recognize parameter lines with colons

The previous attempt to properly handle literal blocks broke parsing of parameter lines containing colons; fix it by tweaking the regex to specifically exclude the "::" pattern while accepting lines containing colons in general. Add a little documentation to the regex while in the neighborhood.

Jonathan Corbet committed 5 years ago

Commit 212209c1 parent 8d295fb1 file · +7 −1Browse files

Showing the changes to scripts/kernel-doc (1 of 1 file). Show all

Unified · Split

scripts/kernel-doc+7−1
@@ -391,8 +391,14 @@ my $doc_com = '\s*\*\s*'; · 390 unmodified lines
391my $doc_com_body = '\s*\* ?';391my $doc_com_body = '\s*\* ?';
392my $doc_decl = $doc_com . '(\w+)';392my $doc_decl = $doc_com . '(\w+)';
393# @params and a strictly limited set of supported section names393# @params and a strictly limited set of supported section names
394# Specifically:
395# Match @word:
396# @...:
397# @{section-name}:
398# while trying to not match literal block starts like "example::"
399#
394my $doc_sect = $doc_com .400my $doc_sect = $doc_com .
395 '\s*(\@[.\w]+|\@\.\.\.|description|context|returns?|notes?|examples?)\s*:([^:]*)$';401 '\s*(\@[.\w]+|\@\.\.\.|description|context|returns?|notes?|examples?)\s*:([^:].*)?$';
396my $doc_content = $doc_com_body . '(.*)';402my $doc_content = $doc_com_body . '(.*)';
397my $doc_block = $doc_com . 'DOC:\s*(.*)?';403my $doc_block = $doc_com . 'DOC:\s*(.*)?';
398my $doc_inline_start = '^\s*/\*\*\s*$';404my $doc_inline_start = '^\s*/\*\*\s*$';