X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/ae93e4e4b8e78396a7707de3dcdd47aca7a46dec..71b52b1342c65a5497f6b3780481ff2deb932a56:/src/scan-gram.l diff --git a/src/scan-gram.l b/src/scan-gram.l index 449fbea9..e2e08f9a 100644 --- a/src/scan-gram.l +++ b/src/scan-gram.l @@ -39,6 +39,7 @@ #include #include #include +#include #include @@ -965,6 +966,10 @@ unexpected_end (boundary start, char const *msgid, char const *token_end) location loc; loc.start = start; loc.end = scanner_cursor; + token_end = quote (token_end); + // Instead of '\'', display "'". + if (STREQ (token_end, "'\\''", '\'', '\\', '\'', '\'', 0,0,0,0,0)) + token_end = "\"'\""; complain_at (loc, _(msgid), token_end); } @@ -977,7 +982,7 @@ unexpected_end (boundary start, char const *msgid, char const *token_end) static void unexpected_eof (boundary start, char const *token_end) { - unexpected_end (start, N_("missing '%s' at end of file"), token_end); + unexpected_end (start, N_("missing %s at end of file"), token_end); } @@ -988,7 +993,7 @@ unexpected_eof (boundary start, char const *token_end) static void unexpected_newline (boundary start, char const *token_end) { - unexpected_end (start, N_("missing '%s' at end of line"), token_end); + unexpected_end (start, N_("missing %s at end of line"), token_end); }