summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorAkim Demaille <demaille@gostai.com>2008-08-07 20:53:08 +0200
committerAkim Demaille <demaille@gostai.com>2008-11-09 20:54:03 +0100
commitdb65ca1f12743e848a666209a744d514c6bf7315 (patch)
treea186b5c2135940a195d9b6b01fb289faedcf3a1a /etc
parent9b0efa5bc24b3f412b6579b5068cb52bab5c197f (diff)
downloadbison-db65ca1f12743e848a666209a744d514c6bf7315.tar.gz
fix eof condition
Diffstat (limited to 'etc')
-rwxr-xr-xetc/bench.pl.in8
1 files changed, 5 insertions, 3 deletions
diff --git a/etc/bench.pl.in b/etc/bench.pl.in
index 40023d3f..1497a695 100755
--- a/etc/bench.pl.in
+++ b/etc/bench.pl.in
@@ -575,8 +575,7 @@ sub generate_grammar_list ($$@)
{
my ($base, $max, @directive) = @_;
my $directives = directives ($base, @directive);
- my $variant = grep { $_ eq '%define variant' } @directive;
-
+ my $variant = grep { /%define variant/ } @directive;
my $out = new IO::File ">$base.y"
or die;
print $out <<EOF;
@@ -917,7 +916,10 @@ sub parse (@)
{
@token = @_;
verbose 2, "Parsing: @token\n";
- return parse_expr ();
+ my @res = parse_expr ();
+ die "expected end of directives, unexpected: @token"
+ if defined $token[0];
+ return @res;
}
sub parse_expr ()