diff options
| author | Jani Nikula <jani.nikula@intel.com> | 2016-05-26 09:35:02 -0400 |
|---|---|---|
| committer | Jani Nikula <jani.nikula@intel.com> | 2016-05-30 06:38:57 -0400 |
| commit | f3341dcf3bdcd1209b2911f35e4e970b789c4744 (patch) | |
| tree | 1f494766ee7e8347407a6d97ee7e28a463b134e4 /scripts/kernel-doc | |
| parent | 47ae7aed34ee9017e9eeb2ad066786239456a90f (diff) | |
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/kernel-doc')
| -rwxr-xr-x | scripts/kernel-doc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 446c0912395e..e0fd14f6d711 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc | |||
| @@ -214,6 +214,8 @@ my $type_enum_full = '\&(enum)\s*([_\w]+)'; | |||
| 214 | my $type_struct_full = '\&(struct)\s*([_\w]+)'; | 214 | my $type_struct_full = '\&(struct)\s*([_\w]+)'; |
| 215 | my $type_typedef_full = '\&(typedef)\s*([_\w]+)'; | 215 | my $type_typedef_full = '\&(typedef)\s*([_\w]+)'; |
| 216 | my $type_union_full = '\&(union)\s*([_\w]+)'; | 216 | my $type_union_full = '\&(union)\s*([_\w]+)'; |
| 217 | my $type_member = '\&([_\w]+)((\.|->)[_\w]+)'; | ||
| 218 | my $type_member_func = $type_member . '\(\)'; | ||
| 217 | 219 | ||
| 218 | # Output conversion substitutions. | 220 | # Output conversion substitutions. |
| 219 | # One for each output format | 221 | # One for each output format |
| @@ -282,6 +284,9 @@ my $blankline_text = ""; | |||
| 282 | # rst-mode | 284 | # rst-mode |
| 283 | my @highlights_rst = ( | 285 | my @highlights_rst = ( |
| 284 | [$type_constant, "``\$1``"], | 286 | [$type_constant, "``\$1``"], |
| 287 | # Note: need to escape () to avoid func matching later | ||
| 288 | [$type_member_func, "\\:c\\:type\\:`\$1\$2\\\\(\\\\) <\$1>`"], | ||
| 289 | [$type_member, "\\:c\\:type\\:`\$1\$2 <\$1>`"], | ||
| 285 | [$type_func, "\\:c\\:func\\:`\$1()`"], | 290 | [$type_func, "\\:c\\:func\\:`\$1()`"], |
| 286 | [$type_struct_full, "\\:c\\:type\\:`\$1 \$2 <\$2>`"], | 291 | [$type_struct_full, "\\:c\\:type\\:`\$1 \$2 <\$2>`"], |
| 287 | [$type_enum_full, "\\:c\\:type\\:`\$1 \$2 <\$2>`"], | 292 | [$type_enum_full, "\\:c\\:type\\:`\$1 \$2 <\$2>`"], |
