bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Miscellaneous code readability improvements.


From: Joel E. Denny
Subject: Re: [PATCH] Miscellaneous code readability improvements.
Date: Thu, 13 Aug 2009 12:40:00 -0400 (EDT)
User-agent: Alpine 1.00 (DEB 882 2007-12-20)

Hi Akim.

On Thu, 13 Aug 2009, Akim Demaille wrote:

> Le 13 août 09 à 10:02, Joel E. Denny a écrit :
> 
> >  \\(.|\n)   {
> > -    complain_at (*loc, _("unrecognized escape sequence: %s"), quote
> > (yytext));
> > +    complain_at (*loc, _("unrecognized escape sequence: `%s'"), yytext);
> >    STRING_GROW;
> >  }
> 
> I think it should be
> 
> > +    complain_at (*loc, _("unrecognized escape sequence: `\\%s'"), yytext +
> > 1);
> 
> to cope with \ followed by a non printable character (including \n).

I'm not sure what you're going for.  As far as I can tell, that just moves 
the "\" from the argument to the format string.  A following special 
character like newline still prints as a newline.

> The
> others should probably be adjusted for consistency, and to provide the
> translators with a single "escape-sequence" message.

Agreed.  I wondered about the difference between "unrecognized" and 
"invalid" escape sequences.  Which term is better?

> Also, up to now we avoided using quotes when the culprit is the last guy on
> the line.

I noticed that too, but the special character could be a space, for 
example, and I'm not sure how we should handle that.

> We should really write our conventions somewhere :(

Maybe we can start a "Coding Conventions" section in HACKING.  We could 
just add notes as they come up in the mailing list.  No need to think of 
it all at once.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]