git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] userdiff: add support for R programming language
@ 2025-05-25 21:02 Rodrigo Carvalho
  2025-05-25 21:02 ` [PATCH 2/2] t4018: add two userdiff tests for R language Rodrigo Carvalho
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Rodrigo Carvalho @ 2025-05-25 21:02 UTC (permalink / raw)
  To: git; +Cc: Rodrigo Carvalho

The patch appends userdiff.c file in order to support R programming
language function header. This will be useful for those who use Git
for versioning .R files.

Signed-off-by: Rodrigo Carvalho <rodrigorsdc@gmail.com>
---
 userdiff.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/userdiff.c b/userdiff.c
index da75625020..d1d31ea67e 100644
--- a/userdiff.c
+++ b/userdiff.c
@@ -317,6 +317,10 @@ PATTERNS("python",
 	 "|[-+0-9.e]+[jJlL]?|0[xX]?[0-9a-fA-F]+[lL]?"
 	 "|[-+*/<>%&^|=!]=|//=?|<<=?|>>=?|\\*\\*=?"),
 	 /* -- */
+PATTERNS("r",
+	"^[ \t]*([a-zA-z][a-zA-Z0-9_.]*[ \t]*<-[ \t]*function.*)$",
+	/* -- */
+	"[a-zA-Z_][a-zA-Z0-9_.]*"),
 PATTERNS("ruby",
 	 "^[ \t]*((class|module|def)[ \t].*)$",
 	 /* -- */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-06-03 21:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-25 21:02 [PATCH 1/2] userdiff: add support for R programming language Rodrigo Carvalho
2025-05-25 21:02 ` [PATCH 2/2] t4018: add two userdiff tests for R language Rodrigo Carvalho
2025-05-25 22:42   ` Eric Sunshine
2025-05-26  5:57 ` [PATCH 1/2] userdiff: add support for R programming language Johannes Sixt
2025-05-27 15:04   ` Junio C Hamano
2025-05-29 21:36     ` Rodrigo Carvalho
2025-05-29 22:16 ` [PATCH v2] " Rodrigo Carvalho
2025-06-03 18:20   ` Junio C Hamano
2025-06-03 21:15     ` Johannes Sixt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).