bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/4] bench: die clearly on incorrect --grammar arguments


From: Akim Demaille
Subject: [PATCH 1/4] bench: die clearly on incorrect --grammar arguments
Date: Sat, 21 Mar 2020 18:39:17 +0100

* etc/bench.pl.in (getopt): here.
---
 etc/bench.pl.in | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/etc/bench.pl.in b/etc/bench.pl.in
index 153ae55d..6460a90c 100755
--- a/etc/bench.pl.in
+++ b/etc/bench.pl.in
@@ -1100,6 +1100,9 @@ sub getopt ()
   Getopt::Long::Configure ("bundling", "pass_through");
   GetOptions (%option)
     or exit 1;
+  my %grammars = map { $_ => 1 } qw[calc list triangular];
+  die "invalid grammar: $grammar, valid: @{[keys %grammars]}\n"
+    if !exists($grammars{$grammar});
 }
 
 ######################################################################
-- 
2.25.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]