diff -r 4fd19a188509 -r 5770be2d5f3f docgen.pl --- a/docgen.pl Mon Feb 09 13:39:36 2009 +0200 +++ b/docgen.pl Sat Feb 14 16:40:09 2009 +0200 @@ -6,6 +6,8 @@ my %docs; my @tags; my $inside; +my $harvest; +my @values; foreach my $file (@ARGV) { if ( not open SOURCE, '<', $file ) { @@ -20,9 +22,21 @@ if ( not /^\/\/\// ) { $inside = 0; $chunk++; + } elsif ( /^\/\/\/ G:/ ) { + $inside = 0; + $harvest = 'V: ' . substr ( $_, 6 ); } else { push @{$docs{$file}[$chunk]}, substr ( $_, 4 ); } + } elsif ( $harvest ) { + if ( /\{\s*NULL.*\}/ ) { + push @{$docs{$file}[$chunk]}, $harvest . ' ' . join ( ', ', @values ); + $harvest = undef; + @values = (); + $chunk++; + } elsif ( /\{\s*"(.+)".*\}/ ) { + push @values, $1; + } } else { next if not /^\/\/\//; @@ -57,12 +71,24 @@ foreach my $chunk ( @{$docs{$file}} ) { my $head = shift @$chunk; my $tag = $head; + my $list = undef; $tag =~ s/_/./g; print "
";
foreach ( @$chunk ) {
s/^A: /
Arguments: /;
s/^R: /
Return values: /;
s/^V: /
Values: /;
+ if ( $list ) {
+ if ( /^\* / ) {
+ s/^\* /<\/li>