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

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

From
Atharva Raykar <raykar.ath@gmail.com>
Date
Mar 28, 2021, 12:45 UTC
Message-ID
<166B3835-32C3-4CE6-9799-C187284E5756@gmail.com>
In-Reply-To
<xmqq1rc0qjn1.fsf@gitster.g>
On 28-Mar-2021, at 04:39, Junio C Hamano <gitster@pobox.com> wrote:
Show 36 quoted lines
> 
> Junio C Hamano <gitster@pobox.com> writes:
> 
>> Atharva Raykar <raykar.ath@gmail.com> writes:
>> ...
>>> +           (ChangeMe 'suite-name tests)))))))
>>> \ No newline at end of file
>> 
>> Is there a good reason to leave the final line incomplete?  ...
>> I am also trying to figure out what you wanted to achieve ...
> 
> Taking all of them together, here is what I hope you may agree as
> its improved version.  The only differences from what you posted are
> corrections to all the "\ No newline at end of file" and the simplification
> of the pattern (remove "a dot" from the alternative and add \t next
> to SP).  Without changes, the new tests still pass so ... ;-)
> 
>    diff --git c/userdiff.c w/userdiff.c
>    index 5fd0eb31ec..685fe712aa 100644
>    --- c/userdiff.c
>    +++ w/userdiff.c
>    @@ -193,12 +193,8 @@ PATTERNS("rust",
>             "|[-+*\\/<>%&^|=!:]=|<<=?|>>=?|&&|\\|\\||->|=>|\\.{2}=|\\.{3}|::"),
>     PATTERNS("scheme",
>             "^[\t ]*(\\(define-?.*)$",
>    -	 /*
>    -	  * Scheme allows symbol names to have any character,
>    -	  * as long as it is not a form of a parenthesis.
>    -	  * The spaces must be escaped.
>    -	  */
>    -	 "(\\.|[^][)(\\}\\{ ])+"),
>    +	 /* whitespace separated tokens, but parentheses also can delimit words */
>    +	 "([^][)(\\}\\{ \t])+"),
>     PATTERNS("bibtex", "(@[a-zA-Z]{1,}[ \t]*\\{{0,1}[ \t]*[^ \t\"@',\\#}{~%]*).*$",
>             "[={}\"]|[^={}\" \t]+"),
>     PATTERNS("tex", "^(\\\\((sub)*section|chapter|part)\\*{0,1}\\{.*)$",

Thanks for these. I will eventually send another patch with the whitespaces corrected, and try to see if there is a better way to handle backslashes, other than the regex I suggested. I will also be writing another test case to check that case properly.

I will also incorporate the other changes suggested by Johannes and Ævar as well, My regex was not supposed to capture forms like `defined-thing`. And there are a few rough edges with some of my test cases, which I will correct as well in the next patch. It is also worth spending some more time and see if there is any other form other than definitions that a Scheme programmer other than myself may be interested in. I will consult a few Scheme communities and mailing lists and see what more experienced programmers have to say.

Previous: Atharva RaykarNext: Atharva Raykar
Message 11 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.