From e3f8c4ef690e8e8df992dbcbc04e21c63e45986e Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Fri, 31 Aug 2012 17:50:31 +0200 Subject: [PATCH 1/9] yacc.c: style changes * data/yacc.c: (yytoken): Define with initial value. --- data/yacc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/data/yacc.c b/data/yacc.c index 01756884..2c57f01d 100644 --- a/data/yacc.c +++ b/data/yacc.c @@ -1513,7 +1513,7 @@ b4_c_function_def([[yyparse]], [[int]], b4_parse_param)[ int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ - int yytoken; + int yytoken = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval;]b4_locations_if([[ @@ -1538,7 +1538,6 @@ b4_c_function_def([[yyparse]], [[int]], b4_parse_param)[ goto yyread_pushed_token; }]])[ - yytoken = 0; yyss = yyssa; yyvs = yyvsa;]b4_locations_if([[ yyls = yylsa;]])[ From ae62d0fc4f3a19f24ee798ee3d7efbc3468ad659 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Wed, 22 Aug 2012 13:48:55 +0200 Subject: [PATCH 2/9] tests: fix push-pull test * tests/torture.at: %push-pull-parser is no longer supported. --- tests/torture.at | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/torture.at b/tests/torture.at index 338c1648..414abaca 100644 --- a/tests/torture.at +++ b/tests/torture.at @@ -427,20 +427,20 @@ main (int argc, const char **argv) { int count; int status; -]m4_bmatch([$2], [%push-], +]m4_bmatch([$2], [api.push-pull both], [[ yypstate *ps = yypstate_new (); ]])[ for (count = 0; count < 2; ++count) { int new_status; yylval = yylval_init; -]m4_bmatch([$2], [%push-], +]m4_bmatch([$2], [api.push-pull both], [[ new_status = yypull_parse (ps); ]], [[ new_status = yyparse (); ]])[ assert (0 <= count || new_status == status); status = new_status; } -]m4_bmatch([$2], [%push-], +]m4_bmatch([$2], [api.push-pull both], [[ yypstate_delete (ps); ]])[ return status; } From e411069eee85f879408693242cf176c42ab75de5 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Wed, 22 Aug 2012 14:26:26 +0200 Subject: [PATCH 3/9] tests: style changes * tests/torture.at (AT_DATA_STACK_TORTURE): M4 style changes to improve readability. Fix an assertion which, because of a <= instead of ==, did not check new_status as visibly meant. (get_args): New. --- tests/torture.at | 60 ++++++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/tests/torture.at b/tests/torture.at index 414abaca..705e131e 100644 --- a/tests/torture.at +++ b/tests/torture.at @@ -412,38 +412,44 @@ yylex (void) return EOF; } +/* Return argv[1] as an int. */ +static int +get_args (int argc, const char **argv) +{ + int res; + char *endp; + assert (argc == 2); + res = strtol (argv[1], &endp, 10); + assert (argv[1] != endp); + assert (0 <= res); + assert (res <= INT_MAX); + assert (errno != ERANGE); + return res; +} + int main (int argc, const char **argv) { - char *endp; - YYSTYPE yylval_init; - assert (argc == 2); - yylval_init = strtol (argv[1], &endp, 10); - assert (argv[1] != endp); - assert (0 <= yylval_init); - assert (yylval_init <= INT_MAX); - assert (errno != ERANGE); - yydebug = 1; - { - int count; - int status; + YYSTYPE yylval_init = get_args (argc, argv); + int status; + int count; ]m4_bmatch([$2], [api.push-pull both], -[[ yypstate *ps = yypstate_new (); -]])[ for (count = 0; count < 2; ++count) - { - int new_status; - yylval = yylval_init; -]m4_bmatch([$2], [api.push-pull both], -[[ new_status = yypull_parse (ps); -]], -[[ new_status = yyparse (); -]])[ assert (0 <= count || new_status == status); +[[ yypstate *ps = yypstate_new (); +]])[ yydebug = 1; + for (count = 0; count < 2; ++count) + { + int new_status; + yylval = yylval_init; + new_status = ]m4_bmatch([$2], [api.push-pull both], + [[yypull_parse (ps)]], + [[yyparse ()]])[; + if (count == 0) status = new_status; - } -]m4_bmatch([$2], [api.push-pull both], -[[ yypstate_delete (ps); -]])[ return status; - } + else + assert (new_status == status); + }]m4_bmatch([$2], [api.push-pull both],[[ + yypstate_delete (ps);]])[ + return status; } ]]) AT_BISON_OPTION_POPDEFS([$2]) From d740d2b541dff1d94d78bf6c5f38e7c6a34b036a Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Fri, 31 Aug 2012 18:18:13 +0200 Subject: [PATCH 4/9] --help: include a place to report translation issues http://lists.gnu.org/archive/html/bug-bison/2012-08/msg00007.html shows that it is useful to help users report translation issues. While at it, include other informative bits that the coreutils shows. * src/getargs.c (usage): Report more URLs where the user can refer to. Mostly copied/pasted from coreutils' emit_ancillary_info function. --- src/getargs.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/getargs.c b/src/getargs.c index 599cbbad..70a25e03 100644 --- a/src/getargs.c +++ b/src/getargs.c @@ -361,7 +361,25 @@ THINGS is a list of comma separated words that can include:\n\ `none' disable the report\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + putc ('\n', stdout); + printf (_("Report bugs to <%s>.\n"), PACKAGE_BUGREPORT); + printf (_("%s home page: <%s>.\n"), PACKAGE_NAME, PACKAGE_URL); + fputs (_("General help using GNU software: " + ".\n"), + stdout); + /* Don't output this redundant message for English locales. + Note we still output for 'C' so that it gets included in the + man page. */ + const char *lc_messages = setlocale (LC_MESSAGES, NULL); + if (lc_messages && strcmp (lc_messages, "en_")) + /* TRANSLATORS: Replace LANG_CODE in this URL with your language + code to + form one of the URLs at http://translationproject.org/team/. + Otherwise, replace the entire URL with your translation team's + email address. */ + fputs (_("Report translation bugs to " + ".\n"), stdout); + fputs (_("For complete documentation, run: info bison.\n"), stdout); } exit (status); From 2e350a617f9f770c92c99da491419fbd08155e8a Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Mon, 3 Sep 2012 10:56:54 +0200 Subject: [PATCH 5/9] gnulib: update --- gnulib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnulib b/gnulib index bd54a45e..e78c0c11 160000 --- a/gnulib +++ b/gnulib @@ -1 +1 @@ -Subproject commit bd54a45e6e4bcb3ee7359c9b4f1d831a6291148f +Subproject commit e78c0c11704500893203872898640bb23162a6f0 From 457bf91968a87a01dfb5317b008497ac4dcde8a4 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 5 Aug 2012 13:28:01 +0200 Subject: [PATCH 6/9] use locale-indep. c_is* functions for parsing, not isspace, isprint etc * src/parse-gram.y: Include "c-ctype.h". (add_param): Parse with c_isspace, not isspace. * src/parse-gram.c: Likewise. * src/scan-gram.l: Include c-ctype.h, not ctype.h. (SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER): Use c_isspace and c_isprint, not ctype.h's locale-dependent functions. --- src/parse-gram.c | 5 +++-- src/parse-gram.y | 5 +++-- src/scan-gram.l | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/parse-gram.c b/src/parse-gram.c index a04f2f23..037035bc 100644 --- a/src/parse-gram.c +++ b/src/parse-gram.c @@ -94,6 +94,7 @@ #include #include "system.h" +#include "c-ctype.h" #include "complain.h" #include "conflicts.h" #include "files.h" @@ -3170,11 +3171,11 @@ add_param (char const *type, char *decl, location loc) /* Strip the surrounding '{' and '}', and any blanks just inside the braces. */ --p; - while (isspace ((unsigned char) *p)) + while (c_isspace ((unsigned char) *p)) --p; p[1] = '\0'; ++decl; - while (isspace ((unsigned char) *decl)) + while (c_isspace ((unsigned char) *decl)) ++decl; if (! name_start) diff --git a/src/parse-gram.y b/src/parse-gram.y index 02af75e2..3120bfc2 100644 --- a/src/parse-gram.y +++ b/src/parse-gram.y @@ -20,6 +20,7 @@ #include #include "system.h" +#include "c-ctype.h" #include "complain.h" #include "conflicts.h" #include "files.h" @@ -735,11 +736,11 @@ add_param (char const *type, char *decl, location loc) /* Strip the surrounding '{' and '}', and any blanks just inside the braces. */ --p; - while (isspace ((unsigned char) *p)) + while (c_isspace ((unsigned char) *p)) --p; p[1] = '\0'; ++decl; - while (isspace ((unsigned char) *decl)) + while (c_isspace ((unsigned char) *decl)) ++decl; if (! name_start) diff --git a/src/scan-gram.l b/src/scan-gram.l index 75023f4f..dbea2a1d 100644 --- a/src/scan-gram.l +++ b/src/scan-gram.l @@ -36,7 +36,7 @@ #include "reader.h" #include "uniqstr.h" -#include +#include #include #include @@ -560,7 +560,7 @@ splice (\\[ \f\t\v]*\n)* \\(.|\n) { char const *p = yytext + 1; /* Quote only if escaping won't make the character visible. */ - if (isspace ((unsigned char) *p) && isprint ((unsigned char) *p)) + if (c_isspace ((unsigned char) *p) && c_isprint ((unsigned char) *p)) p = quote (p); else p = quotearg_style_mem (escape_quoting_style, p, 1); From 592bdad15e13564e1d8e621bce53bc9c485ee792 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Tue, 4 Sep 2012 09:49:17 +0200 Subject: [PATCH 7/9] remove useless include * src/system.h: Don't include sys/types.h. Reported by Eric Blake, . (FUNCTION_PRINT): Remove, unused. --- src/system.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/system.h b/src/system.h index 1ae6a6b4..bf7f59f9 100644 --- a/src/system.h +++ b/src/system.h @@ -38,11 +38,6 @@ # include # include # include - -# if HAVE_SYS_TYPES_H -# include -# endif - # include # include @@ -105,7 +100,6 @@ typedef size_t uintptr_t; # define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) # endif -# define FUNCTION_PRINT() fprintf (stderr, "%s: ", __func__) /*------. | NLS. | From 76e5017732612e64df8cb228b824819d5f00fbac Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Tue, 4 Sep 2012 10:48:26 +0200 Subject: [PATCH 8/9] update files to ignore * doc/.gitignore: Don't ignore split info files as we don't split our info file. See . --- doc/.gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/.gitignore b/doc/.gitignore index 7be09c4d..0fb0cca8 100644 --- a/doc/.gitignore +++ b/doc/.gitignore @@ -1,4 +1,3 @@ -/*.info* /*~ /.dirstamp /Makefile @@ -10,6 +9,7 @@ /bison.dvi /bison.fn /bison.html +/bison.info /bison.ky /bison.log /bison.pdf From 403ddfb7e079a03db54ac4454b97febeee878a3c Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Tue, 4 Sep 2012 10:58:23 +0200 Subject: [PATCH 9/9] maint: remove useless file * externals/bootstrap.cfg: Remove. This file was used by a specific build system. It was added to the master repository by accident. --- externals/bootstrap.cfg | 1 - 1 file changed, 1 deletion(-) delete mode 100644 externals/bootstrap.cfg diff --git a/externals/bootstrap.cfg b/externals/bootstrap.cfg deleted file mode 100644 index 6a0be6f7..00000000 --- a/externals/bootstrap.cfg +++ /dev/null @@ -1 +0,0 @@ -external: gnulib