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

style_text_without_curly_curly

style_text() without rules for \{\{


Description

This function mocks style_text(), but without taking into consideration the rules for the curly-curly syntactic sugar (introduced in rlang 0.4). This function (style_text_without_curly_curly()) is needed for testing only, namely to test indention with multiple curly braces in a sequence. It is important to maintain testing for indention rules even as the curly-curly expression is always kept on the same line in the tidyverse style guide because we should ensure the underlying mechanics for indention work correctly. When indention mechanisms are changed later, e.g. by simplifying compute_indent_indices(), we must have a way of testing this without the interaction of \{\{.

Usage

style_text_without_curly_curly(
  text,
  ...,
  style = tidyverse_style,
  transformers = style(...),
  include_roxygen_examples = TRUE
)

See Also

set_line_break_around_curly_curly

Examples

styler:::style_text_without_curly_curly("rlang::list2({{ x }} := 2)")
styler:::style_text("rlang::list2({{ x }} := 3)")

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.