Learn R Programming

styler (version 1.3.1)

find_pos_id_to_keep: Find the pos ids to keep

Description

To make a parse table shallow, we must know which ids to keep. split(cumsum(pd_parent_first$parent < 1)) above puts comments with negative parents in the same block as proceeding expressions. find_pos_id_to_keep() must hence always keep comments. We did not use split(cumsum(pd_parent_first$parent < 1)) because then every comment is an expression on its own and processing takes much longer for typical roxygen annotated code

Usage

find_pos_id_to_keep(pd)

Arguments

pd

A temporary top level nest where the first expression is always a top level expression, potentially cached.