/* Bison Grammar Scanner -*- C -*-
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009 Free Software
- Foundation, Inc.
+ Copyright (C) 2002-2007, 2009-2010 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
}
\\(.|\n) {
char const *p = yytext + 1;
- char quoted_ws[] = "` '";
- if (isspace (*p) && isprint (*p))
- {
- quoted_ws[1] = *p;
- p = quoted_ws;
- }
+ /* Quote only if escaping won't make the character visible. */
+ if (isspace ((unsigned char) *p) && isprint ((unsigned char) *p))
+ p = quote (p);
else
p = quotearg_style_mem (escape_quoting_style, p, 1);
complain_at (*loc, _("invalid character after \\-escape: %s"), p);