History

scripts/kernel-doc: parse kernel-doc deterministically

Regular expressions for highlights in kernel-doc are stored in a Perl hash. These hashes are ordered differently for each Perl run. This will prevent kernel-doc to behave deterministically when parsing “@foo()” as in some runs it will be interpreted as a parameter and in the others it will be interpreted as a function. We now sort the %highlights hash to get the same behavior on every run.

Jérémy Bobbio committed 11 years ago

Commit 2e106e41 parent d770e551 file · +1 −1Browse files

Showing the changes to scripts/kernel-doc (1 of 1 file). Show all

Unified · Split

scripts/kernel-doc+1−1
@@ -2587,7 +2587,7 @@ $kernelversion = get_kernel_version(); · 2586 unmodified lines
25872587
25882588 # generate a sequence of code that will splice in highlighting information
25892589 # using the s// operator.
2590−foreach my $pattern (keys %highlights) {
2590+foreach my $pattern (sort keys %highlights) {
25912591 # print STDERR "scanning pattern:$pattern, highlight:($highlights{$pattern})\n";
25922592 $dohighlight .= "\$contents =~ s:$pattern:$highlights{$pattern}:gs;\n";
25932593 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t