alignment_drop_last_expr: Remove last expression

View source: R/detect-alignment-utils.R

alignment_drop_last_exprR Documentation

Remove last expression

Description

In a nest, if the last token is an expr, the nest represents either an if, while or for statement or a function call. We don't call about that part, in fact it's important to remove it for alignment. See 'Examples'.

Usage

alignment_drop_last_expr(pds_by_line)

Examples


call(
  x = 12,
  y =  3,
)

function(a = 33,
         qq = 4) {
  # we don't care about this part for alignment detection
}


styler documentation built on Aug. 29, 2023, 5:10 p.m.