Fix complaints about escape sequences.
authorJoel E. Denny <jdenny@clemson.edu>
Thu, 20 Aug 2009 00:37:28 +0000 (20:37 -0400)
committerJoel E. Denny <jdenny@clemson.edu>
Thu, 20 Aug 2009 01:05:07 +0000 (21:05 -0400)
commit39fb7e623967922da2fc0a6908dc94ed6e9f4488
tree793a1c64ef7629cbfccb777d21548b42f0d0376b
parentc33bc80009e05faf2b1e3b19cbbb46f0e253045e
Fix complaints about escape sequences.

Discussed starting at
<http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
* src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
For a \0 and similar escape sequences meaning the null
character, report an invalid escape sequence instead of an
invalid null character because the latter does not actually
appear in the user's input.
In all escape sequence complaints, don't escape the initial
backslash, and don't quote when the sequence appears at the end
of the complaint line unless there's whitespace that quotearg
won't escape.
Consistently say "invalid" not "unrecognized".
Consistently prefer "empty character literal" over "extra
characters in character literal" warning for invalid escape
sequences; that is, consistently discard those sequences.
* tests/input.at (Bad escapes in literals): New.
(cherry picked from commit c2724603c9d87e816dbdf1a9bfd7d70ffc1bd137)
ChangeLog
src/scan-gram.l
tests/input.at