safer-r / saferDev

GNU General Public License v3.0
0 stars 0 forks source link

internal_fun_names takes only the first latter of the inside function name detected in a function, in .functions_detect() #46

Open gael-millot opened 3 weeks ago

gael-millot commented 3 weeks ago
internal_fun_names <- base::unlist(base::lapply(X = code, FUN = function(x){
    output <- base::sub(pattern = "^\\s*([a-zA-Z]|\\.[a-zA-Z._])[a-zA-Z0-9._]*\\s*<-[\\s\\r\\n]*function[\\s\\r\\n]*\\(.*", replacement = "\\1", x = x, perl = TRUE)

probably because of sub()