powered by
Parse the lines of code one by one to find complete expressions in the code, and put them in a list.
split_source(x)
A list of character vectors, and each vector contains a complete R expression.
A character vector of R source code.
xfun::split_source(c("if (TRUE) {", "1 + 1", "}", "print(1:5)"))
Run the code above in your browser using DataLab