bison-patches
[Top][All Lists]
Advanced

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

[PATCH] Initialize the muscle table before parsing the command line.


From: Akim Demaille
Subject: [PATCH] Initialize the muscle table before parsing the command line.
Date: Fri, 07 Nov 2008 20:38:34 -0000

        * src/getargs.c (quotearg.h, muscle_tab.h): Include.
        (getargs): Define file_name.
        * src/main.c (main): Initialize muscle_tab before calling
        getargs.
        * src/muscle_tab.c (muscle_init): No longer define file_name, as
        its value is not available yet.
---
 ChangeLog        |   10 ++++++++++
 src/getargs.c    |    3 +++
 src/main.c       |    5 ++---
 src/muscle_tab.c |    3 +--
 4 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index bf6b6d8..89c35f5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2008-11-07  Akim Demaille  <address@hidden>
 
+       Initialize the muscle table before parsing the command line.
+       * src/getargs.c (quotearg.h, muscle_tab.h): Include.
+       (getargs): Define file_name.
+       * src/main.c (main): Initialize muscle_tab before calling
+       getargs.
+       * src/muscle_tab.c (muscle_init): No longer define file_name, as
+       its value is not available yet.
+
+2008-11-07  Akim Demaille  <address@hidden>
+
        Locations without columns for command line arguments.
        * src/location.c (location_print): Don't display negative columns.
        * src/location.h: Document this.
diff --git a/src/getargs.c b/src/getargs.c
index 8af6528..cb90c36 100644
--- a/src/getargs.c
+++ b/src/getargs.c
@@ -26,6 +26,7 @@
 #include <c-strcase.h>
 #include <configmake.h>
 #include <error.h>
+#include <quotearg.h>
 
 /* Hack to get <getopt.h> to declare getopt with a prototype.  */
 #if lint && ! defined __GNU_LIBRARY__
@@ -43,6 +44,7 @@
 #include "complain.h"
 #include "files.h"
 #include "getargs.h"
+#include "muscle_tab.h"
 #include "uniqstr.h"
 
 bool debug_flag;
@@ -623,4 +625,5 @@ getargs (int argc, char *argv[])
     }
 
   current_file = grammar_file = uniqstr_new (argv[optind]);
+  MUSCLE_INSERT_C_STRING ("file_name", grammar_file);
 }
diff --git a/src/main.c b/src/main.c
index 9b472f1..b3ef70a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,7 +1,7 @@
 /* Top level entry point of Bison.
 
    Copyright (C) 1984, 1986, 1989, 1992, 1995, 2000, 2001, 2002, 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.
 
@@ -62,6 +62,7 @@ main (int argc, char *argv[])
   (void) textdomain (PACKAGE);
 
   uniqstrs_new ();
+  muscle_init ();
 
   getargs (argc, argv);
 
@@ -72,8 +73,6 @@ main (int argc, char *argv[])
   if (trace_flag & trace_bitsets)
     bitset_stats_enable ();
 
-  muscle_init ();
-
   /* Read the input.  Copy some parts of it to FGUARD, FACTION, FTABLE
      and FATTRS.  In file reader.c.  The other parts are recorded in
      the grammar; see gram.h.  */
diff --git a/src/muscle_tab.c b/src/muscle_tab.c
index afe59be..fe6affb 100644
--- a/src/muscle_tab.c
+++ b/src/muscle_tab.c
@@ -1,6 +1,6 @@
 /* Muscle table manager for Bison.
 
-   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
+   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
    Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
@@ -85,7 +85,6 @@ muscle_init (void)
 
   /* Version and input file.  */
   MUSCLE_INSERT_STRING ("version", VERSION);
-  MUSCLE_INSERT_C_STRING ("file_name", grammar_file);
 }
 
 
-- 
1.6.0.2.588.g3102





reply via email to

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