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