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

Re: [PATCH] userdiff: add support for Swift

From
Johannes Sixt <j6t@kdbg.org>
Date
Jul 20, 2026, 08:49 UTC
Message-ID
<7b541cd5-bd66-4675-818d-8e23eb1c9530@kdbg.org>
In-Reply-To
<2a3a73c5-5e90-44a3-bf6a-6e98ce5e5a59@kdbg.org>
Am 18.07.26 um 20:11 schrieb Johannes Sixt:
Show 8 quoted lines
> Am 17.07.26 um 16:02 schrieb Shlok Kulshreshtha:
>> +PATTERNS("swift",
>> +	 "^[ \t]*((@[A-Za-z_][A-Za-z0-9_]*(\\([^()]*\\))?[ \t]+)*([a-z]+[ \t]+)*(func|init|deinit|subscript|class|struct|enum|protocol|extension|actor)[ \t(?!<].*)$",
> 
> This looks good.
> 
> Notice, however, how the regular expression matcher has to backtrack on
> even simple lines such as
[...]
> It may be worth considering to enumerate all keywords and permit any run
> of them:

Let me back-paddle on this one. As I said, the original RE is good. I am making up a problem here without providing evidence. Modern RE matchers may be clever enough that there is no problem. If it turns out there is a problem, we can improve later something that already works.

-- Hannes
Previous: Junio C HamanoNext: Shlok Kulshreshtha
Message 5 of 12 in “userdiff: add support for Swift”
  1. userdiff: add support for SwiftShlok Kulshreshtha, Jul 17, 2026
  2. Junio C HamanoJul 17, 2026
  3. Johannes SixtJul 18, 2026
  4. Junio C HamanoJul 20, 2026
  5. Johannes SixtJul 20, 2026
  6. Shlok KulshreshthaJul 20, 2026
  7. userdiff: add support for SwiftShlok Kulshreshtha, Jul 21, 2026
  8. Junio C HamanoJul 21, 2026
  9. Johannes SixtJul 23, 2026
  10. Michael MontalboJul 27, 2026
  11. Johannes SixtJul 27, 2026
  12. Michael MontalboJul 27, 2026

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.