|
From: | Akim Demaille |
Subject: | Re: [PATCH] Miscellaneous code readability improvements. |
Date: | Thu, 13 Aug 2009 21:11:01 +0200 |
Le 13 août 09 à 18:40, Joel E. Denny a écrit :
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 movesthe "\" from the argument to the format string. A following special character like newline still prints as a newline.
Sorry Joel, I meant to restore the call to quote on yytext + 1.
Theothers should probably be adjusted for consistency, and to provide thetranslators with a single "escape-sequence" message.Agreed. I wondered about the difference between "unrecognized" and "invalid" escape sequences. Which term is better?
I prefer invalid. Unrecognized sounds like we failed to recognize it.
Also, up to now we avoided using quotes when the culprit is the last guy onthe 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.
Good point.
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 ofit all at once.
Good!
[Prev in Thread] | Current Thread | [Next in Thread] |