2012/12/12 Akim Demaille <[email protected]>: > > Le 12 déc. 2012 à 11:32, Theophile Ranquet <[email protected]> a > écrit : > >> * src/scan-gram.l (unexpected_end): Here. >> * tests/input.at: Adjust for new order of error reports. > > Please, point to the commit which was reverted, and explain why what caused > the original patch to be revert no longer holds today. URLs would be useful > too.
I am going for the following, does this satisfy you? commit a860ad081d025db0629120d030fbf7fd8218949f Author: Theophile Ranquet <[email protected]> Date: Thu Nov 15 17:10:35 2012 +0000 scanner: reintroduce unput for missing end tokens Unput was no longer used since a POSIX-compatiblity issue with Flex 2.5.31, which has been adressed in newer versions of Flex. See this discussion: <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00029.html> This partially reverts commit aa4180418fff518198e1b0f2c43fec6432210dc7. * src/scan-gram.l (unexpected_end): Here. * tests/input.at: Adjust for new order of error reports. > >> index 5e5b1e8..70ad41b 100644 >> --- a/tests/input.at >> +++ b/tests/input.at >> @@ -1480,10 +1480,10 @@ AT_CHECK([[$PERL -e "print 'start: \'';" >> empty.y >> || exit 77]]) >> >> AT_BISON_CHECK([empty.y], [1], [], >> [[empty.y:2.8-9: warning: empty character literal [-Wother] >> -empty.y:3.8-4.0: warning: empty character literal [-Wother] >> empty.y:3.8-4.0: error: missing "'" at end of line >> -empty.y:4.8: warning: empty character literal [-Wother] >> +empty.y:3.8-4.0: warning: empty character literal [-Wother] >> empty.y:4.8: error: missing "'" at end of file >> +empty.y:4.8: warning: empty character literal [-Wother] >> ]]) > > I'd like to see -fcaret used here, to see how "cute" the location is. Sure. This revealed a bug in our carets, when the input is not terminated by a line feed. The following trivial patch fixes this, so it will be installed as another commit. diff --git a/src/location.c b/src/location.c index d48a0a1..c4e0a76 100644 --- a/src/location.c +++ b/src/location.c @@ -197,6 +197,8 @@ location_caret (FILE *out, location loc) /* Quote the file, indent by a single column. */ fputc (' ', out); + if (buf[len - 1] != '\n') + buf[len++] = '\n'; fwrite (buf, 1, len, out); /* Print the caret, with the same indent as above. */
