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

Re: [GSOC][PATCH] userdiff: add support for Scheme

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 29, 2021, 20:47 UTC
Message-ID
<xmqq1rbxk7qi.fsf@gitster.g>
In-Reply-To
<562DCDA0-EAE6-408F-97D7-127689DE5559@gmail.com>
Atharva Raykar <raykar.ath@gmail.com> writes:
Show 14 quoted lines
>> Having said that, two further points.
>> 
>> - the "anything but whitespaces and various forms of parentheses"
>>   set would include backslash, so 'component\new' would be taken as
>>   a single word with "[^][()\\{\\} \t]+", wouldn't it?
>> 
>> - how common is the use of backslashes in identifiers?  I am trying
>>   to see if the additional complexity needed to support them is
>>   worth the benefit.
>
> I have refined the regex, and now it is much simpler and does all of what
> I want it to:
>
> 	"([^][)(}{[:space:]])+"
OK, [:space:] is already used elsewhere, so it would be OK.

In practice, the only difference from "[ \t]" (which is used in many other patterns in the same file) is that [:space:] class includes form-feed (\Ctrl-L); nobody would write vertical-tab in the code, and the matching is done one line at a time, so the fact that LF (or CRLF) is in the [:space:] class does not make a difference anyway.

> I did not have to escape the various parentheses, so I avoided the need to
> handle backslashes separately. The "\\t" was causing problems as well because

If you spelled "\\t" that would have caused a problem of your own making ;-)

I think what I gave in the message you are responding to was a single backslash followed by a 't', to let the compiler turn them into a single HT character, and that wouldn't have had such a problem---in fact "[ \t]" is used in many other existing rules in the same file.

Thanks.
Previous: Atharva RaykarNext: Phillip Wood
Message 15 of 35 in “userdiff: add support for Scheme”
  1. Atharva RaykarMar 27, 2021
  2. Junio C HamanoMar 27, 2021
  3. Junio C HamanoMar 27, 2021
  4. Ævar Arnfjörð BjarmasonMar 28, 2021
  5. Junio C HamanoMar 28, 2021
  6. Atharva RaykarMar 28, 2021
  7. Phillip WoodMar 29, 2021
  8. Atharva RaykarMar 30, 2021
  9. Ævar Arnfjörð BjarmasonMar 30, 2021
  10. Atharva RaykarMar 30, 2021
  11. Atharva RaykarMar 28, 2021
  12. Atharva RaykarMar 28, 2021
  13. Junio C HamanoMar 28, 2021
  14. Atharva RaykarMar 29, 2021
  15. Junio C HamanoMar 29, 2021
  16. Phillip WoodMar 29, 2021
  17. Johannes SixtMar 27, 2021
  18. Atharva RaykarMar 28, 2021
  19. Phillip WoodMar 29, 2021
  20. Johannes SixtMar 29, 2021
  21. Ævar Arnfjörð BjarmasonMar 29, 2021
  22. Phillip WoodMar 29, 2021
  23. Atharva RaykarMar 30, 2021
  24. Atharva RaykarMar 30, 2021
  25. Phillip WoodApr 5, 2021
  26. Johannes SixtApr 5, 2021
  27. Atharva RaykarApr 6, 2021
  28. Phillip WoodApr 6, 2021
  29. [GSoC][PATCH v2 0/1] userdiff: add support for schemeAtharva Raykar, Apr 3, 2021
  30. [GSoC][PATCH v2 1/1] userdiff: add support for schemeAtharva Raykar, Apr 3, 2021
  31. Phillip WoodApr 5, 2021
  32. Atharva RaykarApr 6, 2021
  33. [GSoC][PATCH v3 0/1] userdiff: add support for schemeAtharva Raykar, Apr 8, 2021
  34. [GSoC][PATCH v3 1/1] userdiff: add support for SchemeAtharva Raykar, Apr 8, 2021
  35. Junio C HamanoApr 12, 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.