From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id A83EC1F670 for ; Sun, 10 Oct 2021 20:16:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231534AbhJJURn (ORCPT ); Sun, 10 Oct 2021 16:17:43 -0400 Received: from bsmtp1.bon.at ([213.33.87.15]:26032 "EHLO bsmtp1.bon.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229758AbhJJURn (ORCPT ); Sun, 10 Oct 2021 16:17:43 -0400 Received: from [192.168.0.98] (unknown [93.83.142.38]) by bsmtp1.bon.at (Postfix) with ESMTPSA id 4HSCq24FRYz5tl9; Sun, 10 Oct 2021 22:15:42 +0200 (CEST) Subject: Re: [PATCH v2 0/5] Fun with cpp word regex To: =?UTF-8?B?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Cc: git@vger.kernel.org, Johannes Sixt via GitGitGadget References: <87r1cvmg0c.fsf@evledraar.gmail.com> <25363715-dc39-1f18-a937-f715b106f529@kdbg.org> <87mtnjm416.fsf@evledraar.gmail.com> From: Johannes Sixt Message-ID: <27a4476a-4743-b798-b3fa-ce068472143b@kdbg.org> Date: Sun, 10 Oct 2021 22:15:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <87mtnjm416.fsf@evledraar.gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Am 09.10.21 um 02:00 schrieb Ævar Arnfjörð Bjarmason: > 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