Git fork

userdiff: add support for R programming language

Add userdiff patterns to support R programming language.

Also, add three userdiff tests for R programming language
files. These files define simple function and nested function,
with and without indentation.

Signed-off-by: Rodrigo Carvalho <rodrigorsdc@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Rodrigo Carvalho and committed by
Junio C Hamano
1d9526df fcfe6066

+26
+6
t/t4018/r-indent
··· 1 + RIGHT <- function(a, b) { 2 + c = mean(a, b) 3 + d = c + 2 4 + ChangeMe() 5 + return (d) 6 + }
+10
t/t4018/r-indent-nested
··· 1 + LEFT = function(a, b) { 2 + c = mean(a, b) 3 + RIGHT = function(d, e) { 4 + f = var(d, e) 5 + g = f + 1 6 + ChangeMe() 7 + return (g) 8 + } 9 + return (RIGHT(2, 3)) 10 + }
+6
t/t4018/r-noindent
··· 1 + RIGHT <- function(a, b) { 2 + c = mean(a, b) 3 + d = c + 2 4 + ChangeMe() 5 + return (c) 6 + }
+4
userdiff.c
··· 327 327 "|[-+0-9.e]+[jJlL]?|0[xX]?[0-9a-fA-F]+[lL]?" 328 328 "|[-+*/<>%&^|=!]=|//=?|<<=?|>>=?|\\*\\*=?"), 329 329 /* -- */ 330 + PATTERNS("r", 331 + "^[ \t]*([a-zA-z][a-zA-Z0-9_.]*[ \t]*(<-|=)[ \t]*function.*)$", 332 + /* -- */ 333 + "[^ \t]+"), 330 334 PATTERNS("ruby", 331 335 "^[ \t]*((class|module|def)[ \t].*)$", 332 336 /* -- */