YY_LOCATION_PRINT was recently improved to display the locations more nicely. In some situations, the displayed column could be negative. The following changes address this issue.
There is one dubious point on which I'd like opinions: I wrote the yy_location_print function to take a location by pointer, but the YY_LOCATION_PRINT macro takes a location by value. So I have: # define YY_LOCATION_PRINT(File, Loc) \ yy_location_print_ (File, &(Loc)) which in some situations can be really wrong (if Loc is a temporary). I don't think this would happen in practice, yet it is possible. I can change the yy_location_print function to take the location by value too, but that seems less natural (yet it is what bison does for its own handling of locations). Akim Demaille (3): glr.c: remove stray macro formatting changes yacc.c, glr.c: check and fix the display of locations THANKS | 1 + data/c.m4 | 92 ++++++++++++++++++++++++++++++++++++-------------------- data/glr.c | 7 ----- src/location.c | 4 +-- tests/actions.at | 77 ++++++++++++++++++++++++++++++++++++++++++++++- 5 files changed, 138 insertions(+), 43 deletions(-) -- 1.8.0.1
