bison-patches
[Top][All Lists]
Advanced

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

FYI: Missing \n


From: Akim Demaille
Subject: FYI: Missing \n
Date: Tue, 16 Jan 2007 13:27:26 +0100
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.92 (gnu/linux)

Hi Friends,

Just passing by.  Happy new year!

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.

Index: data/lalr1.cc
===================================================================
RCS file: /cvsroot/bison/bison/data/lalr1.cc,v
retrieving revision 1.152
diff -u -u -r1.152 lalr1.cc
--- data/lalr1.cc 16 Jan 2007 06:16:03 -0000 1.152
+++ data/lalr1.cc 16 Jan 2007 12:21:04 -0000
@@ -1,6 +1,6 @@
 # C++ skeleton for Bison
 
-# Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 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
@@ -1012,7 +1012,7 @@
     int yynrhs = yyr2_[yyrule];
     /* Print the symbols being reduced, and their result.  */
     *yycdebug_ << "Reducing stack by rule " << yyrule - 1
-              << " (line " << yylno << "), ";
+              << " (line " << yylno << "):" << std::endl;
     /* The symbols being reduced.  */
     for (int yyi = 0; yyi < yynrhs; yyi++)
       YY_SYMBOL_PRINT ("   $" << yyi + 1 << " =",



Here is the before/after difference when running `echo "1+2" |
_build/examples/calc++/calc++ -p -':

~/src/bison % diff old new -u                                   nostromo Err 1
--- old 2007-01-16 13:22:36.000000000 +0100
+++ new 2007-01-16 13:23:30.000000000 +0100
@@ -1,13 +1,15 @@
 cannot open -
 Starting parse
 Entering state 0
-Reducing stack by rule 3 (line 7997), -> $$ = nterm assignments (-:1.1: )
+Reducing stack by rule 3 (line 7997):
+-> $$ = nterm assignments (-:1.1: )
 Stack now 0
 Entering state 2
 Reading a token: Next token is token "number" (-:1.1: 1)
 Shifting token "number" (-:1.1: 1)
 Entering state 5
-Reducing stack by rule 10 (line 8010),    $1 = token "number" (-:1.1: 1)
+Reducing stack by rule 10 (line 8010):
+   $1 = token "number" (-:1.1: 1)
 -> $$ = nterm exp (-:1.1: )
 Stack now 0 2
 Entering state 7
@@ -17,19 +19,22 @@
 Reading a token: Next token is token "number" (-:1.3: 2)
 Shifting token "number" (-:1.3: 2)
 Entering state 5
-Reducing stack by rule 10 (line 8010),    $1 = token "number" (-:1.3: 2)
+Reducing stack by rule 10 (line 8010):
+   $1 = token "number" (-:1.3: 2)
 -> $$ = nterm exp (-:1.3: )
 Stack now 0 2 7 9
 Entering state 15
 Reading a token: Now at end of input.
-Reducing stack by rule 5 (line 8005),    $1 = nterm exp (-:1.1: )
+Reducing stack by rule 5 (line 8005):
+   $1 = nterm exp (-:1.1: )
    $2 = token '+' (-:1.2: )
    $3 = nterm exp (-:1.3: )
 -> $$ = nterm exp (-:1.1-3: )
 Stack now 0 2
 Entering state 7
 Now at end of input.
-Reducing stack by rule 1 (line 7994),    $1 = nterm assignments (-:1.1: )
+Reducing stack by rule 1 (line 7994):
+   $1 = nterm assignments (-:1.1: )
    $2 = nterm exp (-:1.1-3: )
 -> $$ = nterm unit (-:1.1-3: )
 Stack now 0




(Hum...  Some day we should use more precise locations than "line
7994": the file name would be most welcome.   Maybe we should move the
a "compilation-log" format to make it usable from tools such as Emacs:


@@ -17,19 +19,22 @@
 Reading a token: Next token is token "number" (-:1.3: 2)
 Shifting token "number" (-:1.3: 2)
 Entering state 5
-Reducing stack by rule 10 (line 8010),    $1 = token "number" (-:1.3: 2)
+bison.texinfo:8010: Reducing stack by rule 10:
+   $1 = token "number" (-:1.3: 2)
 -> $$ = nterm exp (-:1.3: )
 Stack now 0 2 7 9
 Entering state 15
 Reading a token: Now at end of input.
-Reducing stack by rule 5 (line 8005),    $1 = nterm exp (-:1.1: )
+bison.texinfo:8005: Reducing stack by rule 5:
+   $1 = nterm exp (-:1.1: )
    $2 = token '+' (-:1.2: )
    $3 = nterm exp (-:1.3: )
 -> $$ = nterm exp (-:1.1-3: )
 Stack now 0 2
 Entering state 7
 Now at end of input.
-Reducing stack by rule 1 (line 7994),    $1 = nterm assignments (-:1.1: )
+bison.texinfo:7994: Reducing stack by rule 1:
+   $1 = nterm assignments (-:1.1: )
    $2 = nterm exp (-:1.1-3: )
 -> $$ = nterm unit (-:1.1-3: )
 Stack now 0


)




reply via email to

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