History

scripts: kernel-doc: accept negation like !@var

On a few places, it sometimes need to indicate a negation of a parameter, like: !@fshared This pattern happens, for example, at: kernel/futex.c and it is perfectly valid. However, kernel-doc currently transforms it into: !**fshared** This won't do what it would be expected. Fortunately, fixing the script is a simple matter of storing the "!" before "@" and adding it after the bold markup, like: **!fshared**

Mauro Carvalho Chehab committed 6 years ago

Commit ee2aa751 parent 346282d1 file · +3 −1Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/kernel-doc+3−1
@@ -213,6 +213,7 @@ my $type_constant = '\b``([^\`]+)``\b'; · 212 unmodified lines
213213 my $type_constant2 = '\%([-_\w]+)';
214214 my $type_func = '(\w+)\(\)';
215215 my $type_param = '\@(\w*((\.\w+)|(->\w+))*(\.\.\.)?)';
216+my $type_param_ref = '([\!]?)\@(\w*((\.\w+)|(->\w+))*(\.\.\.)?)';
216217 my $type_fp_param = '\@(\w+)\(\)'; # Special RST handling for func ptr params
217218 my $type_fp_param2 = '\@(\w+->\S+)\(\)'; # Special RST handling for structs with func ptr params
218219 my $type_env = '(\$\w+)';
@@ -237,6 +238,7 @@ my @highlights_man = ( · 18 unmodified lines
237238 [$type_typedef, "\\\\fI\$1\\\\fP"],
238239 [$type_union, "\\\\fI\$1\\\\fP"],
239240 [$type_param, "\\\\fI\$1\\\\fP"],
241+ [$type_param_ref, "\\\\fI\$1\$2\\\\fP"],
240242 [$type_member, "\\\\fI\$1\$2\$3\\\\fP"],
241243 [$type_fallback, "\\\\fI\$1\\\\fP"]
242244 );
@@ -258,7 +260,7 @@ my @highlights_rst = ( · 15 unmodified lines
258260 [$type_union, "\\:c\\:type\\:`\$1 <\$2>`"],
259261 # in rst this can refer to any type
260262 [$type_fallback, "\\:c\\:type\\:`\$1`"],
261− [$type_param, "**\$1**"]
263+ [$type_param_ref, "**\$1\$2**"]
262264 );
263265 my $blankline_rst = "\n";
264266