Skip to content

Commit 212209c

Browse files
author
Jonathan Corbet
committed
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. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Fixes: 8d295fb ("kernel-doc: better handle '::' sequences") Signed-off-by: Jonathan Corbet <corbet@lwn.net>
1 parent 8d295fb commit 212209c

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎scripts/kernel-doc‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,14 @@ my $doc_com = '\s*\*\s*';
391391
my $doc_com_body = '\s*\* ?';
392392
my $doc_decl = $doc_com . '(\w+)';
393393
# @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+
#
394400
my $doc_sect = $doc_com .
395-
'\s*(\@[.\w]+|\@\.\.\.|description|context|returns?|notes?|examples?)\s*:([^:]*)$';
401+
'\s*(\@[.\w]+|\@\.\.\.|description|context|returns?|notes?|examples?)\s*:([^:].*)?$';
396402
my $doc_content = $doc_com_body . '(.*)';
397403
my $doc_block = $doc_com . 'DOC:\s*(.*)?';
398404
my $doc_inline_start = '^\s*/\*\*\s*$';

0 commit comments

Comments
 (0)