Loading scripts/kernel-doc +101 −92 Original line number Diff line number Diff line Loading @@ -336,6 +336,7 @@ use constant { }; my $state; my $in_doc_sect; my $leading_space; # Inline documentation state use constant { Loading Loading @@ -1865,35 +1866,13 @@ sub process_name($$) { } } sub process_file($) { my $file; my $func; my $initial_section_counter = $section_counter; my ($orig_file) = @_; my $leading_space; $file = map_filename($orig_file); if (!open(IN,"<$file")) { print STDERR "Error: Cannot open file $file\n"; ++$errors; return; } $. = 1; # # STATE_BODY and STATE_BODY_MAYBE: the bulk of a kerneldoc comment. # sub process_body($$) { my $file = shift; $section_counter = 0; while (<IN>) { while (s/\\\s*$//) { $_ .= <IN>; } # Replace tabs by spaces while ($_ =~ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e) {}; if ($state == STATE_NORMAL) { process_normal(); } elsif ($state == STATE_NAME) { process_name($file, $_); } elsif ($state == STATE_BODY || $state == STATE_BODY_MAYBE) { if (/$doc_sect/i) { # case insensitive for supported section names $newsection = $1; $newcontents = $2; Loading Loading @@ -1946,7 +1925,6 @@ sub process_file($) { $prototype = ""; $state = STATE_PROTO; $brcount = 0; # print STDERR "end of doc comment, looking for prototype\n"; } elsif (/$doc_content/) { # miguel-style comment kludge, look for blank lines after # @parameter line to signify start of description Loading Loading @@ -1975,7 +1953,6 @@ sub process_file($) { $leading_space = ""; } } $cont =~ s/^$leading_space//; } $contents .= $cont . "\n"; Loading @@ -1985,6 +1962,38 @@ sub process_file($) { print STDERR "${file}:$.: warning: bad line: $_"; ++$warnings; } } sub process_file($) { my $file; my $func; my $initial_section_counter = $section_counter; my ($orig_file) = @_; $file = map_filename($orig_file); if (!open(IN,"<$file")) { print STDERR "Error: Cannot open file $file\n"; ++$errors; return; } $. = 1; $section_counter = 0; while (<IN>) { while (s/\\\s*$//) { $_ .= <IN>; } # Replace tabs by spaces while ($_ =~ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e) {}; if ($state == STATE_NORMAL) { process_normal(); } elsif ($state == STATE_NAME) { process_name($file, $_); } elsif ($state == STATE_BODY || $state == STATE_BODY_MAYBE) { process_body($file, $_); } elsif ($state == STATE_INLINE) { # scanning for inline parameters # First line (state 1) needs to be a @parameter if ($inline_doc_state == STATE_INLINE_NAME && /$doc_inline_sect/o) { Loading Loading
scripts/kernel-doc +101 −92 Original line number Diff line number Diff line Loading @@ -336,6 +336,7 @@ use constant { }; my $state; my $in_doc_sect; my $leading_space; # Inline documentation state use constant { Loading Loading @@ -1865,35 +1866,13 @@ sub process_name($$) { } } sub process_file($) { my $file; my $func; my $initial_section_counter = $section_counter; my ($orig_file) = @_; my $leading_space; $file = map_filename($orig_file); if (!open(IN,"<$file")) { print STDERR "Error: Cannot open file $file\n"; ++$errors; return; } $. = 1; # # STATE_BODY and STATE_BODY_MAYBE: the bulk of a kerneldoc comment. # sub process_body($$) { my $file = shift; $section_counter = 0; while (<IN>) { while (s/\\\s*$//) { $_ .= <IN>; } # Replace tabs by spaces while ($_ =~ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e) {}; if ($state == STATE_NORMAL) { process_normal(); } elsif ($state == STATE_NAME) { process_name($file, $_); } elsif ($state == STATE_BODY || $state == STATE_BODY_MAYBE) { if (/$doc_sect/i) { # case insensitive for supported section names $newsection = $1; $newcontents = $2; Loading Loading @@ -1946,7 +1925,6 @@ sub process_file($) { $prototype = ""; $state = STATE_PROTO; $brcount = 0; # print STDERR "end of doc comment, looking for prototype\n"; } elsif (/$doc_content/) { # miguel-style comment kludge, look for blank lines after # @parameter line to signify start of description Loading Loading @@ -1975,7 +1953,6 @@ sub process_file($) { $leading_space = ""; } } $cont =~ s/^$leading_space//; } $contents .= $cont . "\n"; Loading @@ -1985,6 +1962,38 @@ sub process_file($) { print STDERR "${file}:$.: warning: bad line: $_"; ++$warnings; } } sub process_file($) { my $file; my $func; my $initial_section_counter = $section_counter; my ($orig_file) = @_; $file = map_filename($orig_file); if (!open(IN,"<$file")) { print STDERR "Error: Cannot open file $file\n"; ++$errors; return; } $. = 1; $section_counter = 0; while (<IN>) { while (s/\\\s*$//) { $_ .= <IN>; } # Replace tabs by spaces while ($_ =~ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e) {}; if ($state == STATE_NORMAL) { process_normal(); } elsif ($state == STATE_NAME) { process_name($file, $_); } elsif ($state == STATE_BODY || $state == STATE_BODY_MAYBE) { process_body($file, $_); } elsif ($state == STATE_INLINE) { # scanning for inline parameters # First line (state 1) needs to be a @parameter if ($inline_doc_state == STATE_INLINE_NAME && /$doc_inline_sect/o) { Loading