parser_version_set {styler}R Documentation

Work with parser versions

Description

The structure of the parse data affects many operations in styler. There was unexpected behavior of the parser that styler was initially designed to work around. Examples are #187, #216, #100 and others. With #419, the structure of the parse data changes and we need to dispatch for older versions. As it is inconvenient to pass a parser version down in the call stack in various places, the environment env_current is used to store the current version globally but internally.

Usage

parser_version_set(version)

parser_version_get()

parser_version_find(pd)

Arguments

version

The version of the parser to be used.

pd

A parse table such as the output from utils::getParseData(parse(text = text)).

Details

We version the parser as follows:

version 3: After #582. R >= 4.0

The following utilities are available:


[Package styler version 1.10.3 Index]