summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2016-05-26 16:35:02 +0300
committerJani Nikula <jani.nikula@intel.com>2016-05-30 13:38:57 +0300
commitf3341dcf3bdcd1209b2911f35e4e970b789c4744 (patch)
tree1f494766ee7e8347407a6d97ee7e28a463b134e4 /scripts
parent47ae7aed34ee9017e9eeb2ad066786239456a90f (diff)
downloadop-kernel-dev-f3341dcf3bdcd1209b2911f35e4e970b789c4744.zip
op-kernel-dev-f3341dcf3bdcd1209b2911f35e4e970b789c4744.tar.gz
kernel-doc/rst: add support for struct/union/enum member references
Link "&foo->bar", "&foo->bar()", "&foo.bar", and "&foo.bar()" to the struct/union/enum foo definition. The members themselves do not currently have anchors to link to, but this is better than nothing, and promotes a universal notation. Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/kernel-doc5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 446c091..e0fd14f 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -214,6 +214,8 @@ my $type_enum_full = '\&(enum)\s*([_\w]+)';
my $type_struct_full = '\&(struct)\s*([_\w]+)';
my $type_typedef_full = '\&(typedef)\s*([_\w]+)';
my $type_union_full = '\&(union)\s*([_\w]+)';
+my $type_member = '\&([_\w]+)((\.|->)[_\w]+)';
+my $type_member_func = $type_member . '\(\)';
# Output conversion substitutions.
# One for each output format
@@ -282,6 +284,9 @@ my $blankline_text = "";
# rst-mode
my @highlights_rst = (
[$type_constant, "``\$1``"],
+ # Note: need to escape () to avoid func matching later
+ [$type_member_func, "\\:c\\:type\\:`\$1\$2\\\\(\\\\) <\$1>`"],
+ [$type_member, "\\:c\\:type\\:`\$1\$2 <\$1>`"],
[$type_func, "\\:c\\:func\\:`\$1()`"],
[$type_struct_full, "\\:c\\:type\\:`\$1 \$2 <\$2>`"],
[$type_enum_full, "\\:c\\:type\\:`\$1 \$2 <\$2>`"],
OpenPOWER on IntegriCloud