powered by
Find the index of the next or previous non-comment in a parse table.
next_non_comment(pd, pos)previous_non_comment(pd, pos)
previous_non_comment(pd, pos)
A parse table.
The position of the token to start the search from.
Other third-party style guide helpers: pd_is, scope_normalize()
pd_is
scope_normalize()
code <- "a <- # hi \n x %>% b()" writeLines(code) pd <- compute_parse_data_nested(code) child <- pd$child[[1]] previous_non_comment(child, 4L) next_non_comment(child, 2L)
Run the code above in your browser using DataLab