projects
/
linux-2.6-microblaze.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
doc-rst: parse-headers: better handle comments at the source code
[linux-2.6-microblaze.git]
/
Documentation
/
sphinx
/
parse-headers.pl
diff --git
a/Documentation/sphinx/parse-headers.pl
b/Documentation/sphinx/parse-headers.pl
index
b703f1a
..
fc18eac
100755
(executable)
--- a/
Documentation/sphinx/parse-headers.pl
+++ b/
Documentation/sphinx/parse-headers.pl
@@
-27,13
+27,24
@@
my %structs;
#
my $is_enum = 0;
#
my $is_enum = 0;
+my $is_comment = 0;
open IN, $file_in or die "Can't open $file_in";
while (<IN>) {
open IN, $file_in or die "Can't open $file_in";
while (<IN>) {
- my $ln = $_;
- $ln =~ s,/\*.*\*/,,;
-
$data .= $_;
$data .= $_;
+ my $ln = $_;
+ if (!$is_comment) {
+ $ln =~ s,/\*.*(\*/),,g;
+
+ $is_comment = 1 if ($ln =~ s,/\*.*,,);
+ } else {
+ if ($ln =~ s,^(.*\*/),,) {
+ $is_comment = 0;
+ } else {
+ next;
+ }
+ }
+
if ($is_enum && $ln =~ m/^\s*([_\w][\w\d_]+)\s*[\,=]?/) {
my $s = $1;
my $n = $1;
if ($is_enum && $ln =~ m/^\s*([_\w][\w\d_]+)\s*[\,=]?/) {
my $s = $1;
my $n = $1;