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

add_token_terminal

Add information about previous / next token to each terminal


Description

Note that this does function must be called in compute_parse_data_nested() and we cannot wait to initialize this attribute until apply_transformers(), where all other attributes are initialized with default_style_guide_attributes() (when using tidyverse_style()) because for cached code, we don't build up the nested structure and leave it shallow (to speed up things), see also drop_cached_children().

Usage

add_terminal_token_after(pd_flat)

add_terminal_token_before(pd_flat)

add_attributes_caching(pd_flat, transformers, more_specs)

remove_terminal_token_before_and_after(pd_flat)

Arguments

pd_flat

A flat parse table.

transformers

Passed to cache_make_key() to generate a key.

more_specs

Passed to cache_make_key() to generate a key.

Functions

  • add_attributes_caching: Initializes newlines and lag_newlines.

  • remove_terminal_token_before_and_after: Removes column terimnal_token_before. Might be used to prevent the use of invalidated information, e.g. if tokens were added to the nested parse table.


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.