Remove all comment tokens
Concentrate newlines or spaces in a string
Adds the stylerignore column
Add column pos_id
and short
Add information about previous / next token to each terminal
Remove last expression
add_line_col_to_wrapped_expr
Adds line and col information to an expression from its child
Add the roxygen mask to code
Applying reference indention of a target token
Add the block id to a parse table
Serialize one line for a column
Checks if all arguments of column 1 are named
alignment_serialize_column
Serialize all lines for a given column
Assert text to be of positive length and replace it with the empty
string otherwise.
Serialize text from a parse table
alignment_has_correct_spacing_around_comma
Check if spacing around comma is correct
Apply reference indention to tokens
Ensure correct positional information for stylerignore expressions
Apply transformers to a parse table
Assert the transformers
alignment_ensure_no_closing_brace
Ensure the closing brace of the call is removed
Bind a parse table with one of its children
Check if a cache is activated
Make a key for R.cache
Remember the past to be quicker in the future
Make sure all supplied file types are allowed
alignment_ensure_trailing_comma
Ensure last pd has a trailing comma
Show information about the styler cache
Clear the cache
Activate or deactivate the styler cache
alignment_has_correct_spacing_around_eq_sub
Check if spacing around =
is correct
Where is the cache?
Check token validity
Construct an object of class vertical
Create more specs
Cache text
Invoke a system command
Communicate a warning if necessary
Construct paths of a tree object given the paths of *-in.R files
Combine child and internal child
Compute the indices that need indention
Find the groups of expressions that should be processed together
compute_parse_data_nested
Obtain a nested parse table from a character vector
Create a style guide
Capture and post-process the output of style_file
without causing side
effects
Choose the indention method for the tokens
Copy a file to a temporary directory
Create a terminal token
Enhance the mapping of text to the token "SPECIAL"
Create node from nested parse data
Construct *-out.R from a *-in.R
Communicate the summary of styling
Convert roxygen comments to Rd code
expressions_are_identical
Check whether two expressions are identical
Write to the cache
The elements that are added to this environment are:
find_blank_lines_to_next_expr
Find blank lines
Drop start / stop, when formatting is turned off
find_blank_lines_to_next_block
Number of lines between cache blocks
contains_else_expr_that_needs_braces
Check whether an else expression needs braces
create_node_from_nested_root
Convert a nested data frame into a node tree
Propagate context to terminals
get_addins_style_transformer_name
Return the style function or name
Replace single quotes with double quotes
Find the tokens to update when applying a reference indention
Ensure there is one (and only one) blank line at the end of a vector
Create valid pos_ids if possible
Lookup all tokens that have a unique token-text mapping
Add positional information of token to next terminal
Find the index of the last comment in the sequence of comments-only tokens
after the token that has position pos
in pd
.
Extract terminal tokens
Create a tree from text
What's the engine pattern for rmd code chunks?
is_code_chunk_header_or_xaringan_or_code_output
Identify spinning code chunk header or xaringan
has_crlf_as_first_line_sep
Check if a string uses CRLF EOLs
Standardize text for hashing
is_double_indent_function_declaration
Is the function declaration double indented?
context_towards_terminals
Update the a parse table given outer context
Closure to return a transformer function
convert_newlines_to_linebreaks
Replace the newline character with a line break
dir()
, but with full names, ignored case, and included hidden files and
recursive.
default_style_guide_attributes
Initialize default style guide attributes
Find the pos ids to keep
Enrich flattened parse table
dir()
, but without dot-prefix and different defaults
Ensure a correct text
of all strings and numeric constants
Get chunk pattern
Find the block to which a token belongs
Find dontrun
and friend sequences
Find legit starting value for a new positional id
Flatten some token in the nested parse table based on operators
Obtain robust parse data
find_line_break_position_in_multiline_call
Find index of the token before which the line should be broken
Flatten one level of nesting with its child
is_insufficiently_parsed_string
Identify strings that were not fully parsed
Identify comments that are shebangs
Generate a comprehensive collection test cases for comment / insertion
interaction
Test consist of if / if-else / if-else-if-else cases, paired with various
line-break and comment configurations. Used for internal testing.
Flatten a parse table
if_for_while_part_requires_braces
Check if if, for or while loop expression require a braces.
parse_transform_serialize_r
Parse, transform and serialize text
Save parsing from text
Establish testing setup for current environment
Check whether indention is needed
Check if text is cached
Changing the line definition
Lookup which new tokens were created from "SPECIAL"
Drop-in replacement for xfun:::invalid_utf8()
What is a parse table representing?
Get the value of an option
Check whether indention is needed
Prettify R code in current working directory
Identifies raw Rmd or Rnw code chunks
Set the write_tree argument
Specify spacing around math tokens
Parse roxygen comments into text
parse_tree_must_be_identical
Check whether a round trip verification can be carried out
Initialize attributes
Check if rd emulation is required with roxygen2::roc_proc_text()
save_after_styling_is_active
Heuristic to see if a file styled with the addin should be saved or not.
Check whether a parse table is a multi-line token
Map the file type to a corresponding regular expression
Unindent a child if necessary
Relocate an assignment expression
Relocate all assignment expressions that contain EQ_ASSIGN
within a nest
set_line_break_after_opening_if_call_is_multi_line
Sets line break after opening parenthesis
Match a stop candidate to a start
Find the index of the next or previous non-comment in a parse table.
n_times_faster_with_cache
Times two function calls with temporarily enabled cache
Tell me what the next terminal is
Shallowify the parse table
identify_start_to_stop_of_roxygen_examples_from_text
Figure out where code examples start and stop
parse_transform_serialize_r_block
Parse, transform and serialize a nested parse table
Convert the styling scope to its lower-level representation
style_roxygen_code_example
Style a roxygen code example that may contain dontrun and friends
Asks the user to supply a style
Prettify R source code
Helper for setting spaces
Nest a flat parse table
Set spacing of token to a certain level
Style guides
Style a string
Relocate the expressions containing the token EQ_ASSIGN
within the nested
parse table
Specify what is re-indented how
Create the path to a test that file
Test transformers_drop
for consistency
parse_transform_serialize_roxygen
Parse, transform and serialize roxygen comments
transform_mixed_non_empty
Ensure for .Rmd
and friends that a code chunk without code is formatted as
a code chunk without any lines.
Transform mixed contents
Repeat elements of a character vector times
times and collapse it
Separate chunks within Rmd and Rnw contents
Print styled code
wrap_else_multiline_curly
Add curly braces to else
Remove roxygen header
Remove dont* mask
Prettify a package
Transform a flat parse table with a list of transformers
serialize_parse_data_flattened
Serialize flattened parse data
set_space_between_eq_sub_and_comma
Set space between EQ_SUB
and "','"
style_roxygen_code_example_one
Style a roxygen code example with exactly one @example
or @exampleIf
Work with parser versions
Set space between levels of nesting
Split text into roxygen and non-roxygen example segments
Read UTF-8
Drop-in replacement for xfun::read_utf8()
, with an optional warn
argument.
specify_transformers_drop
Specify which tokens must be absent for a transformer to be dropped
set_and_assert_arg_filetype
Set the file type argument
Update the newlines attribute
Potentially transform a file
Test the dry argument
Transforming test input with a transformer function
Validate sequence of new position ids
Apply a function to the contents of a file
Stylers for RStudio Addins
Turn off styling for parts of the code
roxygen_remove_extra_brace
set_line_break_around_curly_curly
Styling around \{\{
Non-invasive pretty printing of R code
Transform a file and output a customized message
set_line_break_if_call_is_multi_line
Set line break for multi-line function calls
Set the multi-line column
set_line_break_before_curly_opening
Set line break before a curly brace
style_text_without_curly_curly
style_text()
without rules for \{\{
The tidyverse style
Transform files with transformer functions
Standardize paths in root
Unindent a child
Revert the indention of function declaration header
Creates a flat parse table with minimal initialization
stylerignore_consolidate_col
Consolidate columns after a merge
Set indention of tokens that match regex
Set spaces around operators
start_comments_with_space
Start comments with a space
Run a collection of tests
Style files with R source code
Styles the highlighted selection in a .R
or .Rmd
file.
style_roxygen_example_snippet
Given a code snippet is dont* or run, style it
Check if tokens are aligned
Prettify arbitrary R code
Wrapper around style_pkg()
for access via Addin.
style_roxygen_code_example_segment
Style a roxygen code example segment
Remove transformers that are not needed
Style a file as if it was an .R file
Obtain token table from text
Drop-in replacement for xfun::write_utf8()
Verify the styling
Wrap a sub-expression in curly braces
style_space_around_math_token
Style spacing around math tokens
Update indention information of parse data
Transform a file an check the result
Visit'em all
Update the indention reference
wrap_if_else_while_for_fun_multi_line_in_curly
Wrap if-else, while and for statements in curly braces
Wrap an expression in curly braces
Transform code from R, Rmd or Rnw files
Wrap a multi-line statement in curly braces
Wrap an expression into an expression