Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

find_tokens_to_update

Find the tokens to update when applying a reference indention


Description

Given a target token and a flattened parse table, the token for which the spacing information needs to be updated are computed. Since indention is already embedded in the column lag_spaces, only tokens at the beginning of a line are of concern.

Usage

find_tokens_to_update(flattened_pd, target_token)

Arguments

flattened_pd

A flattened parse table.

target_token

The index of the token from which the indention level should be applied to other tokens.

See Also

apply_ref_indention_one()

Examples

style_text("function(a =
b,
dd
) {}", scope = "indention")
style_text("function(a,
b,
dd
) {}", scope = "indention")

styler

Non-Invasive Pretty Printing of R Code

v1.4.1
MIT + file LICENSE
Authors
Kirill Müller [aut], Lorenz Walthert [cre, aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.