fn <- function(x) {
x + 1 # A comment, kept as part of the source
}
d <- getParseData(fn)
if (!is.null(d)) {
plus <- which(d$token == "'+'")
sum <- d$parent[plus]
print(d[as.character(sum),])
print(getParseText(d, sum))
}
Run the code above in your browser using DataLab