summaryrefslogtreecommitdiffstats
path: root/scripts/kernel-doc
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2021-03-26 20:16:35 +0100
committerJonathan Corbet <corbet@lwn.net>2021-03-26 20:16:35 +0100
commit212209cff89fe497bc47abcd017aa95e4e8a5196 (patch)
tree02b814c3d58113f66edbe9b6d1080c1e52c840e7 /scripts/kernel-doc
parentkernel-doc: better handle '::' sequences (diff)
downloadlinux-212209cff89fe497bc47abcd017aa95e4e8a5196.tar.xz
linux-212209cff89fe497bc47abcd017aa95e4e8a5196.zip
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: 8d295fbad687 ("kernel-doc: better handle '::' sequences") Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'scripts/kernel-doc')
-rwxr-xr-xscripts/kernel-doc8
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 0ecd71477a16..d6d2b6e0b4eb 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -391,8 +391,14 @@ my $doc_com = '\s*\*\s*';
my $doc_com_body = '\s*\* ?';
my $doc_decl = $doc_com . '(\w+)';
# @params and a strictly limited set of supported section names
+# Specifically:
+# Match @word:
+# @...:
+# @{section-name}:
+# while trying to not match literal block starts like "example::"
+#
my $doc_sect = $doc_com .
- '\s*(\@[.\w]+|\@\.\.\.|description|context|returns?|notes?|examples?)\s*:([^:]*)$';
+ '\s*(\@[.\w]+|\@\.\.\.|description|context|returns?|notes?|examples?)\s*:([^:].*)?$';
my $doc_content = $doc_com_body . '(.*)';
my $doc_block = $doc_com . 'DOC:\s*(.*)?';
my $doc_inline_start = '^\s*/\*\*\s*$';