bison-patches
[Top][All Lists]
Advanced

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

first column is 1 not 0


From: Joel E. Denny
Subject: first column is 1 not 0
Date: Fri, 7 Jul 2006 20:02:17 -0400 (EDT)

While it might be debatable whether the first column should be called 1 or 
0, Bison reports it as 1 for every line in the grammar file except the 
first line.  I committed this to make it consistently 1.

Joel

Index: ChangeLog
===================================================================
RCS file: /sources/bison/bison/ChangeLog,v
retrieving revision 1.1521
diff -p -u -r1.1521 ChangeLog
--- ChangeLog   7 Jul 2006 21:25:03 -0000       1.1521
+++ ChangeLog   7 Jul 2006 23:56:47 -0000
@@ -1,5 +1,14 @@
 2006-07-07  Joel E. Denny  <address@hidden>
 
+       In the grammar file, the first column is 1 not 0 on the first line as
+       on every other line.
+       * src/parse-gram.y (%initial-action): Initialize @$ correctly.
+       * tests/input.at (Torturing the Scanner): Update output.
+
+       * src/scan-gram.l (scanner_cursor): Declare it static.
+
+2006-07-07  Joel E. Denny  <address@hidden>
+
        In warnings, say "previous declaration" rather than "first
        declaration".
        * src/symtab.c (redeclaration): Do that here.
Index: src/parse-gram.y
===================================================================
RCS file: /sources/bison/bison/src/parse-gram.y,v
retrieving revision 1.82
diff -p -u -r1.82 parse-gram.y
--- src/parse-gram.y    25 Jun 2006 06:59:54 -0000      1.82
+++ src/parse-gram.y    7 Jul 2006 23:56:48 -0000
@@ -88,8 +88,8 @@ static int current_prec = 0;
 {
   /* Bison's grammar can initial empty locations, hence a default
      location is needed. */
-  boundary_set (&@$.start, current_file, 1, 0);
-  boundary_set (&@$.end, current_file, 1, 0);
+  boundary_set (&@$.start, current_file, 1, 1);
+  boundary_set (&@$.end, current_file, 1, 1);
 }
 
 /* Only NUMBERS have a value.  */
Index: src/scan-gram.l
===================================================================
RCS file: /sources/bison/bison/src/scan-gram.l,v
retrieving revision 1.95
diff -p -u -r1.95 scan-gram.l
--- src/scan-gram.l     24 Jun 2006 06:51:27 -0000      1.95
+++ src/scan-gram.l     7 Jul 2006 23:56:48 -0000
@@ -54,7 +54,7 @@
    code_start = scanner_cursor = loc->start;           \
 
 /* Location of scanner cursor.  */
-boundary scanner_cursor;
+static boundary scanner_cursor;
 
 #define YY_USER_ACTION  location_compute (loc, &scanner_cursor, yytext, 
yyleng);
 
Index: tests/input.at
===================================================================
RCS file: /sources/bison/bison/tests/input.at,v
retrieving revision 1.48
diff -p -u -r1.48 input.at
--- tests/input.at      7 Jul 2006 21:25:03 -0000       1.48
+++ tests/input.at      7 Jul 2006 23:56:48 -0000
@@ -218,7 +218,7 @@ AT_SETUP([Torturing the Scanner])
 
 AT_DATA([input.y], [])
 AT_CHECK([bison input.y], [1], [],
-[[input.y:1.0: syntax error, unexpected end of file
+[[input.y:1.1: syntax error, unexpected end of file
 ]])
 
 
@@ -226,7 +226,7 @@ AT_DATA([input.y],
 [{}
 ])
 AT_CHECK([bison input.y], [1], [],
-[[input.y:1.0-1: syntax error, unexpected {...}
+[[input.y:1.1-2: syntax error, unexpected {...}
 ]])
 
 




reply via email to

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