## Keep parse data in non interactive sessions.
if (!interactive())
op <- options(keep.source = TRUE)
## Correct comments
fil <- tempfile(fileext = ".R")
cat("### foo",
"##-- bar",
"## ",
"#",
"#***",
file = fil, sep = "\n")
comments_style(getSourceData(fil))
## Incorrect comments
fil <- tempfile(fileext = ".R")
cat("###foo",
"##++bar",
file = fil, sep = "\n")
comments_style(getSourceData(fil))
Run the code above in your browser using DataLab