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>maint
parent
fcfe60668e
commit
1d9526df8d
|
@ -0,0 +1,6 @@
|
|||
RIGHT <- function(a, b) {
|
||||
c = mean(a, b)
|
||||
d = c + 2
|
||||
ChangeMe()
|
||||
return (d)
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
LEFT = function(a, b) {
|
||||
c = mean(a, b)
|
||||
RIGHT = function(d, e) {
|
||||
f = var(d, e)
|
||||
g = f + 1
|
||||
ChangeMe()
|
||||
return (g)
|
||||
}
|
||||
return (RIGHT(2, 3))
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
RIGHT <- function(a, b) {
|
||||
c = mean(a, b)
|
||||
d = c + 2
|
||||
ChangeMe()
|
||||
return (c)
|
||||
}
|
|
@ -327,6 +327,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.*)$",
|
||||
/* -- */
|
||||
"[^ \t]+"),
|
||||
PATTERNS("ruby",
|
||||
"^[ \t]*((class|module|def)[ \t].*)$",
|
||||
/* -- */
|
||||
|
|
Loading…
Reference in New Issue