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.
This commit is contained in:
Joel E. Denny
2006-07-08 00:02:04 +00:00
parent dd60572a8b
commit 4a678af8c6
5 changed files with 16 additions and 7 deletions

View File

@@ -1,3 +1,12 @@
2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
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 <jdenny@ces.clemson.edu>
In warnings, say "previous declaration" rather than "first

View File

@@ -1584,8 +1584,8 @@ YYLTYPE yylloc;
{
/* Bison's grammar can initial empty locations, hence a default
location is needed. */
boundary_set (&yylloc.start, current_file, 1, 0);
boundary_set (&yylloc.end, current_file, 1, 0);
boundary_set (&yylloc.start, current_file, 1, 1);
boundary_set (&yylloc.end, current_file, 1, 1);
}
/* Line 1085 of yacc.c. */
#line 1592 "parse-gram.c"

View File

@@ -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. */

View File

@@ -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);

View File

@@ -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 {...}
]])