bison-patches
[Top][All Lists]
Advanced

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

[PATCH 1/8] options: no longer document warnings when diagnosing an inva


From: Akim Demaille
Subject: [PATCH 1/8] options: no longer document warnings when diagnosing an invalid -W
Date: Thu, 14 Feb 2013 15:11:05 +0100

The argmatch functions accept prefixes of the alternatives (like
getopt does for long options).  Bison uses this to document the
warning categories.  This is troublesome: it duplicates the --help
documentation, it is not gettextized, it is displayed with ugly quotes
(because argmatch uses it to display the list of possible answers),
and it prevents straighforward uses of the tables of valid warning
categories (for instance so that warning diagnostics end with the name
of the warning).

The "hidden" option --trace uses the same trick, but it does not need
to be translated, nor to be described in --help.

* src/getargs.c (warnings_args): Remove pseudo documentation.
Comment changes.
---
 src/getargs.c | 24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/src/getargs.c b/src/getargs.c
index 97191ef..fe6c1d4 100644
--- a/src/getargs.c
+++ b/src/getargs.c
@@ -196,8 +196,6 @@ ARGMATCH_VERIFY (report_args, report_types);
 
 static const char * const trace_args[] =
 {
-  /* In a series of synonyms, present the most meaningful first, so
-     that argmatch_valid be more readable.  */
   "none       - no traces",
   "scan       - grammar scanner traces",
   "parse      - grammar parser traces",
@@ -244,18 +242,16 @@ ARGMATCH_VERIFY (trace_args, trace_types);
 
 static const char * const warnings_args[] =
 {
-  /* In a series of synonyms, present the most meaningful first, so
-     that argmatch_valid be more readable.  */
-  "none            - no warnings",
-  "midrule-values  - unset or unused midrule values",
-  "yacc            - incompatibilities with POSIX Yacc",
-  "conflicts-sr    - S/R conflicts",
-  "conflicts-rr    - R/R conflicts",
-  "deprecated      - obsolete constructs",
-  "precedence      - useless precedence and associativity",
-  "other           - all other warnings",
-  "all             - all of the above",
-  "error           - warnings are errors",
+  "none",
+  "midrule-values",
+  "yacc",
+  "conflicts-sr",
+  "conflicts-rr",
+  "deprecated",
+  "precedence",
+  "other",
+  "all",
+  "error",
   0
 };
 
-- 
1.8.1.3




reply via email to

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