Skip to content

Commit 47ae7ae

Browse files
committed
kernel-doc/rst: add support for &union foo and &typedef foo references
Let the user use "&union foo" and "&typedef foo" to reference foo. The difference to using "union &foo", "typedef &foo", or just "&foo" (which are valid too) is that "union" and "typedef" become part of the link text. Signed-off-by: Jani Nikula <jani.nikula@intel.com>
1 parent a7291e7 commit 47ae7ae

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎scripts/kernel-doc‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ my $type_struct_xml = '\\&amp;((struct\s*)*[_\w]+)';
212212
my $type_env = '(\$\w+)';
213213
my $type_enum_full = '\&(enum)\s*([_\w]+)';
214214
my $type_struct_full = '\&(struct)\s*([_\w]+)';
215+
my $type_typedef_full = '\&(typedef)\s*([_\w]+)';
216+
my $type_union_full = '\&(union)\s*([_\w]+)';
215217

216218
# Output conversion substitutions.
217219
# One for each output format
@@ -283,6 +285,8 @@ my @highlights_rst = (
283285
[$type_func, "\\:c\\:func\\:`\$1()`"],
284286
[$type_struct_full, "\\:c\\:type\\:`\$1 \$2 <\$2>`"],
285287
[$type_enum_full, "\\:c\\:type\\:`\$1 \$2 <\$2>`"],
288+
[$type_typedef_full, "\\:c\\:type\\:`\$1 \$2 <\$2>`"],
289+
[$type_union_full, "\\:c\\:type\\:`\$1 \$2 <\$2>`"],
286290
# in rst this can refer to any type
287291
[$type_struct, "\\:c\\:type\\:`\$1`"],
288292
[$type_param, "**\$1**"]

0 commit comments

Comments
 (0)