Skip to content

Commit 9c4fc1e

Browse files
make things work for R < 3.6
1 parent 781f796 commit 9c4fc1e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

R/style-guides.R

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,11 @@ tidyverse_style <- function(scope = "tokens",
179179
token = list(
180180
resolve_semicolon = "';'",
181181
add_brackets_in_pipe = "SPECIAL-PIPE",
182-
force_assignment_op = c("token" = "EQ_ASSIGN"),
182+
# before 3.6, these assignments are not wrapped into top level expression
183+
# and `text` supplied to transformer_subset() is "", so it appears to not
184+
# contain EQ_ASSIGN, and the transformer is falsely removed.
185+
# compute_parse_data_nested / text_to_flat_pd ('a = 4')
186+
if (getRversion() >= 3.6) force_assignment_op <- "EQ_ASSIGN",
183187
wrap_if_else_while_for_fun_multi_line_in_curly = c("IF", "WHILE", "FOR", "FUNCTION")
184188
),
185189
line_break = list(

0 commit comments

Comments
 (0)