bison-patches
[Top][All Lists]
Advanced

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

update to new gnulib repo


From: Joel E. Denny
Subject: update to new gnulib repo
Date: Mon, 21 Apr 2008 02:55:04 -0400 (EDT)

I committed this.

Index: ChangeLog
===================================================================
RCS file: /sources/bison/bison/ChangeLog,v
retrieving revision 1.1781
diff -p -u -r1.1781 ChangeLog
--- ChangeLog   21 Apr 2008 01:03:20 -0000      1.1781
+++ ChangeLog   21 Apr 2008 06:39:32 -0000
@@ -1,3 +1,23 @@
+2008-04-21  Joel E. Denny  <address@hidden>
+
+       Update to the current gnulib CVS repository, and fix trigraph handling
+       in Bison.
+       * bootstrap: Update gnulib CVS repository URL.
+       (symlink_to_dir): Encapsulate the code that guarantees the destination
+       directory exists into...
+       (check_dst_dir): ... this new function, and...
+       (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
+       fail when copying files into lib/uniwidth/.
+       * src/output.c (prepare_symbols): When writing yytname muscles, where
+       symbol names will be encoded in C-string literals, tell quotearg to
+       escape trigraphs.  This used to be the default in gnulib.
+       * tests/regression.at (Token definitions): Because of the change in
+       gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
+       escapes trigraphs in symbol names.  Thus, yytname no longer has
+       trigraphs unnecessarily doubly escaped.  Update test case output.
+       Extend test case to be sure Bison's own error messages will no longer
+       have trigraphs in symbol names unnecessarily escaped once.
+
 2008-04-20  Joel E. Denny  <address@hidden>
 
        Fix make dist infinite loop reported by Juan Manuel Guerrero at
Index: bootstrap
===================================================================
RCS file: /sources/bison/bison/bootstrap,v
retrieving revision 1.57
diff -p -u -r1.57 bootstrap
--- bootstrap   4 Nov 2007 20:40:50 -0000       1.57
+++ bootstrap   21 Apr 2008 06:39:32 -0000
@@ -2,7 +2,8 @@
 
 # Bootstrap this package from checked-out sources.
 
-# Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation,
+# Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -274,7 +275,7 @@ case ${GNULIB_SRCDIR--} in
 
     trap cleanup_gnulib 1 2 13 15
 
-    cvs -z3 -q -d ${CVS_PREFIX}cvs.savannah.gnu.org:/cvsroot/gnulib co gnulib 
||
+    cvs -z3 -q -d ${CVS_PREFIX}pserver.git.sv.gnu.org:/gnulib.git co -d gnulib 
HEAD ||
       cleanup_gnulib
 
     trap - 1 2 13 15
@@ -333,6 +334,27 @@ case $SKIP_PO in
   fi;;
 esac
 
+check_dst_dir()
+{
+  dst=$1
+  # If the destination directory doesn't exist, create it.
+  # This is required at least for "lib/uniwidth/cjk.h".
+  dst_dir=`dirname "$dst"`
+  if ! test -d "$dst_dir"; then
+    mkdir -p "$dst_dir"
+
+    # If we've just created a directory like lib/uniwidth,
+    # tell version control system(s) it's ignorable.
+    # FIXME: for now, this does only one level
+    parent=`dirname "$dst_dir"`
+    for dot_ig in x $vc_ignore; do
+      test $dot_ig = x && continue
+      ig=$parent/$dot_ig
+      insert_sorted_if_absent $ig `echo "$dst_dir"|sed 's,.*/,,'`
+    done
+  fi
+}
+
 symlink_to_dir()
 {
   src=$1/$2
@@ -340,22 +362,7 @@ symlink_to_dir()
 
   test -f "$src" && {
 
-    # If the destination directory doesn't exist, create it.
-    # This is required at least for "lib/uniwidth/cjk.h".
-    dst_dir=`dirname "$dst"`
-    if ! test -d "$dst_dir"; then
-      mkdir -p "$dst_dir"
-
-      # If we've just created a directory like lib/uniwidth,
-      # tell version control system(s) it's ignorable.
-      # FIXME: for now, this does only one level
-      parent=`dirname "$dst_dir"`
-      for dot_ig in x $vc_ignore; do
-       test $dot_ig = x && continue
-       ig=$parent/$dot_ig
-       insert_sorted_if_absent $ig `echo "$dst_dir"|sed 's,.*/,,'`
-      done
-    fi
+    check_dst_dir "$dst"
 
     if $copy; then
       {
@@ -419,6 +426,7 @@ cp_mark_as_generated()
        sed "s!$bt_regex/!!g" "$cp_src" > "$cp_dst"
       }
     else
+      check_dst_dir "$cp_dst"
       # Copy the file first to get proper permissions if it
       # doesn't already exist.  Then overwrite the copy.
       cp "$cp_src" "$cp_dst-t" &&
Index: src/output.c
===================================================================
RCS file: /sources/bison/bison/src/output.c,v
retrieving revision 1.271
diff -p -u -r1.271 output.c
--- src/output.c        29 Oct 2007 17:36:39 -0000      1.271
+++ src/output.c        21 Apr 2008 06:39:32 -0000
@@ -1,7 +1,7 @@
 /* Output the generated parsing program for Bison.
 
    Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002, 2003, 2004,
-   2005, 2006, 2007 Free Software Foundation, Inc.
+   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
@@ -156,9 +156,12 @@ prepare_symbols (void)
     int i;
     /* We assume that the table will be output starting at column 2. */
     int j = 2;
+    struct quoting_options *qo = clone_quoting_options (0);
+    set_quoting_style (qo, c_quoting_style);
+    set_quoting_flags (qo, QA_SPLIT_TRIGRAPHS);
     for (i = 0; i < nsyms; i++)
       {
-       char const *cp = quotearg_style (c_quoting_style, symbols[i]->tag);
+       char *cp = quotearg_alloc (symbols[i]->tag, -1, qo);
        /* Width of the next token, including the two quotes, the
           comma and the space.  */
        int width = strlen (cp) + 2;
@@ -172,9 +175,11 @@ prepare_symbols (void)
        if (i)
          obstack_1grow (&format_obstack, ' ');
        MUSCLE_OBSTACK_SGROW (&format_obstack, cp);
+        free (cp);
        obstack_1grow (&format_obstack, ',');
        j += width;
       }
+    free (qo);
     obstack_sgrow (&format_obstack, " ]b4_null[");
 
     /* Finish table and store. */
Index: tests/regression.at
===================================================================
RCS file: /sources/bison/bison/tests/regression.at,v
retrieving revision 1.118
diff -p -u -r1.118 regression.at
--- tests/regression.at 17 Feb 2008 00:18:36 -0000      1.118
+++ tests/regression.at 21 Apr 2008 06:39:33 -0000
@@ -444,6 +444,7 @@ int yylex (void);
 %token C_TOKEN 'c'
 %token 'd' D_TOKEN
 %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
+%token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
 %%
 exp: "a" "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!";
 %%
@@ -469,10 +470,22 @@ main (void)
 }
 ]])
 
-AT_BISON_CHECK([-o input.c input.y])
+# Checking the warning message guarantees that the trigraph "??!" isn't
+# unnecessarily escaped here even though it would need to be if encoded in a
+# C-string literal.  Also notice that unnecessary escaping, such as "\?", from
+# the user specification is eliminated.
+AT_BISON_CHECK([-o input.c input.y], [[0]], [[]],
+[[input.y:22.8-14: warning: symbol SPECIAL redeclared
+input.y:22.8-63: warning: symbol `"\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!"' 
used more than once as a literal string
+]])
 AT_COMPILE([input])
+
+# Checking the error message here guarantees that yytname, which does contain
+# C-string literals, does have the trigraph escaped correctly.  Thus, the
+# symbol name reported by the parser is exactly the same as that reported by
+# Bison itself.
 AT_DATA([experr],
-[[syntax error, unexpected "\\'?\"\a\b\f\n\r\t\v\001\201\001\201?\?!", 
expecting a
+[[syntax error, unexpected "\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!", 
expecting a
 ]])
 AT_PARSER_CHECK([./input], 1, [], [experr])
 AT_CLEANUP




reply via email to

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