[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-wget] [PATCH] paramcheck: Use + quantifier and return copy
From: |
Giuseppe Scrivano |
Subject: |
Re: [Bug-wget] [PATCH] paramcheck: Use + quantifier and return copy |
Date: |
Fri, 21 Oct 2011 22:10:17 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux) |
Thanks. Pushed.
Cheers,
Giuseppe
Steven Schubiger <address@hidden> writes:
> === modified file 'ChangeLog'
> --- ChangeLog 2011-09-04 12:19:12 +0000
> +++ ChangeLog 2011-10-16 18:18:34 +0000
> @@ -1,3 +1,8 @@
> +2011-10-16 Steven Schubiger <address@hidden>
> +
> + * util/paramcheck.pl: Match 1 or more times where applicable.
> + (extract_entries): Return a copy instead of reference.
> +
> 2011-09-04 Alan Hourihane <address@hidden> (tiny change)
>
> * configure.ac: Check for libz when gnutls is used.
>
> === modified file 'util/paramcheck.pl'
> --- util/paramcheck.pl 2011-01-01 12:19:37 +0000
> +++ util/paramcheck.pl 2011-10-16 02:36:40 +0000
> @@ -33,11 +33,11 @@
>
> my @args = ([
> $main_content,
> - qr/static \s+? struct \s+? cmdline_option \s+? option_data\[\] \s+? =
> \s+? \{ (.*?) \}\;/sx,
> + qr/static \s+? struct \s+? cmdline_option \s+? option_data\[\] \s+? =
> \s+? \{ (.+?) \}\;/sx,
> [ qw(long_name short_name type data argtype) ],
> ], [
> $init_content,
> - qr/commands\[\] \s+? = \s+? \{ (.*?) \}\;/sx,
> + qr/commands\[\] \s+? = \s+? \{ (.+?) \}\;/sx,
> [ qw(name place action) ],
> ]);
>
> @@ -78,18 +78,18 @@
> my (@entries, %index, $i);
>
> foreach my $chunk (@$chunks) {
> - my ($args) = $chunk =~ /\{ \s+? (.*?) \s+? \}/sx;
> + my ($args) = $chunk =~ /\{ \s+? (.+?) \s+? \}/sx;
> next unless defined $args;
>
> my @args = map {
> tr/'"//d; $_
> } map {
> - /\((.*?)\)/ ? $1 : $_
> + /\((.+?)\)/ ? $1 : $_
> } split /\,\s+/, $args;
>
> my $entry = { map { $_ => shift @args } @$names };
>
> - ($entry->{line}) = $chunk =~ /^ \s+? (\{.*)/mx;
> + ($entry->{line}) = $chunk =~ /^ \s+? (\{.+)/mx;
> if ($chunk =~ /deprecated/i) {
> $entries[-1]->{deprecated} = true;
> }
> @@ -103,9 +103,9 @@
> push @entries, $entry;
> }
>
> - push @entries, \%index;
> + push @entries, { %index };
>
> - return address@hidden;
> + return [ @entries ];
> }
>
> sub output_results
> @@ -281,7 +281,7 @@
> while ($tex =~ /address@hidden \s+? --([-a-z0-9]+)/gmx) {
> $tex_items{$1} = true;
> }
> - my ($help) = $main =~ /\n print_help .*? \{\n (.*) \n\} \n/sx;
> + my ($help) = $main =~ /\n print_help .*? \{\n (.+) \n\} \n/sx;
> while ($help =~ /--([-a-z0-9]+)/g) {
> $main_items{$1} = true;
> }