yacc.c, glr.c: check and fix the display of locations

In some case, negative column number could be displayed.
Make YY_LOCATION_PRINT similar to bison's own implementation of
locations.  Since the macro is getting fat, make it a static
function.
Reported by Jonathan Fabrizio.

* data/c.m4 (yy_location_print_define): Improve the implementation,
and generate the yy_location_print_ function.
Adjust YY_LOCATION_PRINT.
* tests/actions.at (Location Print): New tests.
This commit is contained in:
Akim Demaille
2012-11-30 11:19:43 +01:00
parent 4c36bc2b8d
commit 3804aa260b
3 changed files with 110 additions and 8 deletions

1
THANKS
View File

@@ -58,6 +58,7 @@ Jim Kent jkent@arch.sel.sony.com
Jim Meyering jim@meyering.net
Joel E. Denny joeldenny@joeldenny.org
Johan van Selst johans@stack.nl
Jonathan Fabrizio jonathan.fabrizio@lrde.epita.fr
Jonathan Nieder jrnieder@gmail.com
Juan Manuel Guerrero juan.guerrero@gmx.de
Kees Zeelenberg kzlg@users.sourceforge.net