Skip to content

Commit 27eee4a

Browse files
Don't remove context unecessary. We now need it. Assuming that when token are added or removed, the rules account for token_after or token_before being potentially wrong. Don't think there is a case so far.
1 parent 14aebe0 commit 27eee4a

File tree

4 files changed

+1
-20
lines changed

4 files changed

+1
-20
lines changed

R/nest.R

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -302,16 +302,6 @@ add_attributes_caching <- function(pd_flat, transformers, more_specs) {
302302
pd_flat
303303
}
304304

305-
#' @describeIn add_token_terminal Removes column `terimnal_token_before`. Might
306-
#' be used to prevent the use of invalidated information, e.g. if tokens were
307-
#' added to the nested parse table.
308-
#' @keywords internal
309-
remove_terminal_token_before_and_after <- function(pd_flat) {
310-
pd_flat$token_before <- NULL
311-
pd_flat$token_after <- NULL
312-
pd_flat
313-
}
314-
315305
#' Helper for setting spaces
316306
#'
317307
#' @param spaces_after_prefix An integer vector with the number of spaces

R/style-guides.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ tidyverse_style <- function(scope = "tokens",
168168
force_assignment_op = force_assignment_op,
169169
resolve_semicolon = resolve_semicolon,
170170
add_brackets_in_pipe = add_brackets_in_pipe,
171-
remove_terminal_token_before_and_after = remove_terminal_token_before_and_after,
172171
wrap_if_else_while_for_fun_multi_line_in_curly =
173172
if (strict) wrap_if_else_while_for_fun_multi_line_in_curly
174173
)

man/add_token_terminal.Rd

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-transformers-drop.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ test_that("tidyverse transformers are correctly dropped", {
8585

8686
names_tokens <- c(
8787
"fix_quotes",
88-
if (getRversion() < 3.6) "force_assignment_op",
89-
"remove_terminal_token_before_and_after"
88+
if (getRversion() < 3.6) "force_assignment_op"
9089
)
9190
expect_setequal(names(t_fun$token), names_tokens)
9291
})

0 commit comments

Comments
 (0)