git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Ævar Arnfjörð BjarmasonNext: Johannes Sixt via GitGitGadget
Message 16 of 24 in “Fun with cpp word regex”
  1. 0/3 Fun with cpp word regexJohannes Sixt via GitGitGadget, Oct 7, 2021
  2. 1/3 userdiff: tighten cpp word regexJohannes Sixt via GitGitGadget, Oct 7, 2021
  3. 2/3 userdiff: permit the digit-separating single-quote in numbersJohannes Sixt via GitGitGadget, Oct 7, 2021
  4. 3/3 userdiff: learn the C++ spaceship operatorJohannes Sixt via GitGitGadget, Oct 7, 2021
  5. Ævar Arnfjörð BjarmasonOct 7, 2021
  6. Johannes SixtOct 7, 2021
  7. 0/5 Fun with cpp word regexJohannes Sixt via GitGitGadget, Oct 8, 2021
  8. 1/5 t4034/cpp: actually test that operator tokens are not splitJohannes Sixt via GitGitGadget, Oct 8, 2021
  9. 2/5 t4034: add tests showing problematic cpp tokenizationsJohannes Sixt via GitGitGadget, Oct 8, 2021
  10. 3/5 userdiff-cpp: tighten word regexJohannes Sixt via GitGitGadget, Oct 8, 2021
  11. 4/5 userdiff-cpp: permit the digit-separating single-quote in numbersJohannes Sixt via GitGitGadget, Oct 8, 2021
  12. 5/5 userdiff-cpp: learn the C++ spaceship operatorJohannes Sixt via GitGitGadget, Oct 8, 2021
  13. Ævar Arnfjörð BjarmasonOct 8, 2021
  14. Johannes SixtOct 8, 2021
  15. Ævar Arnfjörð BjarmasonOct 9, 2021
  16. Johannes SixtOct 10, 2021
  17. 0/6 Fun with cpp word regexJohannes Sixt via GitGitGadget, Oct 10, 2021
  18. 1/6 t4034/cpp: actually test that operator tokens are not splitJohannes Sixt via GitGitGadget, Oct 10, 2021
  19. 2/6 t4034: add tests showing problematic cpp tokenizationsJohannes Sixt via GitGitGadget, Oct 10, 2021
  20. 4/6 userdiff-cpp: prepare test cases with yet unsupported featuresJohannes Sixt via GitGitGadget, Oct 10, 2021
  21. 3/6 userdiff-cpp: tighten word regexJohannes Sixt via GitGitGadget, Oct 10, 2021
  22. 5/6 userdiff-cpp: permit the digit-separating single-quote in numbersJohannes Sixt via GitGitGadget, Oct 10, 2021
  23. 6/6 userdiff-cpp: learn the C++ spaceship operatorJohannes Sixt via GitGitGadget, Oct 10, 2021
  24. 7/6 userdiff-cpp: back out the digit-separators in numbersJohannes Sixt, Oct 24, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.