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

apply_stylerignore

Ensure correct positional information for stylerignore expressions


Description

Ensure correct positional information for stylerignore expressions

Usage

apply_stylerignore(flattened_pd)

Arguments

flattened_pd

A flattened parse table.

Details

  • Get the positional information for tokens with a stylerignore tag from env_current, which recorded that information from the input text.

  • Replace the computed lag_newlines and lag_spaces information in the parse table with this information.

  • Because we may remove or add tokens when applying the transformers, it is not save to merge via the pos_id of each token in a stylerignore sequence. We assume that the start and stop markers are the same after styling, so we join all tokens that were initially in a stylerignore sequence via the first pos_id in that stylerignore sequence.


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.