Commit f3341dcf authored by Jani Nikula's avatar Jani Nikula

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: default avatarJani Nikula <jani.nikula@intel.com>
parent 47ae7aed
...@@ -214,6 +214,8 @@ my $type_enum_full = '\&(enum)\s*([_\w]+)'; ...@@ -214,6 +214,8 @@ my $type_enum_full = '\&(enum)\s*([_\w]+)';
my $type_struct_full = '\&(struct)\s*([_\w]+)'; my $type_struct_full = '\&(struct)\s*([_\w]+)';
my $type_typedef_full = '\&(typedef)\s*([_\w]+)'; my $type_typedef_full = '\&(typedef)\s*([_\w]+)';
my $type_union_full = '\&(union)\s*([_\w]+)'; my $type_union_full = '\&(union)\s*([_\w]+)';
my $type_member = '\&([_\w]+)((\.|->)[_\w]+)';
my $type_member_func = $type_member . '\(\)';
# Output conversion substitutions. # Output conversion substitutions.
# One for each output format # One for each output format
...@@ -282,6 +284,9 @@ my $blankline_text = ""; ...@@ -282,6 +284,9 @@ my $blankline_text = "";
# rst-mode # rst-mode
my @highlights_rst = ( my @highlights_rst = (
[$type_constant, "``\$1``"], [$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_func, "\\:c\\:func\\:`\$1()`"],
[$type_struct_full, "\\:c\\:type\\:`\$1 \$2 <\$2>`"], [$type_struct_full, "\\:c\\:type\\:`\$1 \$2 <\$2>`"],
[$type_enum_full, "\\:c\\:type\\:`\$1 \$2 <\$2>`"], [$type_enum_full, "\\:c\\:type\\:`\$1 \$2 <\$2>`"],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment