summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2020-03-22 11:59:32 +0100
committerAkim Demaille <akim.demaille@gmail.com>2020-03-22 15:59:13 +0100
commit1c694e08cc5c1a28a4311551b4ec04ee21fe6f22 (patch)
tree8121ea496e23b9ff25142e6cbcf5c31b7019b966 /etc
parent4cfb067d93836aa22e11c538103e3067dc494882 (diff)
downloadbison-1c694e08cc5c1a28a4311551b4ec04ee21fe6f22.tar.gz
bench: use the same prefix in both bench methods
* etc/bench.pl.in (&bench_with_timethese): Also use y$i, as in &bench_with_gbenchmark. (&generate_grammar_calc): Don't add a prefix, let the callers do it.
Diffstat (limited to 'etc')
-rwxr-xr-xetc/bench.pl.in12
1 files changed, 5 insertions, 7 deletions
diff --git a/etc/bench.pl.in b/etc/bench.pl.in
index c65efd85..d49742f1 100755
--- a/etc/bench.pl.in
+++ b/etc/bench.pl.in
@@ -372,7 +372,7 @@ sub generate_grammar_calc ($$@)
{
my ($base, $max, @directive) = @_;
- my $prefix = "y$base";
+ my $prefix = $base;
push @directive, "%define api.prefix {$prefix}"
if ($gbench);
my $directives = directives ($base, @directive);
@@ -899,13 +899,11 @@ sub bench_with_timethese ($@)
# Set up the benches as expected by timethese.
my %bench;
- # A counter of directive sets.
- my $count = 1;
- for my $d (@directive)
+ for my $i (0 .. $#directive)
{
- $bench{$count} = $d;
- printf " %2d. %s\n", $count, join (' ', split ("\n", $d));
- $count++;
+ my $base = "y$i";
+ $bench{$base} = $directive[$i];
+ printf " %2d. %s\n", $i, join (' ', split ("\n", $directive[$i]));
};
# For each bench, capture the size.