Re: [PATCH v2 0/5] Fun with cpp word regex
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Oct 10, 2021, 20:15 UTC
- Message-ID
- <27a4476a-4743-b798-b3fa-ce068472143b@kdbg.org>
- In-Reply-To
- <87mtnjm416.fsf@evledraar.gmail.com>
Am 09.10.21 um 02:00 schrieb Ævar Arnfjörð Bjarmason:
Show 22 quoted lines
> For an example of something we do a bit badly with the cpp driver is
> parts of my 66f5f6dca95 (C style: use standard style for "TRANSLATORS"
> comments, 2017-05-11).
>
> I.e. there I was changing a comment format, and added a full stop to a
> sentence, the word-diff is:
>
> /*
> {+*+} TRANSLATORS: here is a comment that explains the string to
> {+*+} be translated, that follows immediately after [-it-]{+it.+}
> */
>
> Even though it has nothing to do with C syntax per-se that would be much more useful as:
>
> /*
> {+*+} TRANSLATORS: here is a comment that explains the string to
> {+*+} be translated, that follows immediately after it{+.+}
> */
>
> I.e. treating a "." at the end of a word specially isn't C or C++
> syntax, but it's absolutely input that the cpp driver *is* getting and
> should be if possible be handling well.FWIW, I wondered why the cpp driver should not handle this case as you expect it, and the answer is that it actually does when this comment appears in a C file. This particular word-diff occurs in Documentation/CodingGuidelines and that is not covered by the cpp driver.
-- Hannes