From: Joel E. Denny Date: Sat, 8 Jul 2006 00:02:04 +0000 (+0000) Subject: In the grammar file, the first column is 1 not 0 on the first line as X-Git-Tag: v2.3b~346 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/4a678af8c6f178b797e42a60d7ee3774afbdc14e?hp=dd60572a8b54ebc51421448f09f83f39bc0a4229 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. --- diff --git a/ChangeLog b/ChangeLog index 831687b6..8c8a0f66 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-07-07 Joel E. Denny + + 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 In warnings, say "previous declaration" rather than "first diff --git a/src/parse-gram.c b/src/parse-gram.c index 76abad68..a896d5eb 100644 --- a/src/parse-gram.c +++ b/src/parse-gram.c @@ -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" diff --git a/src/parse-gram.y b/src/parse-gram.y index ae9eb535..faf573ee 100644 --- a/src/parse-gram.y +++ b/src/parse-gram.y @@ -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. */ diff --git a/src/scan-gram.l b/src/scan-gram.l index 93b9288c..d5d92c4c 100644 --- a/src/scan-gram.l +++ b/src/scan-gram.l @@ -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); diff --git a/tests/input.at b/tests/input.at index fb571ab6..df1ab704 100644 --- a/tests/input.at +++ b/tests/input.at @@ -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 {...} ]])